diff --git a/Userland/Libraries/LibWeb/Animations/Animation.cpp b/Userland/Libraries/LibWeb/Animations/Animation.cpp index 4902b92bf1..532650005c 100644 --- a/Userland/Libraries/LibWeb/Animations/Animation.cpp +++ b/Userland/Libraries/LibWeb/Animations/Animation.cpp @@ -842,6 +842,8 @@ JS::NonnullGCPtr Animation::current_finished_promise() const Animation::Animation(JS::Realm& realm) : DOM::EventTarget(realm) { + static unsigned int next_animation_list_order = 0; + m_global_animation_list_order = next_animation_list_order++; } void Animation::initialize(JS::Realm& realm) diff --git a/Userland/Libraries/LibWeb/Animations/Animation.h b/Userland/Libraries/LibWeb/Animations/Animation.h index 429a7e8a22..8acce8e321 100644 --- a/Userland/Libraries/LibWeb/Animations/Animation.h +++ b/Userland/Libraries/LibWeb/Animations/Animation.h @@ -81,6 +81,8 @@ public: virtual AnimationClass animation_class() const { return AnimationClass::None; } virtual Optional class_specific_composite_order(JS::NonnullGCPtr) const { return {}; } + unsigned int global_animation_list_order() const { return m_global_animation_list_order; } + protected: Animation(JS::Realm&); @@ -119,6 +121,9 @@ private: // https://www.w3.org/TR/web-animations-1/#dom-animation-id FlyString m_id; + // https://www.w3.org/TR/web-animations-1/#global-animation-list + unsigned int m_global_animation_list_order { 0 }; + // https://www.w3.org/TR/web-animations-1/#dom-animation-effect JS::GCPtr m_effect; diff --git a/Userland/Libraries/LibWeb/CSS/CSSAnimation.cpp b/Userland/Libraries/LibWeb/CSS/CSSAnimation.cpp index b4db3c3cc3..f8de7504b3 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSAnimation.cpp +++ b/Userland/Libraries/LibWeb/CSS/CSSAnimation.cpp @@ -62,6 +62,12 @@ Animations::AnimationClass CSSAnimation::animation_class() const CSSAnimation::CSSAnimation(JS::Realm& realm) : Animations::Animation(realm) { + // FIXME: + // CSS Animations generated using the markup defined in this specification are not added to the global animation + // list when they are created. Instead, these animations are appended to the global animation list at the first + // moment when they transition out of the idle play state after being disassociated from their owning element. CSS + // Animations that have been disassociated from their owning element but are still idle do not have a defined + // composite order. } void CSSAnimation::initialize(JS::Realm& realm)