Skip to content

Commit 631a3d5

Browse files
noamrkhushalsagar
andauthored
[css-view-transitions-1] A few clarifications and nits (#9028)
* Fix refs and split 'activate' * [css-view-transitions-1] A few clarifications and nits - Separated view transition activation to own algorithm, to prepare for cross-doc - Clarifying that new elements are invisible during the transition - Changed type of image from ImageData to 2D-bitmap - Fixed a few broken refs See #8958 * Update css-view-transitions-1/Overview.bs Co-authored-by: Khushal Sagar <63884798+khushalsagar@users.noreply.github.com> * Flip order * New line --------- Co-authored-by: Khushal Sagar <63884798+khushalsagar@users.noreply.github.com>
1 parent 2383a62 commit 631a3d5

File tree

1 file changed

+35
-30
lines changed

1 file changed

+35
-30
lines changed

css-view-transitions-1/Overview.bs

Lines changed: 35 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ spec:css-display-3; type:dfn;
3737
spec:css-cascade-5; type:dfn; text:computed value
3838
spec:css22; type:dfn; text:element
3939
spec:css-break-4; type:dfn; text:fragment
40+
spec:css-viewport; type:dfn; text:interactive-widget;
41+
spec:css-display-4; type: dfn; text:invisible;
4042
</pre>
4143

4244
<pre class=anchors>
@@ -530,7 +532,7 @@ urlPrefix: https://wicg.github.io/navigation-api/; type: interface;
530532

531533
If the element’s [=principal box=] is [=fragmented=],
532534
[=skips its contents|skipped=],
533-
or [=not rendered=],
535+
or [=element-not-rendered|not rendered=],
534536
this property has no effect.
535537
See [[#algorithms]] for exact details.
536538

@@ -776,7 +778,7 @@ urlPrefix: https://wicg.github.io/navigation-api/; type: interface;
776778
The ''::view-transition'' pseudo-element generates a new stacking context,
777779
called the <dfn>view transition layer</dfn>,
778780
which paints after all other content of the document
779-
(including any content rendered in the [=top layer=] [[!FULLSCREEN]]),
781+
(including any content rendered in the [=Document/top layer=]),
780782
after any filters and effects that are applied to such content.
781783
(It is not subject to such filters or effects,
782784
except insofar as they affect the rendered contents
@@ -787,6 +789,9 @@ urlPrefix: https://wicg.github.io/navigation-api/; type: interface;
787789
since that results in a circular dependency.
788790
Therefore, the [=view transition layer=] is a sibling of all other content.
789791

792+
When a {{Document}}'s [=document/active view transition=]'s [=ViewTransition/phase=] is "`animating`",
793+
any [=element=] in that {{Document}} that is [=captured in a view transition=] generates [=invisible=] boxes.
794+
790795
# User Agent Stylesheet # {#ua-styles}
791796

792797
The <dfn>global view transition user agent style sheet</dfn> is
@@ -1109,7 +1114,7 @@ urlPrefix: https://wicg.github.io/navigation-api/; type: interface;
11091114

11101115
<dl dfn-for="captured element">
11111116
: <dfn>old image</dfn>
1112-
:: an {{ImageData}} or null. Initially null.
1117+
:: an 2D bitmap or null. Initially null.
11131118

11141119
: <dfn>old width</dfn>
11151120
: <dfn>old height</dfn>
@@ -1242,40 +1247,45 @@ urlPrefix: https://wicg.github.io/navigation-api/; type: interface;
12421247

12431248
1. [=Skip the view transition=] |transition| with |reason|.
12441249

1245-
* If the promise was fulfilled, then:
1250+
* If the promise was fulfilled, then [=activate view transition|activate=] |transition|.
1251+
</div>
12461252

1247-
1. If |transition|'s [=ViewTransition/phase=] is "`done`", then return.
1253+
<div algorithm>
1254+
To <dfn>activate view transition</dfn> for a {{ViewTransition}} |transition|,
1255+
perform the following steps:
12481256

1249-
Note: This happens if |transition| was [=skip the view transition|skipped=] before this point.
1257+
1. If |transition|'s [=ViewTransition/phase=] is "`done`", then return.
1258+
1259+
Note: This happens if |transition| was [=skip the view transition|skipped=] before this point.
12501260

1251-
1. If |transition|'s [=ViewTransition/initial snapshot containing block size=] is not equal to the [=snapshot containing block size=],
1252-
then [=skip the view transition=] for |transition|, and return.
1261+
1. Set [=document/rendering suppression for view transitions=] to false.
12531262

1254-
1. Set [=document/rendering suppression for view transitions=] to false.
1263+
1. If |transition|'s [=ViewTransition/initial snapshot containing block size=] is not equal to the [=snapshot containing block size=],
1264+
then [=skip the view transition=] for |transition|, and return.
12551265

1256-
1. [=Capture the new state=] for |transition|.
1266+
1. [=Capture the new state=] for |transition|.
12571267

1258-
If failure is returned, then [=skip the view transition=] for |transition| with an "{{InvalidStateError}}" {{DOMException}} in |transition|'s [=relevant Realm=],
1259-
and return.
1268+
If failure is returned, then [=skip the view transition=] for |transition| with an "{{InvalidStateError}}" {{DOMException}} in |transition|'s [=relevant Realm=],
1269+
and return.
12601270

1261-
1. [=list/For each=] |capturedElement| of |transition|'s [=ViewTransition/named elements=]' [=map/values=]:
1271+
1. [=list/For each=] |capturedElement| of |transition|'s [=ViewTransition/named elements=]' [=map/values=]:
12621272

1263-
1. If |capturedElement|'s [=captured element/new element=] is not null,
1264-
then set |capturedElement|'s [=captured element/new element=]'s [=captured in a view transition=] to true.
1273+
1. If |capturedElement|'s [=captured element/new element=] is not null,
1274+
then set |capturedElement|'s [=captured element/new element=]'s [=captured in a view transition=] to true.
12651275

1266-
1. [=Setup transition pseudo-elements=] for |transition|.
1276+
1. [=Setup transition pseudo-elements=] for |transition|.
12671277

1268-
1. [=Update pseudo-element styles=] for |transition|.
1278+
1. [=Update pseudo-element styles=] for |transition|.
12691279

1270-
If failure is returned, then [=skip the view transition=] for |transition| with an "{{InvalidStateError}}" {{DOMException}} in |transition|'s [=relevant Realm=],
1271-
and return.
1280+
If failure is returned, then [=skip the view transition=] for |transition| with an "{{InvalidStateError}}" {{DOMException}} in |transition|'s [=relevant Realm=],
1281+
and return.
12721282

1273-
Note: The above steps will require running document lifecycle phases,
1274-
to compute information calculated during style/layout.
1283+
Note: The above steps will require running document lifecycle phases,
1284+
to compute information calculated during style/layout.
12751285

1276-
1. Set |transition|'s [=ViewTransition/phase=] to "`animating`".
1286+
1. Set |transition|'s [=ViewTransition/phase=] to "`animating`".
12771287

1278-
1. [=Resolve=] |transition|'s [=ViewTransition/ready promise=].
1288+
1. [=Resolve=] |transition|'s [=ViewTransition/ready promise=].
12791289
</div>
12801290

12811291
### [=Capture the old state=] ### {#capture-old-state-algorithm}
@@ -1414,12 +1424,6 @@ urlPrefix: https://wicg.github.io/navigation-api/; type: interface;
14141424

14151425
1. Append |new| to |imagePair|.
14161426

1417-
The [=new element=] and its contents
1418-
(the flat tree descendants of the element, including both text and elements, or the replaced content of a replaced element),
1419-
except the |transition|'s [=ViewTransition/transition root pseudo-element=]'s [=tree/inclusive descendants=],
1420-
are not painted (as if they had ''visibility: hidden'')
1421-
and do not respond to hit-testing (as if they had pointer-events: none) until |new| exists.
1422-
14231427
1. If |capturedElement|'s [=captured element/old image=] is null, then:
14241428
1. [=Assert=]: |capturedElement|'s [=captured element/new element=] is not null.
14251429

@@ -1649,7 +1653,8 @@ urlPrefix: https://wicg.github.io/navigation-api/; type: interface;
16491653

16501654
Note: This transform is applied to the snapshot using the `transform` property of the associated ''::view-transition-group'' pseudo-element.
16511655

1652-
* Effects on the element, such as 'opacity' and 'filter' are applied to the capture.
1656+
* Effects applied on the element and its descendants, such as 'opacity' and 'filter', are applied to the capture.
1657+
Effects applied to the element from its ancestors are ignored.
16531658

16541659
* Implementations may clip the rendered contents if the [=ink overflow rectangle=] exceeds some [=implementation-defined=] maximum.
16551660
However, the captured image should include, at the very least, the contents of |element| that intersect with the [=snapshot containing block=].

0 commit comments

Comments
 (0)