Skip to content

Commit

Permalink
LibWeb: Remove scopes for execution contexts in Animation finish steps
Browse files Browse the repository at this point in the history
  • Loading branch information
mattco98 authored and kalenikaliaksandr committed Mar 9, 2024
1 parent fc6a6d2 commit d76c2d4
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions Userland/Libraries/LibWeb/Animations/Animation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit d76c2d4

Please sign in to comment.