Skip to content

[css-view-transitions-1] Fix tree-scoping from element-based to name-based. #10528

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 17 additions & 4 deletions css-view-transitions-1/Overview.bs
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,10 @@ urlPrefix: https://wicg.github.io/navigation-api/; type: interface;
as either an old or new [=/element=]--
with the specified [=view transition name=].

Each [=view transition name=] is a [=tree-scoped name=].

Note: Since currently only document-scoped view transitions are supported, only view transition names that are associated with the document are respected.

The values <css>none</css> and <css>auto</css> are excluded from <<custom-ident>> here.

Note: If this name is not unique
Expand All @@ -559,6 +563,16 @@ urlPrefix: https://wicg.github.io/navigation-api/; type: interface;
this property has no effect.
See [[#algorithms]] for exact details.

<div algorithm>
To get the <dfn>document-scoped view transition name</dfn> for an {{Element}} |element|:

1. Let |scopedViewTransitionName| be the [=computed value=] of 'view-transition-name' for |element|.

1. If |scopedViewTransitionName| is associated with |element|'s [=node document=], then return |scopedViewTransitionName|.

1. Otherwise, return ''view-transition-name/none''.
</div>

### Rendering Consolidation ### {#named-and-transitioning}

[=/Elements=] [=captured in a view transition=] during a [=view transition=]
Expand Down Expand Up @@ -1319,7 +1333,6 @@ urlPrefix: https://wicg.github.io/navigation-api/; type: interface;

1. [=list/For each=] |element| of every [=/element=] that is [=/connected=],
and has a [=node document=] equal to |document|,
and has a [=tree context=] equal to |document|,
in [paint order](https://drafts.csswg.org/css2/#painting-order):

<div class=note>We iterate in paint order to ensure that this order is cached in |namedElements|.
Expand All @@ -1335,7 +1348,7 @@ urlPrefix: https://wicg.github.io/navigation-api/; type: interface;
Note: [=box fragment=] here does not refer to fragmentation of <a href="https://www.w3.org/TR/CSS2/visuren.html#inline-boxes">inline boxes</a> across <a href="https://www.w3.org/TR/CSS2/visuren.html#line-box">line boxes</a>.
Such inlines can participate in a transition.

1. Let |transitionName| be the [=computed value=] of 'view-transition-name' for |element|.
1. Let |transitionName| be the |element|'s [=document-scoped view transition name=].

1. If |transitionName| is ''view-transition-name/none'',
or |element| is [=element-not-rendered|not rendered=],
Expand Down Expand Up @@ -1403,12 +1416,11 @@ urlPrefix: https://wicg.github.io/navigation-api/; type: interface;

1. [=list/For each=] |element| of every [=/element=] that is [=/connected=],
and has a [=node document=] equal to |document|,
and has a [=tree context=] equal to |document|,
in [paint order](https://drafts.csswg.org/css2/#painting-order):

1. If any [=flat tree=] ancestor of this |element| [=skips its contents=], then [=continue=].

1. Let |transitionName| be the [=computed value=] of 'view-transition-name' for |element|.
1. Let |transitionName| be |element|'s [=document-scoped view transition name=].

1. If |transitionName| is ''view-transition-name/none'',
or |element| is [=element-not-rendered|not rendered=],
Expand Down Expand Up @@ -1966,6 +1978,7 @@ Changes from <a href="https://www.w3.org/TR/2023/WD-css-view-transitions-1-20230
* Use snapshot containing block when capturing new state for document element. See <a href="https://github.com/w3c/csswg-drafts/issues/10177">issue #10177</a>.
* Fix algorithm for dispatching updateDOMCallback promise.
* Scope view transition names to matching tree context. See <a href="https://github.com/w3c/csswg-drafts/issues/10145">issue 10145</a>.
* Fix scoping to match name instead of element. See <a href="https://github.com/w3c/csswg-drafts/issues/10145">issue 10145</a>.

<h3 id="changes-since-2022-05-25">
Changes from <a href="https://www.w3.org/TR/2023/WD-css-view-transitions-1-20230525/">2022-05-25 Working Draft</a>
Expand Down