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-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
// This would run both on initial load and on reactivation from BFCache.
177
-
addEventListener("reveal", async event => {
177
+
addEventListener("pagereveal", async event => {
178
178
if (!event.viewTransition)
179
179
return;
180
180
@@ -305,13 +305,12 @@ Note: as per default behavior, the ''@view-transition'' rule can be nested insid
305
305
<pre class='descdef'>
306
306
Name: type
307
307
For: @view-transition
308
-
Value: <<custom-ident>>+
309
-
Initial: n/a
308
+
Value: <<custom-ident>>*
309
+
Initial: an empty list
310
310
</pre>
311
311
312
312
The '<dfn for="@view-transition">type</dfn>' descriptor sets the [=ViewTransition/active types=] for the transition
313
313
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}}.
315
314
316
315
# API # {#api}
317
316
@@ -381,7 +380,7 @@ The {{CSSViewTransitionRule}} represents a ''@view-transition'' rule.
381
380
[Exposed=Window]
382
381
interface CSSViewTransitionRule : CSSRule {
383
382
attribute ViewTransitionNavigation navigation;
384
-
attribute DOMTokenList? type;
383
+
attribute DOMTokenList type;
385
384
};
386
385
</xmp>
387
386
@@ -435,13 +434,16 @@ The {{CSSViewTransitionRule}} represents a ''@view-transition'' rule.
435
434
436
435
<div algorithm="page reveal">
437
436
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.
440
438
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|.
443
440
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.
445
447
</div>
446
448
447
449
## 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.
455
457
456
458
1. If |matchingRule| is not found, then return "<code>not found</code>".
457
459
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=].
461
461
</div>
462
462
463
463
### Setting up the view-transition in the old {{Document}}
@@ -523,12 +523,18 @@ The {{CSSViewTransitionRule}} represents a ''@view-transition'' rule.
523
523
1. Set |oldDocument|'s [=active view transition=] to |outboundTransition|.
524
524
525
525
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.
526
532
</div>
527
533
528
-
### Activating the view-transition in the new {{Document}}
534
+
### Accessing the view-transition in the new {{Document}}
529
535
530
536
<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|:
532
538
533
539
1. Let |transition| be |document|'s [=active view transition=].
534
540
@@ -544,8 +550,6 @@ The {{CSSViewTransitionRule}} represents a ''@view-transition'' rule.
544
550
545
551
1. Set |transition|'s [=ViewTransition/active types=] to |resolvedRule|.
0 commit comments