Skip to content

Commit c95d80c

Browse files
authored
[css-view-transitions-2] A few minor edits (w3c#9527)
* [css-view-transitions-2] A few minor edits * Specify paint holding * Fix missing |transition| var * Allow an empty list in the type descriptor * Separate between resolving and activating vt on new doc * nit for paint-holding condition
1 parent d6c50e9 commit c95d80c

1 file changed

Lines changed: 21 additions & 17 deletions

File tree

css-view-transitions-2/Overview.bs

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ urlPrefix: https://wicg.github.io/navigation-api/; type: interface;
174174
In the new page:
175175
```js
176176
// This would run both on initial load and on reactivation from BFCache.
177-
addEventListener("reveal", async event => {
177+
addEventListener("pagereveal", async event => {
178178
if (!event.viewTransition)
179179
return;
180180

@@ -305,13 +305,12 @@ 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: n/a
308+
Value: <<custom-ident>>*
309+
Initial: an empty list
310310
</pre>
311311

312312
The '<dfn for="@view-transition">type</dfn>' descriptor sets the [=ViewTransition/active types=] for the transition
313313
when capturing and performing the transition, equivalent to calling {{Document/startViewTransition(callbackOptions)}} with that {{StartViewTransitionOptions/type}}.
314-
Omitting the ''@view-transition/type'' descriptor is equivalent to calling {{Document/startViewTransition(callbackOptions)}} without a {{StartViewTransition/type}}.
315314

316315
# API # {#api}
317316

@@ -381,7 +380,7 @@ The {{CSSViewTransitionRule}} represents a ''@view-transition'' rule.
381380
[Exposed=Window]
382381
interface CSSViewTransitionRule : CSSRule {
383382
attribute ViewTransitionNavigation navigation;
384-
attribute DOMTokenList? type;
383+
attribute DOMTokenList type;
385384
};
386385
</xmp>
387386

@@ -435,13 +434,16 @@ The {{CSSViewTransitionRule}} represents a ''@view-transition'' rule.
435434

436435
<div algorithm="page reveal">
437436
To <dfn>reveal</dfn> {{Document}} |document|:
438-
1. If |document|'s [=document/page pagereveal fired=] is false, then:
439-
1. Let |transition| be the result of [=activating cross-document view-transition=] for |document|.
437+
1. If |document|'s [=document/page pagereveal fired=] is true, then return.
440438

441-
1. [=Fire an event=] named <code>pagereveal</code> at |document|'s [=relevant global object=],
442-
using {{PageRevealEvent}}, with [=PageRevealEvent/view transition=] initialized to .
439+
1. Let |transition| be the result of [=resolving cross-document view-transition=] for |document|.
443440

444-
1. Set |document|'s [=document/page pagereveal fired=] to true.
441+
1. [=Fire an event=] named <code>pagereveal</code> at |document|'s [=relevant global object=],
442+
using {{PageRevealEvent}}, with [=PageRevealEvent/view transition=] initialized to |transition|.
443+
444+
1. If |transition| is not null, then [=activate view transition/activate=] |transition|.
445+
446+
1. Set |document|'s [=document/page pagereveal fired=] to true.
445447
</div>
446448

447449
## Setting up and activating the cross-document view transition ## {#setting-up-and-activating-the-cross-document-view-transition}
@@ -455,9 +457,7 @@ The {{CSSViewTransitionRule}} represents a ''@view-transition'' rule.
455457

456458
1. If |matchingRule| is not found, then return "<code>not found</code>".
457459

458-
1. If |matchingRule| contains a ''@view-transition/type'' descriptor, then return a [=list=] of strings corresponding to that descriptor's [=computed value=].
459-
460-
1. Return null.
460+
1. Return a [=list=] of strings corresponding to that descriptor's [=computed value=].
461461
</div>
462462

463463
### Setting up the view-transition in the old {{Document}}
@@ -523,12 +523,18 @@ The {{CSSViewTransitionRule}} represents a ''@view-transition'' rule.
523523
1. Set |oldDocument|'s [=active view transition=] to |outboundTransition|.
524524

525525
Note: The process continues in [=setup view transition=], via [=perform pending transition operations=].
526+
527+
1. The user agent should display the currently displayed frame until either:
528+
* |newDocument| is [=revealed=]
529+
* its [=active view transition=]'s [=ViewTransition/phase=] is "`done`".
530+
531+
Note: this is to ensure that there are no unintended flashes between displaying the old and new state, to keep the transition smooth.
526532
</div>
527533

528-
### Activating the view-transition in the new {{Document}}
534+
### Accessing the view-transition in the new {{Document}}
529535

530536
<div algorithm>
531-
To <dfn export>activate cross-document view-transition</dfn> for {{Document}} |document|:
537+
To <dfn export>resolve cross-document view-transition</dfn> for {{Document}} |document|:
532538

533539
1. Let |transition| be |document|'s [=active view transition=].
534540

@@ -544,8 +550,6 @@ The {{CSSViewTransitionRule}} represents a ''@view-transition'' rule.
544550

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

547-
1. [=activate view transition|Activate=] |transition|.
548-
549553
1. Return |transition|.
550554
</div>
551555

0 commit comments

Comments
 (0)