ladybird/Libraries/LibWeb/Internals/InternalAnimationTimeline.h
Callum Law 435791b754 LibWeb: Implement AnimationTimline::duration property
This was added in Level 2 of the Web Animations spec

In this level of the spec, all time values associated with animations
(including this duration property) are no longer simple numbers but are
instead either percentages or numbers for progress- and time-based
timelines respectively. These values are represented internally by a new
`TimeValue` wrapper struct, and externally (i.e. in JS) as
`CSSNumberish`.
2025-12-12 10:49:18 +00:00

31 lines
808 B
C++

/*
* Copyright (c) 2024, Matthew Olsson <mattco@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <LibWeb/Animations/AnimationTimeline.h>
namespace Web::Internals {
class InternalAnimationTimeline : public Web::Animations::AnimationTimeline {
public:
WEB_PLATFORM_OBJECT(InternalAnimationTimeline, Web::Animations::AnimationTimeline);
GC_DECLARE_ALLOCATOR(InternalAnimationTimeline);
virtual Optional<Animations::TimeValue> duration() const override { return {}; }
virtual void update_current_time(double timestamp) override;
void set_time(Optional<double> time);
private:
explicit InternalAnimationTimeline(JS::Realm&);
virtual ~InternalAnimationTimeline() override = default;
virtual void initialize(JS::Realm&) override;
};
}