1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 19:58:11 +00:00

LibWeb: Remove scopes for execution contexts in Animation finish steps

This commit is contained in:
Matthew Olsson 2024-03-07 21:40:22 -07:00 committed by Alexander Kalenik
parent fc6a6d29ec
commit d76c2d45c4

View file

@ -1101,10 +1101,8 @@ void Animation::update_finished_state(DidSeek did_seek, SynchronouslyNotify sync
return;
// 2. Resolve animations 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 animations current finished promise is already resolved, set
// animations 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;
}