mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 07:37:35 +00:00
LibWeb: Transition StyleComputer to Web Animations
With this commit, we are finally running animations off of the web animations spec! A lot of the work StyleComputer is doing is now done elsewhere. For example, fill-forward animations are handled by Animation::is_relevant() returning true in the after phase, meaning the "active_state_if_fill_forward" map is no longer needed.
This commit is contained in:
parent
b258ba2767
commit
ae3326a447
7 changed files with 270 additions and 647 deletions
|
@ -33,9 +33,13 @@ public:
|
|||
void associate_with_effect(JS::NonnullGCPtr<AnimationEffect> effect);
|
||||
void disassociate_with_effect(JS::NonnullGCPtr<AnimationEffect> effect);
|
||||
|
||||
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; }
|
||||
|
||||
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;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -370,6 +370,9 @@ WebIDL::ExceptionOr<void> Animation::play()
|
|||
// https://www.w3.org/TR/web-animations-1/#play-an-animation
|
||||
WebIDL::ExceptionOr<void> Animation::play_an_animation(AutoRewind auto_rewind)
|
||||
{
|
||||
if (auto document = document_for_timing())
|
||||
document->ensure_animation_timer();
|
||||
|
||||
// 1. Let aborted pause be a boolean flag that is true if animation has a pending pause task, and false otherwise.
|
||||
auto aborted_pause = m_pending_pause_task == TaskState::Scheduled;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue