diff --git a/Libraries/LibWeb/DOM/Document.cpp b/Libraries/LibWeb/DOM/Document.cpp index bebf6365dea..e81dbffafaf 100644 --- a/Libraries/LibWeb/DOM/Document.cpp +++ b/Libraries/LibWeb/DOM/Document.cpp @@ -4741,6 +4741,10 @@ void Document::update_animations_and_send_events(Optional const& timesta // 6. Perform a stable sort of the animation events in events to dispatch as follows: auto sort_events_by_composite_order = [](auto const& a, auto const& b) { + if (!a.animation->effect()) + return true; + if (!b.animation->effect()) + return false; auto& a_effect = verify_cast(*a.animation->effect()); auto& b_effect = verify_cast(*b.animation->effect()); return Animations::KeyframeEffect::composite_order(a_effect, b_effect) < 0; diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-transitions/CSSTransition-effect.tentative.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-transitions/CSSTransition-effect.tentative.txt new file mode 100644 index 00000000000..8cfa37bfcf1 --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-transitions/CSSTransition-effect.tentative.txt @@ -0,0 +1,16 @@ +Harness status: OK + +Found 10 tests + +5 Pass +5 Fail +Pass After setting a transition's effect to null, it still reports the original transition property +Pass After setting a transition's effect to null, it becomes finished +Fail After setting a transition's effect to null, style is updated +Fail After setting a transition's effect to null, a new transition can be started +Fail After setting a transition's effect to null, it should be possible to interrupt that transition +Pass After setting a new keyframe effect with a shorter duration, the transition becomes finished +Pass After setting a new keyframe effect targeting different properties, the transition continues to report the original transition property +Fail After setting a new keyframe effect on a play-pending transition, the transition remains pending +Pass A transition with no effect still returns the original transitionProperty +Fail A transition with a replaced effect still exhibits the regular transition reversing behavior \ No newline at end of file diff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-transitions/CSSTransition-effect.tentative.html b/Tests/LibWeb/Text/input/wpt-import/css/css-transitions/CSSTransition-effect.tentative.html new file mode 100644 index 00000000000..2e2a851cd72 --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/css/css-transitions/CSSTransition-effect.tentative.html @@ -0,0 +1,240 @@ + + +CSSTransition.effect + + + + + +
+ diff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-transitions/support/helper.js b/Tests/LibWeb/Text/input/wpt-import/css/css-transitions/support/helper.js new file mode 100644 index 00000000000..a37aae91830 --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/css/css-transitions/support/helper.js @@ -0,0 +1,326 @@ +// +// Simple Helper Functions For Testing CSS +// + +(function(root) { +'use strict'; + +// serialize styles object and dump to dom +// appends