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
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.
358
+
359
+
The specificity of a [=named view transition pseudo-element=][=selector=]
360
+
with a <<pt-class-selector>>
361
+
is equivalent to a [=class selector=] with the equivalent number of classes.
362
+
255
363
# CSS rules # {#css-rules}
256
364
257
365
## The <dfn id="at-view-transition-rule">''@view-transition''</dfn> rule ## {#view-transition-rule}
@@ -385,6 +493,27 @@ The {{CSSViewTransitionRule}} represents a ''@view-transition'' rule.
385
493
:: Null or a [=list=] of strings, initially null.
386
494
</dl>
387
495
496
+
## Additions to [=captured element=] struct ## {#additions-to-captured-element-struct}
497
+
498
+
<dl>
499
+
: <dfn for="captured element">class list</dfn>
500
+
:: a [=/list=] of strings, initially empty.
501
+
</dl>
502
+
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|:
506
+
507
+
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
+
</div>
516
+
388
517
## Monkey patches to HTML ## {#monkey-patch-to-html}
389
518
390
519
<div algorithm="monkey patch to apply the history step">
0 commit comments