From e941965b01aeedf3d3b895e6626cc0a2b19f4a96 Mon Sep 17 00:00:00 2001 From: Jelle Raaijmakers Date: Fri, 16 May 2025 14:30:20 +0200 Subject: [PATCH] LibWeb: Use TemporaryChange instead of ScopeGuard This is a more idiomatic way to temporarily change a value. No functional changes. --- Libraries/LibWeb/Editing/ExecCommand.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Libraries/LibWeb/Editing/ExecCommand.cpp b/Libraries/LibWeb/Editing/ExecCommand.cpp index 0af95fafc30..9d31239de63 100644 --- a/Libraries/LibWeb/Editing/ExecCommand.cpp +++ b/Libraries/LibWeb/Editing/ExecCommand.cpp @@ -4,6 +4,7 @@ * SPDX-License-Identifier: BSD-2-Clause */ +#include #include #include #include @@ -25,8 +26,7 @@ WebIDL::ExceptionOr 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.