From 8936232c8edaae8931149546d4709a145fdf428f Mon Sep 17 00:00:00 2001 From: Noam Rosenthal Date: Thu, 4 Jul 2024 12:31:36 +0100 Subject: [PATCH 1/3] [css-view-transitions-1] Fix tree-scoping from being element-based to being name-based. The previous fix for using the tree context made it inconsistent with how shadow DOM styling works for things like anchor positioning, and made it so that e.g. `::part` cannot set a `view-transition-name`. Refactored to make the `view-transition-name` a tree-scoped name, rather than check the tree context of the element. Closes #10145 --- css-view-transitions-1/Overview.bs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/css-view-transitions-1/Overview.bs b/css-view-transitions-1/Overview.bs index f21b1567080..f5ab7f30b76 100644 --- a/css-view-transitions-1/Overview.bs +++ b/css-view-transitions-1/Overview.bs @@ -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 none and auto are excluded from <> here. Note: If this name is not unique @@ -559,6 +563,8 @@ urlPrefix: https://wicg.github.io/navigation-api/; type: interface; this property has no effect. See [[#algorithms]] for exact details. + The document-scoped view transition name for an {{Element}} |element| is its 'view-transition-name' that is associated with |element|'s [=node document=]. + ### Rendering Consolidation ### {#named-and-transitioning} [=/Elements=] [=captured in a view transition=] during a [=view transition=] @@ -1319,7 +1325,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):
We iterate in paint order to ensure that this order is cached in |namedElements|. @@ -1335,7 +1340,7 @@ urlPrefix: https://wicg.github.io/navigation-api/; type: interface; Note: [=box fragment=] here does not refer to fragmentation of inline boxes across line boxes. 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=], @@ -1403,12 +1408,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=], From ce070b8182d5b4ea68043a60576cd812d5313ce7 Mon Sep 17 00:00:00 2001 From: Noam Rosenthal Date: Thu, 4 Jul 2024 16:39:41 +0100 Subject: [PATCH 2/3] Add changelog entry --- css-view-transitions-1/Overview.bs | 1 + 1 file changed, 1 insertion(+) diff --git a/css-view-transitions-1/Overview.bs b/css-view-transitions-1/Overview.bs index f5ab7f30b76..57d79a97c0d 100644 --- a/css-view-transitions-1/Overview.bs +++ b/css-view-transitions-1/Overview.bs @@ -1970,6 +1970,7 @@ Changes from issue #10177. * Fix algorithm for dispatching updateDOMCallback promise. * Scope view transition names to matching tree context. See issue 10145. +* Fix scoping to match name instead of element. See issue 10145.

Changes from 2022-05-25 Working Draft From 6a0aeecb78be1ad30cceb595804407ce28a32f81 Mon Sep 17 00:00:00 2001 From: Noam Rosenthal Date: Fri, 5 Jul 2024 09:42:57 +0100 Subject: [PATCH 3/3] Modifiy vt-name algorithm --- css-view-transitions-1/Overview.bs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/css-view-transitions-1/Overview.bs b/css-view-transitions-1/Overview.bs index 57d79a97c0d..df0fb3580e4 100644 --- a/css-view-transitions-1/Overview.bs +++ b/css-view-transitions-1/Overview.bs @@ -563,7 +563,15 @@ urlPrefix: https://wicg.github.io/navigation-api/; type: interface; this property has no effect. See [[#algorithms]] for exact details. - The document-scoped view transition name for an {{Element}} |element| is its 'view-transition-name' that is associated with |element|'s [=node document=]. +
+ To get the document-scoped view transition name 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''. +
### Rendering Consolidation ### {#named-and-transitioning}