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
A `view-transition-class` property allows specifying view-transition pseudo-elements
that apply to multiple participating elements without having to replicate them.
In this PR:
- Specifying `view-transition-class`
- Extending the pseudo-element syntax to support `::view-transition-foo(name.class)`
- Extending the capture algorithms and data structure to capture the classes
- Added a simple example for using classes
Based on [this resolution](w3c#8319 (comment)).
Closesw3c#8319
A [=named view transition pseudo-element=][=selector=] which has one or more <<custom-ident>> values
363
+
in its <<pt-class-selector>> would only match an element if the element's [=captured element/class list=]
364
+
[=list/contains=] all of those values.
365
+
366
+
The specificity of a [=named view transition pseudo-element=][=selector=]
367
+
with a <<pt-class-selector>>
368
+
is equivalent to a [=class selector=] with the equivalent number of classes.
369
+
262
370
# CSS rules # {#css-rules}
263
371
264
372
## The <dfn id="at-view-transition-rule">''@view-transition''</dfn> rule ## {#view-transition-rule}
@@ -386,6 +494,27 @@ The {{CSSViewTransitionRule}} represents a ''@view-transition'' rule.
386
494
:: Null or a [=list=] of strings, initially null.
387
495
</dl>
388
496
497
+
## Additions to [=captured element=] struct ## {#additions-to-captured-element-struct}
498
+
499
+
<dl>
500
+
: <dfn for="captured element">class list</dfn>
501
+
:: a [=/list=] of strings, initially empty.
502
+
</dl>
503
+
504
+
## Additions to capture algorithms: ## {#additions-to-capture-algorithms}
505
+
<div algorithm="capture old classes">
506
+
When capturing the old state of the view transition, perform the following step when iterating on |captureElements| given |element| and |capture|:
507
+
508
+
1. Set |capture|'s [=captured element/class list=] to the [=computed value=] of |element|'s 'view-transition-class'.
509
+
510
+
</div>
511
+
512
+
<div algorithm="capture new classes">
513
+
When capturing the new state of the view transition, perform the following step when iterating on |captureElements| given |element| and |namedElements|:
514
+
515
+
1. Set |namedElement|[|transitionName|]'s [=captured element/class list=] to the [=computed value=] of |element|'s 'view-transition-class'.
516
+
</div>
517
+
389
518
## Monkey patches to HTML ## {#monkey-patch-to-html}
390
519
391
520
<div algorithm="monkey patch to apply the history step">
0 commit comments