mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-13 20:41:53 +00:00
LibWeb: Use TemporaryChange instead of ScopeGuard
This is a more idiomatic way to temporarily change a value. No functional changes.
This commit is contained in:
parent
ac46ec0b2e
commit
e941965b01
Notes:
github-actions[bot]
2025-05-16 22:30:27 +00:00
Author: https://github.com/gmta
Commit: e941965b01
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4779
1 changed files with 2 additions and 2 deletions
|
@ -4,6 +4,7 @@
|
|||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <AK/TemporaryChange.h>
|
||||
#include <LibWeb/DOM/Document.h>
|
||||
#include <LibWeb/DOM/Event.h>
|
||||
#include <LibWeb/DOM/Range.h>
|
||||
|
@ -25,8 +26,7 @@ WebIDL::ExceptionOr<bool> Document::exec_command(FlyString const& command, [[may
|
|||
// AD-HOC: All major browsers refuse to recursively execute execCommand() (e.g. inside input event handlers).
|
||||
if (m_inside_exec_command)
|
||||
return false;
|
||||
ScopeGuard guard_recursion = [&] { m_inside_exec_command = false; };
|
||||
m_inside_exec_command = true;
|
||||
TemporaryChange guard_recursion { m_inside_exec_command, true };
|
||||
|
||||
// 1. If only one argument was provided, let show UI be false.
|
||||
// 2. If only one or two arguments were provided, let value be the empty string.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue