Skip to content

Commit c0dd54f

Browse files
committed
[css-view-transitions-1][editorial] Improve view-transition-name definition
* Give it a proper title * Give it a conceptual definition * State that it *will* get snapshotted, rather than it might * Make exclusion of 'none' from <custom-ident> normative * Various wording tweaks
1 parent 518020f commit c0dd54f

File tree

1 file changed

+27
-19
lines changed

1 file changed

+27
-19
lines changed

css-view-transitions-1/Overview.bs

Lines changed: 27 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ urlPrefix: https://wicg.github.io/navigation-api/; type: interface;
483483

484484
# CSS properties # {#css-properties}
485485

486-
## 'view-transition-name' ## {#view-transition-name-prop}
486+
## Tagging Individually Transitioning Subtrees: the 'view-transition-name' property ## {#view-transition-name-prop}
487487

488488
<pre class=propdef>
489489
Name: view-transition-name
@@ -495,27 +495,35 @@ urlPrefix: https://wicg.github.io/navigation-api/; type: interface;
495495
Animation type: discrete
496496
</pre>
497497

498-
The 'view-transition-name' property "names" an element as participating in a view transition.
498+
The 'view-transition-name' property “tags” an element
499+
as [=involved in a view transition=],
500+
capturing it independently in the [=view transition tree=]
501+
under the specified <dfn>view transition name</dfn>.
502+
An element so captured is animated independently of the rest of the page.
499503

500504
<dl dfn-type=value dfn-for=view-transition-name>
501505
: <dfn>none</dfn>
502-
:: The [=/element=] will not participate in a view transition.
506+
:: The [=/element=] will not participate independently in a view transition.
503507

504508
: <dfn><<custom-ident>></dfn>
505-
:: The [=/element=] can participate in a view transition,
509+
:: The [=/element=] will participate in a view transition,
506510
as either an old or new [=/element=],
507-
with a <dfn dfn for>view transition name</dfn> equal to the <<custom-ident>>'s value.
511+
with the specified [=view transition name=].
508512

509-
Note: The value <css>none</css> is invalid as a <<custom-ident>>.
513+
The value <css>none</css> is excluded from <<custom-ident>> here.
514+
515+
Note: If this name is not unique
516+
(i.e. if two elements simultaneously specify the same [=view transition name=])
517+
then the [=view transition=] will abort.
510518
</dl>
511519

512-
Note: This property causes the user-agent to both capture separate snapshots from the elements,
513-
as well as create separate pseudo-element sub-trees representing this element's “old” and “new” states.
514-
For the purposes of this API,
515-
if one element has a transition-name "foo" in the old state, and another element has a transition-name "foo" in the new state,
516-
they are treated as representing different visual state of the same element.
520+
Note: For the purposes of this API,
521+
if one element has [=view transition name=] ''foo'' in the old state,
522+
and another element has [=view transition name=] ''foo'' in the new state,
523+
they are treated as representing different visual state of the same element,
524+
and will be paired in the [=view transition tree=].
517525
This may be confusing, since the elements themselves are not necessarily referring to the same object,
518-
but it is a useful model to consider them to be visual states of the same conceptual page entity, that we happen to call "element".
526+
but it is a useful model to consider them to be visual states of the same conceptual page entity.
519527

520528
# Layout and rendering changes # {#layout-rendering-changes}
521529

@@ -602,14 +610,14 @@ urlPrefix: https://wicg.github.io/navigation-api/; type: interface;
602610
<dfn>&lt;pt-name-selector></dfn> = '*' | <<custom-ident>>
603611
</pre>
604612

605-
The selector matches if the <<pt-name-selector>> is `*` or matches the [=named view-transition pseudo-element=]'s [=named view-transition pseudo-element/view-transition name=].
613+
The selector matches if the <<pt-name-selector>> is `*` or matches the [=named view-transition pseudo-element=]'s [=view transition name=].
606614

607615
The specificity of a view-transition selector with a <<custom-ident>> argument is the same as for other pseudo-elements,
608616
and is equivalent to a [=type selector=].
609617

610618
The specificity of a view-transition selector with a `*` argument is zero.
611619

612-
Note: The [=named view-transition pseudo-element/view-transition name=] is set to the 'view-transition-name' that triggered its creation.
620+
Note: The [=view transition name=] is set to the 'view-transition-name' that triggered its creation.
613621

614622
## View transition pseudo-elements ## {#view-transition-pseudos}
615623

@@ -1352,27 +1360,27 @@ urlPrefix: https://wicg.github.io/navigation-api/; type: interface;
13521360
1. [=map/For each=] |transitionName| → |capturedElement| of |transition|'s [=ViewTransition/named elements=]:
13531361

13541362
1. Let |group| be a new ''::view-transition-group()'',
1355-
with its [=named view-transition pseudo-element/view-transition name=] set to |transitionName|.
1363+
with its [=view transition name=] set to |transitionName|.
13561364

13571365
1. Append |group| to |transition|'s [=ViewTransition/transition root pseudo-element=].
13581366

13591367
1. Let |imagePair| be a new ''::view-transition-image-pair()'',
1360-
with its [=named view-transition pseudo-element/view-transition name=] set to |transitionName|.
1368+
with its [=view transition name=] set to |transitionName|.
13611369

13621370
1. Append |imagePair| to |group|.
13631371

13641372
1. If |capturedElement|'s [=captured element/old image=] is not null, then:
13651373

13661374
1. Let |old| be a new ''::view-transition-old()'',
1367-
with its [=named view-transition pseudo-element/view-transition name=] set to |transitionName|,
1375+
with its [=view transition name=] set to |transitionName|,
13681376
displaying |capturedElement|'s [=captured element/old image=].
13691377

13701378
1. Append |old| to |imagePair|.
13711379

13721380
1. If |capturedElement|'s [=new element=] is not null, then:
13731381

13741382
1. Let |new| be a new ''::view-transition-new()'',
1375-
with its [=named view-transition pseudo-element/view-transition name=] set to |transitionName|.
1383+
with its [=view transition name=] set to |transitionName|.
13761384

13771385
Note: The styling of this pseudo is handled in [=update pseudo-element styles=].
13781386

@@ -1707,7 +1715,7 @@ urlPrefix: https://wicg.github.io/navigation-api/; type: interface;
17071715

17081716
1. If |capturedElement|'s [=new element=] is not null, then:
17091717

1710-
1. Let |new| be the ''::view-transition-new()'' with the [=view-transition name=] |transitionName|.
1718+
1. Let |new| be the ''::view-transition-new()'' with the [=view transition name=] |transitionName|.
17111719

17121720
1. Set |new|'s [=replaced element=] content to the result of [=capturing the image=] of |capturedElement|'s [=new element=].
17131721

0 commit comments

Comments
 (0)