From d76c2d45c465d20d481e599a8cbc333770f796b9 Mon Sep 17 00:00:00 2001 From: Matthew Olsson Date: Thu, 7 Mar 2024 21:40:22 -0700 Subject: [PATCH] LibWeb: Remove scopes for execution contexts in Animation finish steps --- Userland/Libraries/LibWeb/Animations/Animation.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/Userland/Libraries/LibWeb/Animations/Animation.cpp b/Userland/Libraries/LibWeb/Animations/Animation.cpp index f2e835e99d..b62e47a1d0 100644 --- a/Userland/Libraries/LibWeb/Animations/Animation.cpp +++ b/Userland/Libraries/LibWeb/Animations/Animation.cpp @@ -1101,10 +1101,8 @@ void Animation::update_finished_state(DidSeek did_seek, SynchronouslyNotify sync return; // 2. Resolve animation’s current finished promise object with animation. - { - HTML::TemporaryExecutionContext execution_context { Bindings::host_defined_environment_settings_object(realm) }; - WebIDL::resolve_promise(realm, current_finished_promise(), this); - } + HTML::TemporaryExecutionContext execution_context { Bindings::host_defined_environment_settings_object(realm) }; + WebIDL::resolve_promise(realm, current_finished_promise(), this); m_is_finished = true; // 3. Create an AnimationPlaybackEvent, finishEvent. @@ -1166,10 +1164,8 @@ void Animation::update_finished_state(DidSeek did_seek, SynchronouslyNotify sync // 6. If current finished state is false and animation’s current finished promise is already resolved, set // animation’s current finished promise to a new promise in the relevant Realm of animation. if (!current_finished_state && m_is_finished) { - { - HTML::TemporaryExecutionContext execution_context { Bindings::host_defined_environment_settings_object(realm) }; - m_current_finished_promise = WebIDL::create_promise(realm); - } + HTML::TemporaryExecutionContext execution_context { Bindings::host_defined_environment_settings_object(realm) }; + m_current_finished_promise = WebIDL::create_promise(realm); m_is_finished = false; }