LibWeb/DOM: Allow the animationiteration event to be fired

This event is fired while both the previous and the current phase are
active.

This prevents this test from timing out:
- css/css-animations/animationevent-types.txt
This commit is contained in:
Lucas CHOLLET 2024-12-27 17:08:36 -05:00 committed by Andreas Kling
parent d268df747f
commit 61b444d538
Notes: github-actions[bot] 2024-12-30 10:09:05 +00:00

View file

@ -2360,7 +2360,6 @@ void Document::dispatch_events_for_animation_if_necessary(GC::Ref<Animations::An
auto current_phase = effect->phase();
auto current_iteration = effect->current_iteration().value_or(0.0);
if (previous_phase != current_phase) {
auto owning_element = css_animation.owning_element();
auto dispatch_event = [&](FlyString const& name, double elapsed_time) {
@ -2438,7 +2437,7 @@ void Document::dispatch_events_for_animation_if_necessary(GC::Ref<Animations::An
auto cancel_time = animation->release_saved_cancel_time().value_or(0.0);
dispatch_event(HTML::EventNames::animationcancel, cancel_time);
}
}
effect->set_previous_phase(current_phase);
effect->set_previous_current_iteration(current_iteration);
}