mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-21 18:00:16 +00:00
LibWeb: Cache the last CSS play-state value on KeyframeEffect
This way we can just leave it alone if the property hasn't changed. Notably, if the play-state property has been set to 'paused', and then the user gets the animation with JS and calls .play() on it, it should start playing despite the play-state property value.
This commit is contained in:
parent
1570751d64
commit
e4dba9d932
Notes:
sideshowbarker
2024-07-18 04:46:35 +09:00
Author: https://github.com/mattco98
Commit: e4dba9d932
Pull-request: https://github.com/SerenityOS/serenity/pull/23735
Reviewed-by: https://github.com/ADKaster ✅
2 changed files with 21 additions and 14 deletions
|
@ -107,6 +107,9 @@ public:
|
|||
|
||||
virtual void update_style_properties() override;
|
||||
|
||||
Optional<CSS::AnimationPlayState> last_css_animation_play_state() const { return m_last_css_animation_play_state; }
|
||||
void set_last_css_animation_play_state(CSS::AnimationPlayState state) { m_last_css_animation_play_state = state; }
|
||||
|
||||
private:
|
||||
KeyframeEffect(JS::Realm&);
|
||||
virtual ~KeyframeEffect() override = default;
|
||||
|
@ -130,6 +133,8 @@ private:
|
|||
Vector<JS::Object*> m_keyframe_objects {};
|
||||
|
||||
RefPtr<KeyFrameSet const> m_key_frame_set {};
|
||||
|
||||
Optional<CSS::AnimationPlayState> m_last_css_animation_play_state;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue