Closed Bug 2017461 Opened 3 months ago Closed 6 days ago

Use CSSNumberish for Animation.currentTime

Categories

(Core :: DOM: Animation, enhancement)

enhancement
Points:
2

Tracking

()

RESOLVED FIXED
153 Branch
Tracking Status
firefox153 --- fixed

People

(Reporter: boris, Assigned: jwatt)

References

(Blocks 1 open bug, )

Details

(Whiteboard: [scrollanimation:mvp])

Attachments

(1 file)

This is similar with Bug 2017448. However, we would like to update Animation.currentTime here:

[Exposed=Window]
partial interface Animation {
    ...
    attribute CSSNumberish?       currentTime;
    ...
};

Here is the webidl code.

Also, when we are setting the currentTime, we have to apply the algorithm of validating a CSSNumberish time.

Besides, we have to update AnimationPlaybackEvent.currentTime and AnimationPlaybackEventInit.currentTime (spec, webidl).

Points: --- → 2
Assignee: nobody → mozmail
Status: NEW → ASSIGNED

I'm looking at bug 2017448 first.

Assignee: mozmail → nobody
Status: ASSIGNED → NEW
Assignee: nobody → mozmail
Status: NEW → ASSIGNED

The behavior is gated on NIGHTLY_BUILD + layout.css.typed-om.enabled so
release builds continue to return a plain double.

For the setter:

  • Progress timeline: CSSUnitValue must be convertible to percent;
    plain double is rejected.
  • Monotonic timeline: CSSUnitValue must be convertible to number,
    ms, or s.

The ConvertTimeToCSSNumberish and ConvertCSSNumberishToTime helpers on
Animation will allow the logic to be reused in bug 2017448 for the
related Animation.startTime.

Also threads the CSSNumberish currentTime through AnimationPlaybackEvent
(and its init dictionary) by snapshotting an isPercent flag at
queue time and reconstructing the CSSUnitValue at dispatch time in
AnimationEventDispatcher.

Pushed by jwatt@jwatt.org: https://github.com/mozilla-firefox/firefox/commit/e15cae629eda https://hg.mozilla.org/integration/autoland/rev/a1139aa0d7ba Use CSSNumberish for Animation.currentTime. r=boris,webidl,layout-scroll-driven-animation-reviewers,firefox-style-system-reviewers,smaug,dshin
Pushed by agoloman@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/83e3e29d5da4 https://hg.mozilla.org/integration/autoland/rev/e50916bf7d87 Remove scroll-animations/view-timelines/block-view-timeline-current-time-vertical-rl.tentative.html.ini
Status: ASSIGNED → RESOLVED
Closed: 6 days ago
Resolution: --- → FIXED
Target Milestone: --- → 153 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: