LibWeb: Use owning element as AnimationEvent target
The spec says we should always use the owning element even if the effect's target element has changed
This commit is contained in:
parent
869ac61147
commit
2a65e7c80c
2 changed files with 7 additions and 8 deletions
|
|
@ -3666,16 +3666,15 @@ void Document::dispatch_events_for_animation_if_necessary(GC::Ref<Animations::An
|
|||
|
||||
auto& css_animation = as<CSS::CSSAnimation>(*animation);
|
||||
|
||||
GC::Ptr<Element> target = effect->target();
|
||||
if (!target)
|
||||
return;
|
||||
|
||||
auto previous_phase = effect->previous_phase();
|
||||
auto current_phase = effect->phase();
|
||||
auto current_iteration = effect->current_iteration().value_or(0.0);
|
||||
|
||||
auto owning_element = css_animation.owning_element();
|
||||
|
||||
if (!owning_element.has_value())
|
||||
return;
|
||||
|
||||
auto dispatch_event = [&](FlyString const& name, Animations::TimeValue elapsed_time) {
|
||||
double elapsed_time_output;
|
||||
switch (elapsed_time.type) {
|
||||
|
|
@ -3703,7 +3702,7 @@ void Document::dispatch_events_for_animation_if_necessary(GC::Ref<Animations::An
|
|||
name,
|
||||
event_init),
|
||||
.animation = css_animation,
|
||||
.target = *target,
|
||||
.target = owning_element->element(),
|
||||
.scheduled_event_time = HighResolutionTime::unsafe_shared_current_time(),
|
||||
});
|
||||
};
|
||||
|
|
|
|||
|
|
@ -2,13 +2,13 @@ Harness status: OK
|
|||
|
||||
Found 8 tests
|
||||
|
||||
5 Pass
|
||||
3 Fail
|
||||
6 Pass
|
||||
2 Fail
|
||||
Fail Setting a null effect on a running animation fires an animationend event
|
||||
Pass Replacing an animation's effect with an effect that targets a different property should update both properties
|
||||
Pass Replacing an animation's effect with a shorter one that should have already finished, the animation finishes immediately
|
||||
Pass A play-pending animation's effect whose effect is replaced still exits the pending state
|
||||
Fail CSS animation events are dispatched at the original element even after setting an effect with a different target element
|
||||
Pass CSS animation events are dispatched at the original element even after setting an effect with a different target element
|
||||
Pass After replacing a finished animation's effect with a longer one it fires an animationstart event
|
||||
Pass Setting animation-composition sets the composite property on the effect
|
||||
Fail Replacing the effect of a CSSAnimation causes subsequent changes to corresponding animation-* properties to be ignored
|
||||
Loading…
Reference in a new issue