Skip to content

Commit 9ac9b46

Browse files
authored
[css-view-transitions-2] Tighten view-transition rule resolving (#9602)
- `types: none` should resolve to having no types - `navigation: none` should always skip transition. Closes #9534
1 parent 01bf8fc commit 9ac9b46

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

css-view-transitions-2/Overview.bs

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -305,8 +305,8 @@ Note: as per default behavior, the ''@view-transition'' rule can be nested insid
305305
<pre class='descdef'>
306306
Name: type
307307
For: @view-transition
308-
Value: <<custom-ident>>*
309-
Initial: an empty list
308+
Value: none | <<custom-ident>>*
309+
Initial: none
310310
</pre>
311311

312312
The '<dfn for="@view-transition">type</dfn>' descriptor sets the [=ViewTransition/active types=] for the transition
@@ -453,11 +453,19 @@ The {{CSSViewTransitionRule}} represents a ''@view-transition'' rule.
453453
<div algorithm>
454454
To get the <dfn>resolve @view-transition rule</dfn> for a {{Document}} |document|:
455455

456-
1. Let |matchingRule| be the last ''@view-transition'' rule in |document| which has a ''@view-transition/navigation'' descriptor whose [=computed value=] is ''@view-transition/navigation/auto''.
456+
1. Let |matchingRule| be the last ''@view-transition'' rule in |document|.
457+
458+
1. If |matchingRule| is not found, then return "<code>skip transition</code>".
459+
460+
1. If |matchingRule|'s [=@view-transition/navigation=] descriptor's [=computed value=] is ''@view-transition/navigation/none'', then return "<code>skip transition</code>".
461+
462+
1. Assert: |matchingRule|'s [=@view-transition/navigation=] descriptor's [=computed value=] is ''@view-transition/navigation/auto''.
463+
464+
1. Let |typesDescriptor| be |matchingRule|'s [=@view-transition/type=] descriptor.
457465

458-
1. If |matchingRule| is not found, then return "<code>not found</code>".
466+
1. If |typesDescriptor|'s [=computed value=] is ''@view-transition/type/none'', then return an [=empty list=].
459467

460-
1. Return a [=list=] of strings corresponding to that descriptor's [=computed value=].
468+
1. Return a [=list=] of strings corresponding to |typesDescriptor|'s [=computed value=].
461469
</div>
462470

463471
### Setting up the view-transition in the old {{Document}}
@@ -482,7 +490,7 @@ The {{CSSViewTransitionRule}} represents a ''@view-transition'' rule.
482490

483491
1. [=Resolve @view-transition rule=] for |oldDocument| and let |resolvedRule| be the result.
484492

485-
1. If |resolvedRule| is "<code>not found</code>", then call |onReady| and return.
493+
1. If |resolvedRule| is "<code>skip transition</code>", then call |onReady| and return.
486494

487495
Note: We don't know yet if |newDocument| has opted in, as it might not be parsed yet.
488496
We check the opt-in for |newDocument| when it is [=reveal=].
@@ -549,7 +557,7 @@ The {{CSSViewTransitionRule}} represents a ''@view-transition'' rule.
549557

550558
1. [=Resolve @view-transition rule=] for |document| and let |resolvedRule| be the result.
551559

552-
1. If |resolvedRule| is "<code>not found</code>", then [=skip the view transition|skip=] |transition| and return null.
560+
1. If |resolvedRule| is "<code>skip transition</code>", then [=skip the view transition|skip=] |transition| and return null.
553561

554562
1. Set |transition|'s [=ViewTransition/active types=] to |resolvedRule|.
555563

0 commit comments

Comments
 (0)