Closed Bug 1676791 Opened 3 years ago Closed 2 years ago

Implement ScrollTimeline class without ScrollTimeline interface (i.e. without webidl) and use it for CSS animations

Categories

(Core :: Layout, enhancement)

enhancement

Tracking

()

RESOLVED FIXED
97 Branch
Tracking Status
firefox97 --- fixed

People

(Reporter: hiro, Assigned: boris)

References

(Blocks 2 open bugs)

Details

(Keywords: dev-doc-complete)

Attachments

(10 files)

48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review

This bug might be better to split into a smaller bugs, but I am not sure right now.

The basic mechanism can be re-used what Botond wrote in bug 1321428, the new spec now has element-based offset, that's a big difference.

Type: task → enhancement
Summary: Implement ScrollTimeline class without ScrollTimeline interface (i.e. without idl) and use if for CSS animations → Implement ScrollTimeline class without ScrollTimeline interface (i.e. without webidl) and use if for CSS animations
Summary: Implement ScrollTimeline class without ScrollTimeline interface (i.e. without webidl) and use if for CSS animations → Implement ScrollTimeline class without ScrollTimeline interface (i.e. without webidl) and use it for CSS animations

We add the placeholder to keep the scroll-timeline rule, so layout code
can access it in the future (i.e. Bug 1676791).

Assignee: nobody → boris.chiou

Define a simple version of ScrollTimeline and update AnimationTimeline
to provide a way to distinguish different types of timelines.

The basic part of the infrastrucure of scroll-linked animations. This is
designed based on scroll-linked animation generated by CSS.

We have to make sure we compute the correct progress at least.

So we don't expose scroll-linked animations for now.

Attachment #9243146 - Attachment description: Bug 1676784 - Part 3: Hook scroll-timeline rule into Cascade data. → Bug 1676791 - Part 6: Hook scroll-timeline rule into Cascade data and use it when building animation.
Attachment #9243146 - Attachment description: Bug 1676791 - Part 6: Hook scroll-timeline rule into Cascade data and use it when building animation. → Bug 1676791 - Part 6: Hook scroll-timeline rule into Cascade data and use it for CSS animations.
Blocks: 1737180
Keywords: dev-doc-needed
Blocks: 1738135
Blocks: 1741255

Based on https://github.com/w3c/csswg-drafts/pull/4842, we define
"has finite timeline", which is a timeline that's not monotonically increasing.
We need this to update start time and hold time for scroll-timeline, so
we play scroll-linked animations as we expected, e.g. GetLocalTime() returns
the correct time value from GetCurrentTimeAsDuration().

Known issue: we still have bugs when setting "animation-play-state:paused".
Will do that in Bug 1741255.

Attachment #9246986 - Attachment description: Bug 1676791 - Part 4: Prevent getAnimations() from returning scroll-linked animations. → Bug 1676791 - Part 5: Prevent getAnimations() from returning scroll-linked animations.
Attachment #9246987 - Attachment description: Bug 1676791 - Part 5: Disable OMTA for scroll-timeline. → Bug 1676791 - Part 6: Disable OMTA for scroll-timeline.
Attachment #9243146 - Attachment description: Bug 1676791 - Part 6: Hook scroll-timeline rule into Cascade data and use it for CSS animations. → Bug 1676791 - Part 7: Hook scroll-timeline rule into Cascade data and use it for CSS animations.
Attachment #9246984 - Attachment description: Bug 1676791 - Part 2: Implement the infrastrucure of scroll-linked animations. → Bug 1676791 - Part 2: Implement the infrastructure of scroll-linked animations.

And so we can make ScrollTimeline::GetTiming() be a constexpr function.

Attachment #9251264 - Attachment description: Bug 1676791 - Part 8: Make TimingParams be a LiteralType. → Bug 1676791 - Part 4: Make TimingParams be a LiteralType.
Attachment #9250794 - Attachment description: Bug 1676791 - Part 4: Define the finite timeline and use it in Play() and Pause(). → Bug 1676791 - Part 5: Define the finite timeline and use it in Play() and Pause().
Attachment #9246986 - Attachment description: Bug 1676791 - Part 5: Prevent getAnimations() from returning scroll-linked animations. → Bug 1676791 - Part 6: Prevent getAnimations() from returning scroll-linked animations.
Attachment #9246987 - Attachment description: Bug 1676791 - Part 6: Disable OMTA for scroll-timeline. → Bug 1676791 - Part 7: Disable OMTA for scroll-timeline.
Attachment #9243146 - Attachment description: Bug 1676791 - Part 7: Hook scroll-timeline rule into Cascade data and use it for CSS animations. → Bug 1676791 - Part 8: Hook scroll-timeline rule into Cascade data and use it for CSS animations.
Blocks: 1741782
Attachment #9251500 - Attachment description: Bug 1676791 - Part 9: Use the scrolling element of Document and fix bugs in quirks mode. → Bug 1676791 - Part 9: Use the scrolling element of document as default scroller.
Attachment #9251500 - Attachment description: Bug 1676791 - Part 9: Use the scrolling element of document as default scroller. → Bug 1676791 - Part 9: Define Scroller to handle the source of ScrollTimeline.

Based on our previous patches, we only support default behavior for
source and scroll-offsets:

  1. source:auto
  2. scroll-offsets: none
  3. scroll-offsets: auto, auto, ...

So update the parser for them. We expect to remove whole
@scroll-timeline in Bug 1733260, so now only do a tiny update in parser.

Pushed by bchiou@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/b4834a00bf66
Part 1: Add ScrollTimeline class. r=hiro
https://hg.mozilla.org/integration/autoland/rev/42d064474082
Part 2: Implement the infrastructure of scroll-linked animations. r=emilio,hiro
https://hg.mozilla.org/integration/autoland/rev/237f69b0017b
Part 3: Implement the computation of timing. r=hiro
https://hg.mozilla.org/integration/autoland/rev/b62bd1a92fdc
Part 4: Make TimingParams be a LiteralType. r=hiro
https://hg.mozilla.org/integration/autoland/rev/a2ab78c846cf
Part 5: Define the finite timeline and use it in Play() and Pause(). r=hiro
https://hg.mozilla.org/integration/autoland/rev/d5a68dd4b920
Part 6: Prevent getAnimations() from returning scroll-linked animations. r=hiro
https://hg.mozilla.org/integration/autoland/rev/bb7d70549ed2
Part 7: Disable OMTA for scroll-timeline. r=hiro
https://hg.mozilla.org/integration/autoland/rev/508ba675a8ec
Part 8: Hook scroll-timeline rule into Cascade data and use it for CSS animations. r=emilio,hiro
https://hg.mozilla.org/integration/autoland/rev/949961aca7b5
Part 9: Define Scroller to handle the source of ScrollTimeline. r=emilio
https://hg.mozilla.org/integration/autoland/rev/0c50f26910b5
Part 10: Make source and scroll-offsets accept only default value. r=emilio
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/31951 for changes under testing/web-platform/tests
Upstream PR merged by moz-wptsync-bot
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: