mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-07 08:39:22 +00:00
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:
parent
d268df747f
commit
61b444d538
Notes:
github-actions[bot]
2024-12-30 10:09:05 +00:00
Author: https://github.com/LucasChollet
Commit: 61b444d538
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3026
Reviewed-by: https://github.com/tcl3
1 changed files with 69 additions and 70 deletions
|
@ -2360,7 +2360,6 @@ void Document::dispatch_events_for_animation_if_necessary(GC::Ref<Animations::An
|
||||||
auto current_phase = effect->phase();
|
auto current_phase = effect->phase();
|
||||||
auto current_iteration = effect->current_iteration().value_or(0.0);
|
auto current_iteration = effect->current_iteration().value_or(0.0);
|
||||||
|
|
||||||
if (previous_phase != current_phase) {
|
|
||||||
auto owning_element = css_animation.owning_element();
|
auto owning_element = css_animation.owning_element();
|
||||||
|
|
||||||
auto dispatch_event = [&](FlyString const& name, double elapsed_time) {
|
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);
|
auto cancel_time = animation->release_saved_cancel_time().value_or(0.0);
|
||||||
dispatch_event(HTML::EventNames::animationcancel, cancel_time);
|
dispatch_event(HTML::EventNames::animationcancel, cancel_time);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
effect->set_previous_phase(current_phase);
|
effect->set_previous_phase(current_phase);
|
||||||
effect->set_previous_current_iteration(current_iteration);
|
effect->set_previous_current_iteration(current_iteration);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue