diff --git a/Userland/Libraries/LibWeb/Animations/Animation.cpp b/Userland/Libraries/LibWeb/Animations/Animation.cpp index 4bcd675560..5668aaccec 100644 --- a/Userland/Libraries/LibWeb/Animations/Animation.cpp +++ b/Userland/Libraries/LibWeb/Animations/Animation.cpp @@ -700,6 +700,13 @@ WebIDL::ExceptionOr Animation::pause() return {}; } +// https://www.w3.org/TR/web-animations-1/#dom-animation-persist +void Animation::persist() +{ + // Sets this animation’s replace state to persisted. + set_replace_state(Bindings::AnimationReplaceState::Persisted); +} + // https://www.w3.org/TR/web-animations-1/#animation-time-to-timeline-time Optional Animation::convert_an_animation_time_to_timeline_time(Optional time) const { diff --git a/Userland/Libraries/LibWeb/Animations/Animation.h b/Userland/Libraries/LibWeb/Animations/Animation.h index 3d483ff94f..6a5284d2e5 100644 --- a/Userland/Libraries/LibWeb/Animations/Animation.h +++ b/Userland/Libraries/LibWeb/Animations/Animation.h @@ -75,6 +75,7 @@ public: WebIDL::ExceptionOr play(); WebIDL::ExceptionOr play_an_animation(AutoRewind); WebIDL::ExceptionOr pause(); + void persist(); Optional convert_an_animation_time_to_timeline_time(Optional) const; Optional convert_a_timeline_time_to_an_origin_relative_time(Optional) const; diff --git a/Userland/Libraries/LibWeb/Animations/Animation.idl b/Userland/Libraries/LibWeb/Animations/Animation.idl index 662e2e2ac1..5f75fd3b21 100644 --- a/Userland/Libraries/LibWeb/Animations/Animation.idl +++ b/Userland/Libraries/LibWeb/Animations/Animation.idl @@ -30,7 +30,7 @@ interface Animation : EventTarget { undefined pause(); // FIXME: undefined updatePlaybackRate(double playbackRate); // FIXME: undefined reverse(); - // FIXME: undefined persist(); + undefined persist(); // FIXME: [CEReactions] undefined commitStyles(); };