Don't create ScrollTimeline object for each CSS Animation
Categories
(Core :: DOM: Animation, enhancement, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox99 | --- | fixed |
People
(Reporter: boris, Assigned: boris)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
In Bug 1676791, we cerate ScrollTimeline when building animations, for simplicity. It's not a good idea because we may create many identical ScrollTimeline objects, and these ScrollTimeline objects increase the overhead of scrollable frames. In this bug, we have to introduce a way to look up the existing ScrollTimeline when building CSS animations. If it doesn't exist, we create one and let the element owns it. (Note: This may change the lifetime of ScrollTimeline and may need to do cycle-collection for it.)
Comment 1•3 years ago
|
||
Yeah, that matches my understanding of what the spec says, i.e. it seems to suggest a maximum of one ScrollTimeline
objects per @scroll-timeline
declaration. Hopefully there are already WPT for this 🤞
Assignee | ||
Comment 2•2 years ago
•
|
||
Some ideas from the comment: https://phabricator.services.mozilla.com/D126452#4274075, and EffectSet
is a good reference because their structures are similar.
Assignee | ||
Updated•2 years ago
|
Assignee | ||
Updated•2 years ago
|
Assignee | ||
Comment 3•2 years ago
|
||
We use a HashMap to keep the ScrollTimeline, and use scroll-direction as
the key, so an Element and a scroll direction map to a specific
ScrollTimeline. This means a maximum of one ScrollTimeline objects per
@scroll-timeline declaration.
Note: We may have to update this once we support more descriptors in
@scroll-timeline. For now, this should be enough.
Pushed by bchiou@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/397e6f2fda20 Don't create ScrollTimeline for each Animation. r=hiro
Comment 5•2 years ago
|
||
bugherder |
Description
•