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
[css-view-transitions-1] Define pseudo-nesting and naming (#8126)
* Define pseudo-nesting and naming
* Language tweak
* Specify tree-abiding
* Tidy up pseudo-parent definition
* Define :only-child behaviour
* Nit
* Clarify snapshot viewport as containing block
* Define adding the ::view-transition
* Move iew-transition root pseudo-element to document
* Base on tree terminology
* Change issue to note
* Make "show view-transition root pseudo-element" a boolean
Also clean up the use of phases, and put the note in the correct place
* Set show pseudo to false
The following <dfn export>view-transition pseudo-elements</dfn> represent the various items being animated.
200
+
## Pseudo-element root ## {#pseudo-root}
201
201
202
-
The ''::view-transition'' pseudo-element acts as a grouping element for other [=view-transition pseudo-elements=]
203
-
and has the document's [=document element=] as its [=originating element=].
202
+
Note: This is a general definition for trees of pseudo-elements. If other features need this behavior, these definitions will be moved to [[css-pseudo-4]].
204
203
205
-
Note: For example, '':root::view-transition'' selector matches this pseudo-element,
206
-
but ''div::view-transition'' does not.
204
+
A <dfn>pseudo-element root</dfn> is a type of [=tree-abiding pseudo-element=] that is the [=tree/root=] in a [=tree=] of [=tree-abiding pseudo-elements=],
205
+
known as the <dfn>pseudo-element tree</dfn>.
207
206
208
-
Other [=view-transition pseudo-elements=] take a <<pt-name-selector>> argument
209
-
to specify which elements named with 'view-transition-name' are affected.
207
+
The [=pseudo-element tree=] defines the document order of its [=tree/descendant=][=tree-abiding pseudo-elements=].
210
208
211
-
There can be multiple pseudo-elements of the same type,
212
-
one for each 'view-transition-name' participating in a transition.
209
+
When a [=pseudo-element=][=tree/participates=] in a [=pseudo-element tree=],
210
+
its [=originating pseudo-element=] is its [=tree/parent=].
213
211
214
-
The <<pt-name-selector>> is defined as follows:
212
+
If a [=tree/descendant=] |pseudo| of a [=pseudo-element root=] has no other [=tree/siblings=],
213
+
then '':only-child'' matches that |pseudo|.
214
+
215
+
Note: This means that `::view-transition-new(ident):only-child` will only select `::view-transition-new(ident)` if the parent `::view-transitions-image-pair(ident)` contains a single [=tree/child=].
216
+
As in, there is no [=tree/sibling=] `::view-transition-old(ident)`.
217
+
218
+
## Named view-transition pseudo-elements ## {#named-view-transition-pseudo}
219
+
220
+
A <dfn>named view-transition pseudo-element</dfn> is a type of [=tree-abiding pseudo-elements=].
221
+
222
+
It has a <dfn for="named view-transition pseudo-element">view-transition name</dfn>,
223
+
a string.
224
+
225
+
Their selector takes a <<pt-name-selector>> argument.
A value of ''*'' makes the corresponding selector apply to all pseudo elements of the specified type.
221
-
The specificity of a view-transition selector with a ''*'' argument is zero.
231
+
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=].
222
232
223
-
The <<custom-ident>> value makes the corresponding selector apply to exactly one pseudo element of the specified type,
224
-
namely the pseudo-element that is created as a result of the 'view-transition-name' property on an element with the same <<custom-ident>> value.
225
233
The specificity of a view-transition selector with a <<custom-ident>> argument is the same as for other pseudo-elements,
226
234
and is equivalent to a [=type selector=].
227
235
228
-
The following describes all of the [=view-transition pseudo-elements=] and their function:
236
+
The specificity of a view-transition selector with a `*` argument is zero.
237
+
238
+
Note: The [=named view-transition pseudo-element/view-transition name=] is set to the 'view-transition-name' that triggered its creation.
Note: Additional styles in the [=document/view transition style sheet=] added to animate these pseudo-elements are detailed in [=setup transition pseudo-elements=] and [=update pseudo-element styles=].
322
344
345
+
Note: This is only ever a [=tree/child=] of a ''::view-transition-image-pair()'', and never has any [=tree/children=].
The precise tree structure, and in particular the order of sibling pseudo-elements,
351
+
Note: The precise tree structure, and in particular the order of sibling pseudo-elements,
328
352
is defined in the [=setup transition pseudo-elements=] algorithm.
329
353
330
354
# Concepts # {#concepts}
331
355
332
356
## Phases ## {#phases-concept}
333
357
334
358
<dfn>Phases</dfn> represent an ordered sequence of states.
335
-
Since [=phases=] are ordered, prose can refer to phases <dfn for="phases">before</dfn> a particular phase, meaning they appear earlier in the sequence,
336
-
or <dfn for="phases">after</dfn> a particular phase, meaning they appear later in the sequence.
359
+
Since [=phases=] are ordered, prose can refer to phases <dfn for="phases">before</dfn> a particular phase, meaning they appear earlier in the sequence.
360
+
<!-- or <dfn for="phases">after</dfn> a particular phase, meaning they appear later in the sequence. -->
337
361
338
362
The initial phase is the first item in the sequence.
339
363
340
-
Note: For the most part, a developer using this API does not need to worry about the different phases, since they progress automatically.
341
-
It is, however, important to understand what steps happen in each of the phases: when the snapshots are captured, when pseudo-element DOM is created, etc.
342
-
The description of the phases below tries to be as precise as possible, with an intent to provide an unambiguous set of steps for implementors to follow in order to produce a spec-compliant implementation.
343
-
344
364
## The snapshot viewport ## {#snapshot-viewport-concept}
345
365
346
366
The <dfn>snapshot viewport</dfn> covers all areas of the window that could potentially display web content.
When this is true, [=this=]'s [=active DOM transition=]'s [=ViewTransition/transition root pseudo-element=] renders as a child of [=this=]'s [=document element=],
490
+
and [=this=]'s [=document element=] is its [=originating element=].
491
+
492
+
Note: The position of the [=ViewTransition/transition root pseudo-element=] within the [=document element=] does not matter, as the [=ViewTransition/transition root pseudo-element=]'s [=containing block=] is the [=snapshot viewport=].
Note: For the most part, a developer using this API does not need to worry about the different phases, since they progress automatically.
619
+
It is, however, important to understand what steps happen in each of the phases: when the snapshots are captured, when pseudo-element DOM is created, etc.
620
+
The description of the phases below tries to be as precise as possible, with an intent to provide an unambiguous set of steps for implementors to follow in order to produce a spec-compliant implementation.
621
+
594
622
: <dfn>DOM update callback</dfn>
595
623
:: an {{UpdateDOMCallback}} or null. Initially null.
0 commit comments