Skip to content

Commit fb26012

Browse files
authored
[css-view-transitions-2] Apply resolutions from F2F (w3c#9090)
* [css-view-transitions-2] Apply feedback from F2F - Disable view-transitions for reload - Add wording in security about 3p CSS - Fire reveal event before rAF, inside update the rendering Closes w3c#8784 Closes w3c#8889 See w3c#8048 * Remove reload thing in the meantime
1 parent 7b31016 commit fb26012

1 file changed

Lines changed: 27 additions & 22 deletions

File tree

css-view-transitions-2/Overview.bs

Lines changed: 27 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Markup Shorthands: css yes, markdown yes
2020
<pre class=link-defaults>
2121
spec:css-view-transitions-1;
2222
text: active view transition; type: dfn;
23+
text: clear view transition; type: dfn;
2324
text: activate view transition; type: dfn;
2425
text: skip the view transition; type: dfn;
2526
text: ViewTransition; type: interface;
@@ -37,10 +38,9 @@ spec:css22; type:dfn; text:element
3738
spec:html
3839
text: latest entry; type: dfn;
3940
text: was created via cross-origin redirects; type: dfn;
41+
text: run the animation frame callbacks; type: dfn;
4042
text: unload; type: dfn;
41-
text: render-blocked; type: dfn;
42-
text: unblock rendering; type: dfn;
43-
text: page showing; type: dfn;
43+
text: update the rendering; type: dfn;
4444
</pre>
4545

4646
<pre class=anchors>
@@ -267,8 +267,17 @@ The <dfn attribute for=PageRevealEvent>viewTransition</dfn> [=getter steps=] are
267267

268268

269269
# Algorithms # {#algorithms}
270+
## Data Structures ## {#concepts}
270271

271-
## Additions to {{ViewTransition}} ## {#view-transitions-extension}
272+
### Additions to {{Document}} ### {#additions-to-document}
273+
274+
A {{Document}} additionally has:
275+
276+
<dl dfn-for=document>
277+
: <dfn>is revealed</dfn>
278+
:: a boolean, initially false.
279+
280+
### Additions to {{ViewTransition}} ## {#view-transitions-extension}
272281

273282
A {{ViewTransition}} additionally has:
274283
<dl dfn-for=ViewTransition>
@@ -287,32 +296,21 @@ The <dfn attribute for=PageRevealEvent>viewTransition</dfn> [=getter steps=] are
287296
Note: This would wait until a transition is captured or skipped before proceeding to unloading the old document and activating the new one.
288297
</div>
289298

290-
<div algorithm="monkey patch to render blocking">
291-
Run the following step at the end of [=unblock rendering=]:
292-
293-
1. [=reveal document|reveal=] |document|.
294-
295-
Issue: Reword the text in the [=render-blocked=] definition, to call [=reveal document=] |document| if the [=implementation-defined=] timeout value has been exceeded.
296-
</div>
297-
298-
<div algorithm="monkey patch to script processing model">
299-
In the <a href="https://html.spec.whatwg.org/#script-processing-model">Script processing model</a> section,
300-
move <a href="https://html.spec.whatwg.org/#script-processing-model:unblock-rendering">unblock rendering</a> step to the end.
299+
<div algorithm="monkey patch to rendering">
300+
Run the following step in [=update the rendering|updating the renedering=], before [=running the animation frame callbacks=]:
301301

302-
Note: this ensures that the [=reveal document=] steps are called after firing script `load` or `error` events.
302+
1. For each [=fully active=] {{Document}} |doc| in |docs|, [=reveal document|reveal=] |doc|.
303303
</div>
304304

305305
<div algorithm="monkey patch to reactivation">
306-
Run the following step in [=Document/reactivate=], before step 4 (querying for [=page showing=]):
306+
Run the following step at the end of [=Document/reactivate=]:
307307

308-
1. [=Reveal document|reveal=] |document|.
308+
1. Set |document|'s [=is revealed=] to false.
309309
</div>
310310

311311
<div algorithm="page reveal">
312312
To <dfn>reveal {{Document}}</dfn> |document|:
313-
1. Assert: |document|'s [=page showing=] is false.
314-
315-
1. If |document| is [=render-blocked=], then return.
313+
1. If |document|'s [=document/is revealed=] is true, then return.
316314

317315
1. Let |transition| be the result of getting the [=inbound cross-document view-transition=] for |document|.
318316

@@ -322,6 +320,8 @@ The <dfn attribute for=PageRevealEvent>viewTransition</dfn> [=getter steps=] are
322320
using {{PageRevealEvent}}.
323321

324322
1. If |transition| is not null, then [=activate view transition|activate=] |transition|.
323+
324+
1. Set |document|'s [=document/is revealed=] to true.
325325
</div>
326326

327327
## Setting up and activating the cross-document view transition ## {#setting-up-and-activating-the-cross-document-view-transition}
@@ -416,7 +416,7 @@ To prevent cross-origin issues, at this point cross-document view transitions ca
416416
same-origin navigations. As discussed in <a href="https://github.com/WICG/view-transitions/issues/200">WICG/view-transitions#200</a>,
417417
this still presents two potential threats:
418418

419-
1. The <a data-xref-type="http-header">Cross-Origin-Opener-Policy</a> of both documents might be different.
419+
1. The [=environment settings object/cross-origin isolated capability=] in both documents might be different.
420420
This can cause a situation where a {{Document}} that is [=environment settings object/cross-origin isolated capability|cross-origin isolated=]
421421
can read image data from a document that is not cross-origin isolated. This is already mitigated in [[css-view-transitions-1#sec],
422422
as the same restriction applies for captured cross-origin iframes.
@@ -433,6 +433,11 @@ this still presents two potential threats:
433433
Note: this only applies to server-side redirects. A client-side redirect, e.g. using
434434
[^meta/http-equiv/refresh^], is equivalent to a new navigation.
435435

436+
1. This feature exposes more information to CSS, as so far CSS was not aware of anything navigation-related.
437+
This can raise concerns around safety 3rd-party CSS. However, as a general rule, 3rd-party stylesheets should come
438+
from trusted sources to begin with, as CSS can learn about the document or change it in many ways.
439+
440+
436441
See <a href="https://github.com/w3c/csswg-drafts/issues/8684">Issue #8684</a> and
437442
<a href="https://github.com/WICG/view-transitions/issues/200">WICG/view-transitions#200</a> for
438443
detailed discussion.

0 commit comments

Comments
 (0)