/* * Copyright (c) 2024, Matthew Olsson . * * SPDX-License-Identifier: BSD-2-Clause */ #include #include #include #include #include #include namespace Web::Internals { GC_DEFINE_ALLOCATOR(InternalAnimationTimeline); void InternalAnimationTimeline::update_current_time(double) { update_associated_animations_and_dispatch_events(); } void InternalAnimationTimeline::set_time(Optional time) { set_current_time(time.map([](double value) -> Animations::TimeValue { return { Animations::TimeValue::Type::Milliseconds, value }; })); } InternalAnimationTimeline::InternalAnimationTimeline(JS::Realm& realm, GC::Ref document) : AnimationTimeline(realm, document) { m_current_time = { Animations::TimeValue::Type::Milliseconds, 0.0 }; m_is_monotonically_increasing = true; } void InternalAnimationTimeline::initialize(JS::Realm& realm) { WEB_SET_PROTOTYPE_FOR_INTERFACE(InternalAnimationTimeline); Base::initialize(realm); } }