LibWeb: Correctly sort animations returned by getAnimations()

This commit is contained in:
Psychpsyo 2025-11-10 16:27:00 +01:00 committed by Jelle Raaijmakers
parent 2c389ae96c
commit b7a71ca950
Notes: github-actions[bot] 2025-11-10 17:30:34 +00:00
6 changed files with 284 additions and 14 deletions

View file

@ -627,11 +627,12 @@ void KeyframeEffect::generate_initial_and_final_frames(RefPtr<KeyFrameSet> keyfr
// https://www.w3.org/TR/web-animations-1/#animation-composite-order
int KeyframeEffect::composite_order(GC::Ref<KeyframeEffect> a, GC::Ref<KeyframeEffect> b)
{
// 1. Let the associated animation of an animation effect be the animation associated with the animation effect.
// The relative composite order of any two keyframe effects A and B within an effect stack is established by
// comparing their properties as follows:
auto a_animation = a->associated_animation();
auto b_animation = b->associated_animation();
// 2. Sort A and B by applying the following conditions in turn until the order is resolved,
// 1. Sort A and B by applying the following conditions in turn until the order is resolved,
// 1. If A and Bs associated animations differ by class, sort by any inter-class composite order defined for
// the corresponding classes.