Closed Bug 2024012 Opened 8 months ago Closed 3 months ago

Update the default behavior of named timeline scoping and lookup

Categories

(Core :: CSS Transitions and Animations, enhancement)

enhancement
Points:
3

Tracking

()

RESOLVED FIXED
155 Branch
Tracking Status
firefox155 --- fixed

People

(Reporter: boris, Assigned: dshin)

References

()

Details

(Keywords: dev-doc-complete, Whiteboard: [scrollanimation:mvp], [wptsync upstream])

Attachments

(4 external files)

The default behavior of named timeline scoping and lookup just got updated to be global (PR w3c/csswg-draft#13624):

Timeline names are global by default: An element referring to a named scroll progress timeline or view progress timeline can find a target timeline defined on itself, defined on an element before itself in tree order, or defined on an element after itself in tree order.
The target timeline for a given element element referencing a timeline name name is:

  • If element defines a timeline matching name,
    • That timeline.
  • Otherwise, if name is scoped by element, or if element is the document element,
    • The last defined timeline matching name among element’s flat tree descendants in flat tree order, or, if no such timeline exists, an inactive timeline.
  • Otherwise,
    • The target timeline for element’s flat tree parent referencing name.

So in order to make sure all timelines are discoverable for a specific element (i.e. the animation target), we have to make sure those named timelines are generated already, even for the subtree.

Our current SequentialTasks doesn't allow us to do this because we update timelines and animations in the same task, in the tree order. So all the timelines in the subtree are not generated yet when we create the animations of a specific element.

A possible resolution is to preprocess the SequentialTask list, e.g. split it into 2 buckets. The first bucket is for updating named ScrollTimelines and ViewTimelines, and the 2nd bucket is for updating others, e.g. timeline-scope and animations.

Or, could we update the named timelines during traversal? This may be tricky as well.

See Also: → 1774060

(In reply to Boris Chiou [:boris] from comment #1)

A possible resolution is to preprocess the SequentialTask list, e.g. split it into 2 buckets. The first bucket is for updating named ScrollTimelines and ViewTimelines, and the 2nd bucket is for updating others, e.g. timeline-scope and animations.

So about this way, we have a question last week: should we keep the old computed data for named timeline update for the first bucket? After rethinking about this, we may not need to keep the old computed data for the SequentialTask of update named timelines, because:

  1. It is not transitionable. (No need to create CSS transitions, so we don't need to generate the keyframe.)
  2. We can create the new named timelines first, and just go through the unused timelines and try to update their associated animations before we destroy those unused timelines. Just like what we do for CSS animations (related to Bug 1774060).

Requires further discussion prior to estimating.

InterOp Change proposal filed for this change. Impact may be smaller than I thought.

See Also: → 2045120
Whiteboard: [scrollanimation:triage] → [scrollanimation:m2]
Assignee: nobody → dshin
Status: NEW → ASSIGNED
Points: --- → 3

As per:
https://github.com/w3c/csswg-drafts/issues/9256#issuecomment-4556112966
It's technically different from the existing concept of inactive timeline.

This lines up better with other browsers, and the resolution in
https://github.com/w3c/csswg-drafts/issues/9256.
Should be noted that we (Nor other browsers) seem to resolve
the ready promise, which should be a follow-up.

Remove a test from
animation-timeline-named-scroll-progress-timeline.tentative.html
that asserts sibling timeline(s) not being visible by default,
which isn't the case anymore.

Adjust timeline-scope* tests to reflect the new behaviour.

Given https://github.com/w3c/csswg-drafts/issues/9256, hopefully an
uncontroversial change. Previously, because timeline-scope made timelines
more available, it made sense that we handle unscoped and scoped timeline
references differently. Now that timelines are more visible and
timeline-scope in fact restricts visibility, it seems inconsistent to
continue to treat them differently.

The following tests used unresolved timelines without any timeline-scope,
and expected the animation to produce an effect, which should not be the
case anymore:

  • animation-timeline-named-scroll-progress-timeline.tentative.html
  • animation-timeline-none.html
  • scroll-timeline-dynamic.tentative.html
Pushed by dshin@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/95a996877132 https://hg.mozilla.org/integration/autoland/rev/39319a25c0e4 Rename InactiveTimeline to UnresolvedTimeline. r=layout-scroll-driven-animation-reviewers,firefox-style-system-reviewers,boris https://github.com/mozilla-firefox/firefox/commit/6020f63a2f74 https://hg.mozilla.org/integration/autoland/rev/6833e04c208a Have unresolved timelines be current, but not produce any effect. r=layout-scroll-driven-animation-reviewers,boris https://github.com/mozilla-firefox/firefox/commit/43a1a3c7a601 https://hg.mozilla.org/integration/autoland/rev/4f6160672884 Update the scoping rule to match the most recent resolution. r=layout-scroll-driven-animation-reviewers,firefox-style-system-reviewers,boris https://github.com/mozilla-firefox/firefox/commit/c25a408a3119 https://hg.mozilla.org/integration/autoland/rev/bacfb3d1a257 Always return unresolved timeline for named timeline references. r=layout-scroll-driven-animation-reviewers,firefox-style-system-reviewers,boris

Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/61776 for changes under testing/web-platform/tests

Whiteboard: [scrollanimation:m2] → [scrollanimation:m2], [wptsync upstream]
Whiteboard: [scrollanimation:m2], [wptsync upstream] → [scrollanimation:mvp], [wptsync upstream]
Keywords: dev-doc-needed
Regressions: 2062180

Upstream PR was closed without merging

(Was accidentally closed, reopened)

Duplicate of this bug: 2061293
QA Whiteboard: [qa-triage-done-c156/b155]

Upstream PR merged by moz-wptsync-bot

If I am right, timeline-scope: all; is not supported here.

  • Chrome has removed this in 138
  • Safari supports this in 26
  • in firefox nightly 157 devtools all is not an option
Flags: needinfo?(dshin)
Blocks: 2068613

It actually does work, but yeah, DevTools does not report that, because we missed that keyword on the backend. Bug 2068613 filed

Flags: needinfo?(dshin)

Associated Pull Requests

No longer duplicate of this bug: 2061293
Duplicate of this bug: 2051972
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: