mirror of
https://github.com/RGBCube/serenity
synced 2025-07-23 17:27:35 +00:00
LibWeb: Record position of Animations in global animation list
"position of an Animation in the global animation list" is a fancy way of saying "which animation object was created first"
This commit is contained in:
parent
c3b689488e
commit
ceb9d0f8dc
3 changed files with 13 additions and 0 deletions
|
@ -842,6 +842,8 @@ JS::NonnullGCPtr<WebIDL::Promise> Animation::current_finished_promise() const
|
||||||
Animation::Animation(JS::Realm& realm)
|
Animation::Animation(JS::Realm& realm)
|
||||||
: DOM::EventTarget(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)
|
void Animation::initialize(JS::Realm& realm)
|
||||||
|
|
|
@ -81,6 +81,8 @@ public:
|
||||||
virtual AnimationClass animation_class() const { return AnimationClass::None; }
|
virtual AnimationClass animation_class() const { return AnimationClass::None; }
|
||||||
virtual Optional<int> class_specific_composite_order(JS::NonnullGCPtr<Animation>) const { return {}; }
|
virtual Optional<int> class_specific_composite_order(JS::NonnullGCPtr<Animation>) const { return {}; }
|
||||||
|
|
||||||
|
unsigned int global_animation_list_order() const { return m_global_animation_list_order; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
Animation(JS::Realm&);
|
Animation(JS::Realm&);
|
||||||
|
|
||||||
|
@ -119,6 +121,9 @@ private:
|
||||||
// https://www.w3.org/TR/web-animations-1/#dom-animation-id
|
// https://www.w3.org/TR/web-animations-1/#dom-animation-id
|
||||||
FlyString m_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
|
// https://www.w3.org/TR/web-animations-1/#dom-animation-effect
|
||||||
JS::GCPtr<AnimationEffect> m_effect;
|
JS::GCPtr<AnimationEffect> m_effect;
|
||||||
|
|
||||||
|
|
|
@ -62,6 +62,12 @@ Animations::AnimationClass CSSAnimation::animation_class() const
|
||||||
CSSAnimation::CSSAnimation(JS::Realm& realm)
|
CSSAnimation::CSSAnimation(JS::Realm& realm)
|
||||||
: Animations::Animation(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)
|
void CSSAnimation::initialize(JS::Realm& realm)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue