mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 06:14:58 +00:00
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
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
Add a link
Reference in a new issue