mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2026-04-21 03:10:26 +00:00
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`.
31 lines
808 B
C++
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;
|
|
};
|
|
|
|
}
|