Skip to content

Commit 754f7fd

Browse files
[css-view-transitions-2] Add scoped layout section and update UA stylesheet. (#13408)
* Add scoped layout section and update UA stylesheet.
1 parent 4984208 commit 754f7fd

File tree

1 file changed

+39
-13
lines changed

1 file changed

+39
-13
lines changed

‎css-view-transitions-2/Overview.bs‎

Lines changed: 39 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1328,6 +1328,29 @@ ISSUE: `::view-transition-group-children()` needs to be specified here.
13281328
Similarly, hit-testing is skipped because the element's DOM location does not correspond to where its contents are rendered.
13291329
However, there is no change in how these elements are accessed by assistive technologies or the accessibility tree.
13301330

1331+
## Scoped View Transition Layout ## {#scoped-view-transition-layout}
1332+
1333+
For a [=scoped view transition=], the ''::view-transition'' pseudo-element
1334+
is a child of the [=ViewTransition/root element=] in the [=box tree=], but
1335+
with some behaviors that are different from ordinary children:
1336+
1337+
* The ''::view-transition'' pseudo-element generates a stacking context
1338+
which paints separately from, and on top of, the painting of the
1339+
[=ViewTransition/root element=] and its other children.
1340+
1341+
Note: A consequence of painting separately is that properties on the root element
1342+
that affect the way the root element is painted, such as 'opacity', do not apply
1343+
to the ''::view-transition'' pseudo-element. However, if the root element is captured
1344+
in a ''::view-transition-group'' for its own transition, such properties
1345+
will be reflected in the captured image.
1346+
1347+
* If the [=ViewTransition/root element=] has a [=scrolling box=], the
1348+
''::view-transition'' pseudo-element is not translated by the scroll position
1349+
of the [=ViewTransition/root element=].
1350+
1351+
* If the [=ViewTransition/root element=] clips its [=overflow=], the
1352+
''::view-transition'' pseudo-element is exempted from that clip.
1353+
13311354

13321355
# User Agent Stylesheet # {#ua-styles}
13331356

@@ -1339,12 +1362,12 @@ ISSUE: `::view-transition-group-children()` needs to be specified here.
13391362
view-transition-name: root;
13401363
}
13411364

1342-
:root::view-transition {
1343-
position: fixed;
1365+
::view-transition {
1366+
position: absolute;
13441367
inset: 0;
13451368
}
13461369

1347-
:root::view-transition-group(*) {
1370+
::view-transition-group(*) {
13481371
position: absolute;
13491372
top: 0;
13501373
left: 0;
@@ -1353,22 +1376,23 @@ ISSUE: `::view-transition-group-children()` needs to be specified here.
13531376
animation-fill-mode: both;
13541377
}
13551378

1356-
:root::view-transition-image-pair(*) {
1379+
::view-transition-image-pair(*) {
13571380
position: absolute;
13581381
inset: 0;
13591382
}
13601383

1361-
:root::view-transition-old(*),
1362-
:root::view-transition-new(*) {
1384+
::view-transition-old(*),
1385+
::view-transition-new(*) {
13631386
position: absolute;
1387+
display: block;
13641388
inset-block-start: 0;
13651389
inline-size: 100%;
13661390
block-size: auto;
13671391
}
13681392

1369-
:root::view-transition-image-pair(*),
1370-
:root::view-transition-old(*),
1371-
:root::view-transition-new(*) {
1393+
::view-transition-image-pair(*),
1394+
::view-transition-old(*),
1395+
::view-transition-new(*) {
13721396
animation-duration: inherit;
13731397
animation-fill-mode: inherit;
13741398
animation-delay: inherit;
@@ -1378,7 +1402,7 @@ ISSUE: `::view-transition-group-children()` needs to be specified here.
13781402
animation-play-state: inherit;
13791403
}
13801404

1381-
:root::view-transition-group-children(*) {
1405+
::view-transition-group-children(*) {
13821406
position: absolute;
13831407
inset: 0;
13841408
border-style: solid;
@@ -1400,13 +1424,15 @@ ISSUE: `::view-transition-group-children()` needs to be specified here.
14001424
}
14011425
```
14021426

1403-
ISSUE: This needs to include scoped view transition styles as well.
1404-
14051427
<details class="note">
14061428
<summary>Explanatory Summary</summary>
14071429
This UA style sheet does several things:
1408-
* Lay out ''::view-transition'' to cover the entire [=snapshot containing block=]
1430+
* Lay out '':root::view-transition'' to cover the entire [=snapshot containing block=]
14091431
so that each '':view-transition-group()'' child can lay out relative to it.
1432+
Note: the placement of the [=snapshot containing block=] is similar to
1433+
`position: fixed`.
1434+
* For a [=scoped view transition=], lay out ''::view-transition'' to cover the
1435+
view transition [=ViewTransition/root element=].
14101436
* Give the [=/root element=] a default [=view transition name=],
14111437
to allow it to be independently selected.
14121438
* Reduce layout interference from the ''::view-transition-image-pair()'' pseudo-element

0 commit comments

Comments
 (0)