Process stale timelines in HTML event loop
Categories
(Core :: CSS Transitions and Animations, enhancement)
Tracking
()
People
(Reporter: boris, Assigned: hiro)
References
(Blocks 2 open bugs, )
Details
Attachments
(2 files, 1 obsolete file)
Split the stale timelines part from Bug 1817051 because we may need to check more things in the patch.
| Reporter | ||
Comment 1•5 months ago
|
||
Per spec, we need an extra steps in HTML event loop to update the stale
timelines after we update the animation frame callbacks and resize
observer callbacks.
The wpt for stale timelines rely on the DOM APIs which we don't support
now, so this patch doesn't update any wpt expectation. For now we just
follow the spec to try to update the stale timelines.
Updated•5 months ago
|
| Reporter | ||
Updated•3 months ago
|
Updated•3 months ago
|
| Reporter | ||
Updated•3 months ago
|
| Reporter | ||
Comment 2•3 months ago
|
||
The implementation of WebKit:
- Use
m_updatedScrollTimelinesto hold a list of scroll timelines which just updated during updateAnimationsAndSendEvents() - Then call runPostRenderingUpdateAnimationTasks() after
layoutIfNeeded()andupdateResizeObservations(). - This function checks
m_updatedScrollTimelinesand try to update them if they are staled, which means the offset or the range is changed. - May do style update if any of the associated animations have KeyframeEffect.
| Assignee | ||
Comment 3•2 days ago
|
||
I've rebased D269665 and revised it. I am going to upload it now.
| Assignee | ||
Comment 4•2 days ago
|
||
This lets callers detect staleness without having to snapshot fields
around the call, and makes the comparison subclass-aware (ViewTimeline
now compares its full CurrentTimeData via operator==).
Updated•2 days ago
|
| Assignee | ||
Comment 5•2 days ago
|
||
This lets callers detect staleness without having to snapshot fields
around the call, and makes the comparison subclass-aware (ViewTimeline
now compares its full CurrentTimeData via operator==).
Updated•2 days ago
|
Updated•2 days ago
|
Comment 7•1 day ago
|
||
So Chromium melds this into snapshot post-layout state steps, where a lot of different things are handled as "snapshot clients," including scroll timelines. The snapshot clients are added at the scroll timeline creation time.
WebKit seemingly collects every timeline (While the set says "updated timelines," any timeline with a valid source will get added) that has non-null source every refreshdriver tick, to be updated later if stale.
OTOH, the current spec seems more involved... I think it says to collect into stale timelines:
- Any newly-created timelines during the RO cycle (i.e. layout flush then gather & send RO events)
- Any existing timelines whose named timeline range changed as a result of the RO cycle
... But computing this set basically requires iterating through all existing scroll timelines anyway?
| Reporter | ||
Comment 8•1 day ago
•
|
||
(In reply to David Shin[:dshin] from comment #7)
So Chromium melds this into snapshot post-layout state steps, where a lot of different things are handled as "snapshot clients," including scroll timelines. The snapshot clients are added at the scroll timeline creation time.
WebKit seemingly collects every timeline (While the set says "updated timelines," any timeline with a valid source will get added) that has non-null source every refreshdriver tick, to be updated later if stale.OTOH, the current spec seems more involved... I think it says to collect into stale timelines:
- Any newly-created timelines during the RO cycle (i.e. layout flush then gather & send RO events)
- Any existing timelines whose named timeline range changed as a result of the RO cycle
... But computing this set basically requires iterating through all existing scroll timelines anyway?
For now, yes. Or, we probably need to set something like a dirty flag for the timelines changed ONLY In RO cycle, or a more elegant way like Chromium does. This sounds a lot of work. I'm fine with checking all existing scroll timelines for now. Fortunately we do some early returns in UpdateCachedCurrentTime() to make this pass slightly quicker, and it is unlikely to return true in the common case. If any performance issues happen, we could revisit it.
Description
•