1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 13:17:35 +00:00

LibWeb: Implement Animation.persist()

This commit is contained in:
Matthew Olsson 2024-02-05 20:39:27 -07:00 committed by Andreas Kling
parent 3c055ff76d
commit d351389d72
3 changed files with 9 additions and 1 deletions

View file

@ -700,6 +700,13 @@ WebIDL::ExceptionOr<void> Animation::pause()
return {};
}
// https://www.w3.org/TR/web-animations-1/#dom-animation-persist
void Animation::persist()
{
// Sets this animations replace state to persisted.
set_replace_state(Bindings::AnimationReplaceState::Persisted);
}
// https://www.w3.org/TR/web-animations-1/#animation-time-to-timeline-time
Optional<double> Animation::convert_an_animation_time_to_timeline_time(Optional<double> time) const
{

View file

@ -75,6 +75,7 @@ public:
WebIDL::ExceptionOr<void> play();
WebIDL::ExceptionOr<void> play_an_animation(AutoRewind);
WebIDL::ExceptionOr<void> pause();
void persist();
Optional<double> convert_an_animation_time_to_timeline_time(Optional<double>) const;
Optional<double> convert_a_timeline_time_to_an_origin_relative_time(Optional<double>) const;

View file

@ -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();
};