LibWeb: Set DocumentTimeline origin time to zero
The current time should be used to set the timeline's new current time, not its origin time
This commit is contained in:
parent
727a9a6472
commit
14200de80b
Notes:
sideshowbarker
2024-07-17 03:45:48 +09:00
Author: https://github.com/mattco98 Commit: https://github.com/SerenityOS/serenity/commit/14200de80b Pull-request: https://github.com/SerenityOS/serenity/pull/23198
1 changed files with 6 additions and 3 deletions
|
@ -3690,9 +3690,12 @@ HashMap<AK::URL, JS::GCPtr<HTML::SharedImageRequest>>& Document::shared_image_re
|
|||
// https://www.w3.org/TR/web-animations-1/#dom-document-timeline
|
||||
JS::NonnullGCPtr<Animations::DocumentTimeline> Document::timeline()
|
||||
{
|
||||
// The DocumentTimeline object representing the default document timeline.
|
||||
if (!m_default_timeline)
|
||||
m_default_timeline = Animations::DocumentTimeline::create(realm(), *this, static_cast<double>(MonotonicTime::now().milliseconds()));
|
||||
// The DocumentTimeline object representing the default document timeline. The default document timeline has an
|
||||
// origin time of zero.
|
||||
if (!m_default_timeline) {
|
||||
m_default_timeline = Animations::DocumentTimeline::create(realm(), *this, 0.0);
|
||||
m_default_timeline->set_current_time(MonotonicTime::now().milliseconds());
|
||||
}
|
||||
return *m_default_timeline;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue