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] Apply renames based on TPAC discussion (#9382)
* [css-view-transitions-2] Rename reveal to readytorender, and auto-view-transition to navigation-behavior
* Add CSSOM definitions
* Rename to what was decided temporarily at TPAC
* PR nits
## The [=@auto-view-transition/same-origin=] property ## {#view-transition-name-prop}
279
+
Note: currently <code>same-origin</code> has to be present, as a future placeholder for customizing
280
+
the navigation behavior based on the URL.
281
+
282
+
Note: as per default behavior, the ''@view-transition'' rule can be nested inside a
283
+
[=conditional group rule=] such as ''@media'' or ''@supports''.
284
+
285
+
## The [=@view-transition/view-transition=] property ## {#view-transition-name-prop}
279
286
280
287
<pre class='descdef'>
281
-
Name: same-origin
282
-
For: @auto-view-transition
283
-
Value: enabled | disabled
284
-
Initial: disabled
288
+
Name: trigger
289
+
For: @view-transition
290
+
Value: navigation | none
291
+
Initial: none
285
292
</pre>
286
293
287
-
The '<dfn for="@auto-view-transition">same-origin</dfn>' property opts in to automatically performing a view transition when performing a[=same origin=] navigation.
294
+
The '<dfn for="@view-transition">trigger</dfn>' property opts in to automatically starting a view transition when performing a navigation.
288
295
It needs to be enabled both in the old document (when unloading) and in the new document (when ready to render).
289
296
290
-
<dl dfn-type=value dfn-for="same-origin">
291
-
: <dfn>disabled</dfn>
297
+
<dl dfn-type=value dfn-for="trigger">
298
+
: <dfn>none</dfn>
292
299
:: There will be no transition.
293
300
294
-
: <dfn>enabled</dfn>
301
+
: <dfn>navigation</dfn>
295
302
:: The transition will be enabled if the navigation is same-origin, without cross-origin
296
303
redirects.
297
304
</dl>
298
305
306
+
307
+
299
308
# API # {#api}
300
309
301
-
## The <dfn interface>PageRevealEvent</dfn> ## {#reveal-event}
310
+
## The <dfn interface>RevealEvent</dfn> ## {#ready-to-render-event}
302
311
303
312
Note: this should go in the HTML spec. See [Issue 9315](https://github.com/whatwg/html/issues/9315).
@@ -352,10 +383,10 @@ The <dfn attribute for=PageRevealEvent>viewTransition</dfn> [=getter steps=] are
352
383
A {{Document}} additionally has:
353
384
354
385
<dl dfn-for=document>
355
-
: <dfn>is revealed</dfn>
386
+
: <dfn>ready to render fired</dfn>
356
387
:: a boolean, initially false.
357
388
358
-
### Additions to {{ViewTransition}} ## {#view-transitions-extension}
389
+
### Additions to {{ViewTransition}} ### {#view-transitions-extension}
359
390
360
391
A {{ViewTransition}} additionally has:
361
392
<dl dfn-for=ViewTransition>
@@ -380,29 +411,29 @@ The <dfn attribute for=PageRevealEvent>viewTransition</dfn> [=getter steps=] are
380
411
<div algorithm="monkey patch to rendering">
381
412
Run the following step in [=update the rendering|updating the renedering=], before [=running the animation frame callbacks=]:
382
413
383
-
1. For each [=fully active=]{{Document}} |doc| in |docs|, [=reveal document|reveal=] |doc|.
414
+
1. For each [=fully active=]{{Document}} |doc| in |docs|, run the [=ready to render=] steps for |doc|.
384
415
</div>
385
416
386
417
<div algorithm="monkey patch to reactivation">
387
418
Run the following step at the end of [=Document/reactivate=]:
388
419
389
-
1. Set |document|'s [=is revealed=] to false.
420
+
1. Set |document|'s [=ready to render fired=] to false.
390
421
</div>
391
422
392
-
<div algorithm="page reveal">
393
-
To <dfn>reveal {{Document}}</dfn> |document|:
394
-
1. If |document|'s [=document/is revealed=] is true, then return.
423
+
<div algorithm="page ready to render">
424
+
When {{Document}} |document| is <dfn>ready to render</dfn>:
425
+
1. If |document|'s [=document/ready to render fired=] is true, then return.
395
426
396
427
1. Let |transition| be the result of getting the [=inbound cross-document view-transition=] for |document|.
397
428
398
429
1. If |transition| is not null and |document| does not [=opt in to cross-document view transitions=], then [=skip the view transition|skip=] |transition| and set |transition| to null.
399
430
400
431
1. Fire a new event named <code>reveal</code> on |document|'s [=relevant global object=],
401
-
using {{PageRevealEvent}}.
432
+
using {{RevealEvent}}.
402
433
403
434
1. If |transition| is not null, then [=activate view transition|activate=] |transition|.
404
435
405
-
1. Set |document|'s [=document/is revealed=] to true.
436
+
1. Set |document|'s [=document/ready to render fired=] to true.
406
437
</div>
407
438
408
439
## Setting up and activating the cross-document view transition ## {#setting-up-and-activating-the-cross-document-view-transition}
@@ -423,7 +454,7 @@ The <dfn attribute for=PageRevealEvent>viewTransition</dfn> [=getter steps=] are
423
454
1. If |oldDocument| does not [=opt in to cross-document view transitions=], then call |onReady| and return.
424
455
425
456
Note: We don't know yet if |newDocument| has opted in, as it might not be parsed yet.
426
-
We check the opt-in for |newDocument| when it is [=reveal document|revealed=].
457
+
We check the opt-in for |newDocument| when it is [=ready to render=].
427
458
428
459
1. If |oldDocument|'s [=active view transition=] is not null,
429
460
then [=skip the view transition|skip=] |oldDocument|'s [=active view transition=]
@@ -475,15 +506,15 @@ The <dfn attribute for=PageRevealEvent>viewTransition</dfn> [=getter steps=] are
475
506
then return null.
476
507
477
508
Note: |transition|'s [=ViewTransition/is inbound cross-document transition=] would be false if a same-document
478
-
transition was started before the page was revealed.
509
+
transition was started before the page was [=ready to render=].
479
510
480
511
1. Return |transition|.
481
512
</div>
482
513
483
514
<div algorithm>
484
515
A {{Document}} |document| is said to <dfn>opt in to cross-document view transitions</dfn>
485
-
if the [=computed value=] of <a data-xref-type="css-descriptor" data-xref-for="@auto-view-transition">same-origin</a>
486
-
is <code>enabled</code>.
516
+
if the [=computed value=] of <a data-xref-type="css-descriptor" data-xref-for="@view-transition">trigger</a>
0 commit comments