You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To generate the same cross-fade as in the first example [[css-view-transitions-1#examples]],
130
134
but across documents, we don't need JavaScript.
@@ -259,20 +263,21 @@ for multiple elements without having to replicate the corresponding pseudo-eleme
259
263
Animation type: discrete
260
264
</pre>
261
265
262
-
The 'view-transition-class' works alongside 'view-transition-name', and is read at the same time
263
-
'view-transition-name' is read. But unlike 'view-transition-name', 'view-transition-class' doesn't
264
-
have to be unique - an element can have several view-transition classes, and the same 'view-transition-class'
265
-
can apply to multiple elements. While 'view-transition-name' is used to match between the element
266
-
in the old state with its corresponding element in the new state, 'view-transition-class' is used
266
+
The 'view-transition-class' can be used to apply the same style rule to multiple [=named view transition pseudo-elements=] which may have a different 'view-transition-name'.
267
+
While 'view-transition-name' is used to match between the element in the old state with its corresponding element in the new state, 'view-transition-class' is used
267
268
only to apply styles using the view-transition pseudo-elements
Note that 'view-transition-class' by itself doesn't mark an element for capturing, it is only used as an additional
272
+
way to style an element that already has a 'view-transition-name'.
273
+
270
274
<dl dfn-type=value dfn-for=view-transition-class>
271
275
: <dfn>none</dfn>
272
-
:: No class would apply to the [=named view-transition pseudo-elements=] generated for this element.
276
+
:: No class would apply to the [=named viewtransition pseudo-elements=] generated for this element.
273
277
274
278
: <dfn><<custom-ident>>*</dfn>
275
-
:: All of the specified <<custom-ident>> values (apart from <css>none</css>) apply as classes for the [=/element=].
279
+
:: All of the specified <<custom-ident>> values (apart from <css>none</css>) are applied when used in [=named view transition pseudo-element=] selectors.
280
+
<css>none</css> is an invalid <<custom-ident>> for 'view-transition-class', even when combined with other <<custom-ident>>s.
276
281
277
282
Note: If the same 'view-transition-name' is specified for an element both in the old and new states of the transition,
278
283
only the 'view-transition-class' values from the new state apply. This also applies for cross-document view-transitions:
A [=named view transition pseudo-element=][=selector=] which has one or more <<custom-ident>> values
356
-
in its <<pt-class-selector>> would only match an element if the element's [=captured element/class list=]
357
-
[=list/contains=] all of those values.
361
+
in its <<pt-class-selector>> would only match an element if the [=captured element/class list=] value in
362
+
[=ViewTransition/named elements=] for the pseudo-element's 'view-transition-name'[=list/contains=] all of those values.
358
363
359
364
The specificity of a [=named view transition pseudo-element=][=selector=]
360
365
with a <<pt-class-selector>>
@@ -495,23 +500,18 @@ The {{CSSViewTransitionRule}} represents a ''@view-transition'' rule.
495
500
496
501
## Additions to [=captured element=] struct ## {#additions-to-captured-element-struct}
497
502
503
+
The [=captured element=] struct should contain these fields, in addition to the existing ones:
504
+
498
505
<dl>
499
506
: <dfn for="captured element">class list</dfn>
500
507
:: a [=/list=] of strings, initially empty.
501
508
</dl>
502
509
503
-
## Additions to capture algorithms: ## {#additions-to-capture-algorithms}
504
-
<div algorithm="capture old classes">
505
-
When capturing the old state of the view transition, perform the following step when iterating on |captureElements| given |element| and |capture|:
510
+
## Algorithms to capture 'view-transition-class': ## {#vt-class-algorithms}
511
+
<div algorithm="additional capture steps">
512
+
This spec provides the following [=additional capture steps=] given a [=captured element=] |capture| and an [=element=] |element|:
506
513
507
514
1. Set |capture|'s [=captured element/class list=] to the [=computed value=] of |element|'s 'view-transition-class'.
508
-
509
-
</div>
510
-
511
-
<div algorithm="capture new classes">
512
-
When capturing the new state of the view transition, perform the following step when iterating on |captureElements| given |element| and |namedElements|:
513
-
514
-
1. Set |namedElement|[|transitionName|]'s [=captured element/class list=] to the [=computed value=] of |element|'s 'view-transition-class'.
515
515
</div>
516
516
517
517
## Monkey patches to HTML ## {#monkey-patch-to-html}
0 commit comments