mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-07 21:59:54 +00:00
LibWeb: Update style before getting animation play state
Pending style updates can influence this value
This commit is contained in:
parent
a95cde3660
commit
fbcef936a9
Notes:
github-actions[bot]
2025-11-02 22:55:11 +00:00
Author: https://github.com/Calme1709
Commit: fbcef936a9
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6642
Reviewed-by: https://github.com/AtkinsSJ ✅
7 changed files with 286 additions and 1 deletions
|
|
@ -277,6 +277,14 @@ WebIDL::ExceptionOr<void> Animation::set_playback_rate(double new_playback_rate)
|
|||
}
|
||||
|
||||
// https://www.w3.org/TR/web-animations-1/#animation-play-state
|
||||
Bindings::AnimationPlayState Animation::play_state_for_bindings() const
|
||||
{
|
||||
if (m_owning_element)
|
||||
m_owning_element->document().update_style();
|
||||
|
||||
return play_state();
|
||||
}
|
||||
|
||||
Bindings::AnimationPlayState Animation::play_state() const
|
||||
{
|
||||
// The play state of animation, animation, at a given moment is the state corresponding to the first matching
|
||||
|
|
|
|||
|
|
@ -48,6 +48,7 @@ public:
|
|||
double playback_rate() const { return m_playback_rate; }
|
||||
WebIDL::ExceptionOr<void> set_playback_rate(double value);
|
||||
|
||||
Bindings::AnimationPlayState play_state_for_bindings() const;
|
||||
Bindings::AnimationPlayState play_state() const;
|
||||
|
||||
bool is_relevant() const;
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ interface Animation : EventTarget {
|
|||
attribute double? startTime;
|
||||
attribute double? currentTime;
|
||||
attribute double playbackRate;
|
||||
readonly attribute AnimationPlayState playState;
|
||||
[ImplementedAs=play_state_for_bindings] readonly attribute AnimationPlayState playState;
|
||||
readonly attribute AnimationReplaceState replaceState;
|
||||
readonly attribute boolean pending;
|
||||
readonly attribute Promise<Animation> ready;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue