diff --git a/css-view-transitions-2/Overview.bs b/css-view-transitions-2/Overview.bs index c3c3d5af5ed..82b4c59ef66 100644 --- a/css-view-transitions-2/Overview.bs +++ b/css-view-transitions-2/Overview.bs @@ -45,6 +45,7 @@ spec:css-view-transitions-1; text: view transition name; type: dfn; text: group styles rule; type: dfn; text: update pseudo-element styles rule; type: dfn; + text: document-scoped view transition name; type: dfn; spec:dom; type:dfn; text:document spec:css22; type:dfn; text:element spec:selectors-4; type:dfn; @@ -884,24 +885,6 @@ and by applying ''view-transition-group'' to the internal element referencing th The [=used value=] for 'view-transition-group' resolves to a 'view-transition-name' in its ancestor chain, or to ''view-transition-name/none''. When generating the [=named view transition pseudo-element=], the ''::view-transition-group()'' with that name would be the parent of the ''::view-transition-group()'' generated for this element's 'view-transition-name'. - When the [=computed value=] of 'view-transition-name' for an element is ''view-transition-name/none'', its 'view-transition-group' [=used value=] is always resolved to ''view-transition-name/none'' as well. - -
- : normal - :: The [=used value=] is the element's [=nearest containing group name=]. - - : nearest - :: The [=used value=] is the 'view-transition-name' [=computed value=] of the nearest ancestor whose 'view-transition-name' [=computed value=] is not ''view-transition-name/none''. - - : contain - :: The [=used value=] is the element's [=nearest containing group name=]. - - Note: Descendant elements are contained within this group by default, as it would be their element's [=nearest containing group name=]. - - : <> - :: The [=used value=] is the given <> if the element has an ancestor whose 'view-transition-name' [=computed value=] is that <>, otherwise the element's [=nearest containing group name=] -
- # Algorithms # {#algorithms} ## Data structures ## {#cross-doc-data-structures} @@ -1177,28 +1160,64 @@ When capturing the old or new state for an element, perform the following steps ## Capturing and applying 'view-transition-group' ## {#vt-group-algorithm} -### Compute the nearest containing 'view-transition-group' ### {#vt-group-nearest-contain} -
+### Resolving the 'view-transition-group' value ### {#vt-group-value-resolve} + +
+To get the document-scoped view transition group of an {{Element}} |element|, perform the following steps: + + 1. Let |computedGroup| be the [=computed value=] of element's 'view-transition-group' property. + 1. If |computedGroup| is associated with |element|'s [=node document=], return |computedGroup|. + 1. Return ''view-transition-group/normal''. +
+ +### Resolving the containing group name ### {#vt-containing-group-name-resolve} + +
+ +To resolve the nearest containing group name of an {{Element}} |element|, perform the following steps given a {{ViewTransition}} |viewTransition|: + 1. Assert: |element| participates in |viewTransition|. + 1. Let |ancestorGroup| be |element|'s nearest [=flat tree=] [=tree/ancestor=] who participates in |viewTransition| and whose [=document-scoped view transition group=] is not ''view-transition-group/normal''. + 1. If |ancestorGroup| exists, return |ancestorGroup|'s [=document-scoped view transition name=]. + 1. Return ''view-transition-name/none''. +
+ +### Resolving the group name ### {#vt-group-name-resolve} + +
+To resolve the used group name of an {{Element}} |element|, perform the following steps given a {{ViewTransition}} |transition|: -To get the nearest containing group name for an {{Element}} |element|, perform the following steps: + 1. Assert: |element| participates in |transition|. + 1. Let |group| be |element|'s [=document-scoped view transition group=]. + 1. Let |containingGroupName| be |element|'s [=nearest containing group name=] given |transition|. + 1. Return the first matching statement, switching on |group|: - 1. Let |nearestAncestorWithContain| be |element|'s nearest ancestor whose 'view-transition-name' [=computed value=] is not ''view-transition-name/none'' and whose 'view-transition-group' [=computed value=] is ''view-transition-group/contain''. - 1. If |nearestAncestorWithContain| is null, return ''view-transition-group/none''. - 1. Otherwise, return |nearestAncestorWithContain|'s 'view-transition-name' [=computed value=]. +
+ : normal + : contain + :: |containingGroupName|. + + Note: an element with ''view-transition-group/contain'' becomes the [=nearest containing group name=] for its descendants. + + : nearest + :: The [=document-scoped view transition name=] of the element's nearest [=flat tree=] ancestor which participates in the |transition|. + + : <> + :: |group| if the element has a [=flat tree=] [=tree/ancestor=] whose [=document-scoped view transition name=] is |group| and participates in |transition|; Otherwise |containingGroupName|. +
### Compute the old 'view-transition-group' ### {#vt-group-capture-old}
-When [[css-view-transitions-1#capture-old-state-algorithm|capturing the old state for an element]], perform the following steps given a [=captured element=] |capturedElement|, and an [=element=] |element|: +When [[css-view-transitions-1#capture-old-state-algorithm|capturing the old state for an element]], perform the following steps given a [=captured element=] |capturedElement|, a {{ViewTransition}} |transition|, and an [=element=] |element|: - 1. Set |capturedElement|'s [=captured element/containing group name=] to the [=used value=] of |element|'s ''view-transition-group''. + 1. Set |capturedElement|'s [=captured element/containing group name=] to |element|'s [=used group name=] given |transition|.
### Compute the new 'view-transition-group' ### {#vt-group-capture-new}
-When [[css-view-transitions-1#capture-new-state-algorithm|capturing the new state for an element]], perform the following steps given a [=captured element=] |capturedElement| and an [=element=] |element|: +When [[css-view-transitions-1#capture-new-state-algorithm|capturing the new state for an element]], perform the following steps given a [=captured element=] |capturedElement| a {{ViewTransition}} |transition|, and an [=element=] |element|: - 1. Set |capturedElement|'s [=captured element/containing group name=] to the [=used value=] of |element|'s 'view-transition-group'. + 1. Set |capturedElement|'s [=captured element/containing group name=] to |element|'s [=used group name=] given |transition|.
### Reparent a ''::view-transition-group()'' to its specified containing group ### {#vt-group-reparent}