mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 17:47:36 +00:00
LibWeb: Handle pre-existing animations when considering animation-name
If a DOM::Element has an animation-name property, then in addition to remembering where it came from, it will also remember the Animations::Animation object that was created for it. This allows StyleComputer to cancel that animation if the animation-name property changes as well as to apply any changes required (for example, if animation-play-state changes from "running" to "paused", it needs to call .pause() on the animation).
This commit is contained in:
parent
b235620315
commit
0f54d797d2
2 changed files with 101 additions and 73 deletions
|
@ -36,10 +36,14 @@ public:
|
|||
JS::GCPtr<CSS::CSSStyleDeclaration const> cached_animation_name_source() const { return m_cached_animation_name_source; }
|
||||
void set_cached_animation_name_source(JS::GCPtr<CSS::CSSStyleDeclaration const> value) { m_cached_animation_name_source = value; }
|
||||
|
||||
JS::GCPtr<Animations::Animation> cached_animation_name_animation() const { return m_cached_animation_name_animation; }
|
||||
void set_cached_animation_name_animation(JS::GCPtr<Animations::Animation> value) { m_cached_animation_name_animation = value; }
|
||||
|
||||
private:
|
||||
Vector<JS::NonnullGCPtr<AnimationEffect>> m_associated_effects;
|
||||
bool m_is_sorted_by_composite_order { true };
|
||||
JS::GCPtr<CSS::CSSStyleDeclaration const> m_cached_animation_name_source;
|
||||
JS::GCPtr<Animations::Animation> m_cached_animation_name_animation;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue