Closed Bug 2033130 Opened 4 months ago Closed 3 months ago

Rework KeyframesStep and generate Gecko Keyframes to include timeline range name

Categories

(Core :: CSS Transitions and Animations, task)

task
Points:
3

Tracking

()

RESOLVED FIXED
152 Branch
Tracking Status
firefox152 --- fixed

People

(Reporter: boris, Assigned: boris)

References

()

Details

(Whiteboard: [scrollanimation:mvp])

Attachments

(5 files)

In KeyframesAnimation::from_keyframes(), we convert the Keyframe into KeyframesStep, and sort it. We also add the missing 0% and 100% if needed.

Also, in Servo_StyleSet_GetKeyframesForName(), we iterate the KeyframesStep in the reverse order. We may rewrite everywhere to make sure we could handle range names well before we start to resolve and use the range names in Bug 1824875.

Whiteboard: [scrollanimation:triage]
Assignee: nobody → boris.chiou
Status: NEW → ASSIGNED
Points: --- → 3
Whiteboard: [scrollanimation:triage] → [scrollanimation:mvp]

After checking the implementation of WebKit and Chromium, I think we need to do the following things:

  1. Extend KeyframesStep to include range names.
  2. Move the generation of implicit keyframes (i.e. 0% and 100%) later. Perhaps in GetKeyframes() and BuildProperties(), because we need to know which timeline type the animation uses, and we have to resolve the computed offsets before filling the implicit keyframes.
    • However, this has impact when we group the keyframes, so need to tweak it as well.
  3. Sort the keyframes in the computed order for GetKeyframe() and in the used order for BuildProperties(). It's probably fine to sort it earlier in KeyframesAnimation::from_keyframes() for keyframes with percentage offset.
  4. Check some edge cases when using getKeyframes() for the document timeline (e.g. if there are only keyframes with range names).
  5. Resolve the keyframe computed offset in Bug 1824875.
Blocks: 2037642
Summary: Rework KeyframesStep and handle missing keyframe for range names → Rework KeyframesStep and generate Gecko Keyframes to include timeline range name
Attachment #9573704 - Attachment description: [WIP] Bug 2033130 - Generate Keyframe with range names. → [WIP] Bug 2033130 - Extend Keyframe offset with range names.

The spec doesn't change this section for TimelineRangeOffset when
computing the missing keyframe offsets, so we still follow
[web-animations-1]: distribute the keyframes from double offsets only.

Also, the distribution code doesn't have impact on CSS Animations because
we always generate keyframes with an offset, but the computation of
computedOffset for TimelineRangeOffset will be used for both CSS
Animations and Web Animations, so we still have to implement this now.

Attachment #9573704 - Attachment description: [WIP] Bug 2033130 - Extend Keyframe offset with range names. → Bug 2033130 - Extend Keyframe offset with range names.
Attachment #9584215 - Attachment description: [WIP] Bug 2033130 - Rewrite ComputeMissingKeyframeOffsets() for TimelineRangeOffset. → Bug 2033130 - Rewrite ComputeMissingKeyframeOffsets() for TimelineRangeOffset.

Keyframe::mComputedOffset could be negative or any real number larger
than 1.0, so we use NaN to represent its unresolved value.

Attachment #9573703 - Attachment description: [WIP] Bug 2033130 - Extend KeyframesStep to use timeline range name. → Bug 2033130 - Extend KeyframesStep to use timeline range name.
Attachment #9584216 - Attachment description: [WIP] Bug 2033130 - Generate keyframes with timeline ranges. → Bug 2033130 - Generate mozilla::Keyframes with timeline range offsets.
Attachment #9584215 - Attachment description: Bug 2033130 - Rewrite ComputeMissingKeyframeOffsets() for TimelineRangeOffset. → Bug 2033130 - Rewrite ComputeMissingKeyframeOffsets() for timeline range offsets.
Pushed by bchiou@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/8703a41947ba https://hg.mozilla.org/integration/autoland/rev/c85e91002fd7 Extend Keyframe offset with range names. r=layout-scroll-driven-animation-reviewers,firefox-style-system-reviewers,dshin https://github.com/mozilla-firefox/firefox/commit/0ff36869a962 https://hg.mozilla.org/integration/autoland/rev/b8a1e79fee9d Rewrite ComputeMissingKeyframeOffsets() for timeline range offsets. r=layout-scroll-driven-animation-reviewers,firefox-style-system-reviewers,dshin https://github.com/mozilla-firefox/firefox/commit/884caf0caa5c https://hg.mozilla.org/integration/autoland/rev/316f574e4ab9 Use NaN to represent the unresolved computed offset. r=layout-scroll-driven-animation-reviewers,firefox-style-system-reviewers,dshin https://github.com/mozilla-firefox/firefox/commit/22fe786988c9 https://hg.mozilla.org/integration/autoland/rev/e033b4740763 Extend KeyframesStep to use timeline range name. r=layout-scroll-driven-animation-reviewers,firefox-style-system-reviewers,dshin https://github.com/mozilla-firefox/firefox/commit/96fbdcd2020f https://hg.mozilla.org/integration/autoland/rev/e7055180be08 Generate mozilla::Keyframes with timeline range offsets. r=firefox-style-system-reviewers,layout-scroll-driven-animation-reviewers,dshin
QA Whiteboard: [qa-triage-done-c153/b152]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: