Skip to content

Commit 4470c90

Browse files
committed
Rename snapshot-root to snapshot containing block
Also determine that the snapshot CB is an absolute/fixed positioning containing block for its descendants. Closes #8505
1 parent e7eb9e2 commit 4470c90

File tree

1 file changed

+29
-26
lines changed

1 file changed

+29
-26
lines changed

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

+29-26
Original file line numberDiff line numberDiff line change
@@ -627,20 +627,23 @@ urlPrefix: https://wicg.github.io/navigation-api/; type: interface;
627627
a [=pseudo-element root=].
628628
Its [=originating element=] is the document's [=document element=].
629629

630-
Its [=containing block=] is the [=snapshot root=].
630+
Its [=containing block=] is the [=snapshot containing block=].
631+
632+
The [=snapshot containing block=] is considered to be an [=absolute positioning containing block=]
633+
and a [=fixed positioning containing block=] for ''::view-transition'' and its descendants.
631634

632635
The following is added to the [=global view transition user agent style sheet=]:
633636

634637
```css
635638
:root::view-transition {
636-
position: fixed;
639+
position: absolute;
637640
inset: 0;
638641
}
639642
```
640643

641644
<div class="note">
642-
The aim of the style is to size the pseudo-element to cover the [=snapshot root=]
643-
and position all ''::view-transition-group()'' pseudo-elements relative to the [=snapshot root origin=].
645+
The aim of the style is to size the pseudo-element to cover the [=snapshot containing block=]
646+
and position all ''::view-transition-group()'' pseudo-elements relative to the [=snapshot containing block origin=].
644647
</div>
645648

646649
### <dfn>::view-transition-group( <<pt-name-selector>> )</dfn> ### {#::view-transition-group}
@@ -782,39 +785,39 @@ urlPrefix: https://wicg.github.io/navigation-api/; type: interface;
782785

783786
The initial phase is the first item in the sequence.
784787

785-
## The snapshot root ## {#snapshot-root-concept}
788+
## The snapshot containing block ## {#snapshot-root-concept}
786789

787-
The <dfn>snapshot root</dfn> is a rectangle that covers all areas of the window that could potentially display web content.
790+
The <dfn>snapshot containing block</dfn> is a rectangle that covers all areas of the window that could potentially display web content.
788791
This area is consistent regardless of root scrollbars or interactive widgets.
789792

790793
Issue: "Interactive widgets" refers to UI described within a property definition in [[css-viewport#interactive-widget-section]].
791794
This should be extracted into an exported definition that can be used independently of the property.
792795

793796
<figure>
794797
<img src="diagrams/phone-browser.svg" width="200" height="335" alt="A diagram of a phone screen, including a top status bar, a browser URL bar, web-content area with a floating scrollbar, a virtual keyboard, and a bottom bar with an OS back button">
795-
<img src="diagrams/phone-browser-snapshot-root.svg" width="200" height="335" alt="The previous diagram, but highlights the area that's the 'snapshot root', which includes everything except the top status bar and the bottom bar with the OS back button">
798+
<img src="diagrams/phone-browser-snapshot-root.svg" width="200" height="335" alt="The previous diagram, but highlights the area that's the 'snapshot containing block', which includes everything except the top status bar and the bottom bar with the OS back button">
796799
<figcaption>
797-
An example of the [=snapshot root=] on a mobile OS.
800+
An example of the [=snapshot containing block=] on a mobile OS.
798801
The snapshot includes the URL bar, as this can be scrolled away.
799802
The keyboard is included as this appears and disappears.
800-
The top and bottom bars are part of the OS rather than the browser, so they're not included in the snapshot root.
803+
The top and bottom bars are part of the OS rather than the browser, so they're not included in the snapshot containing block.
801804
</figcaption>
802805
</figure>
803806

804807
<figure>
805808
<img src="diagrams/desktop-browser.svg" width="132" height="79" alt="A diagram of a desktop browser window, including a tab bar, a URL bar, and a web-content area featuring both horizontal and vertical scrollbars" style="height:auto; width: 600px">
806-
<img src="diagrams/desktop-browser-snapshot-root.svg" width="132" height="79" alt="The previous diagram, but highlights the area that's the 'snapshot root', which includes the web content area and the scrollbars" style="height:auto; width: 600px">
809+
<img src="diagrams/desktop-browser-snapshot-root.svg" width="132" height="79" alt="The previous diagram, but highlights the area that's the 'snapshot containing block', which includes the web content area and the scrollbars" style="height:auto; width: 600px">
807810
<figcaption>
808-
An example of the [=snapshot root=] on a desktop OS.
811+
An example of the [=snapshot containing block=] on a desktop OS.
809812
This includes the scrollbars, but does not include the URL bar, as web content never appears in that area.
810813
</figcaption>
811814
</figure>
812815

813816
This means the snapshot canvas size is likely to be consistent for the [=document element=]'s [=captured element/old image=] and [=captured element/new element=].
814817

815-
The <dfn>snapshot root origin</dfn> refers to the top-left corner of the [=snapshot root=].
818+
The <dfn>snapshot containing block origin</dfn> refers to the top-left corner of the [=snapshot containing block=].
816819

817-
The <dfn>snapshot root size</dfn> refers to the width and height of the [=snapshot root=] as a [=/tuple=] of two numbers.
820+
The <dfn>snapshot containing block size</dfn> refers to the width and height of the [=snapshot containing block=] as a [=/tuple=] of two numbers.
818821

819822
## The [=view-transition layer=] stacking layer ## {#view-transition-stacking-layer}
820823

@@ -908,7 +911,7 @@ urlPrefix: https://wicg.github.io/navigation-api/; type: interface;
908911
When this is true, [=this=]'s [=active view transition=]'s [=ViewTransition/transition root pseudo-element=] renders as a child of [=this=]'s [=document element=],
909912
and [=this=]'s [=document element=] is its [=originating element=].
910913

911-
Note: The position of the [=ViewTransition/transition root pseudo-element=] within the [=document element=] does not matter, as the [=ViewTransition/transition root pseudo-element=]'s [=containing block=] is the [=snapshot root=].
914+
Note: The position of the [=ViewTransition/transition root pseudo-element=] within the [=document element=] does not matter, as the [=ViewTransition/transition root pseudo-element=]'s [=containing block=] is the [=snapshot containing block=].
912915
</dl>
913916

914917
# API # {#api}
@@ -1064,11 +1067,11 @@ urlPrefix: https://wicg.github.io/navigation-api/; type: interface;
10641067
:: a ''::view-transition''.
10651068
Initially a new ''::view-transition''.
10661069

1067-
: <dfn>initial snapshot root size</dfn>
1070+
: <dfn>initial snapshot containing block size</dfn>
10681071
:: a [=tuple=] of two numbers (width and height), or null.
10691072
Initially null.
10701073

1071-
Note: This is used to detect changes in the [=snapshot root size=],
1074+
Note: This is used to detect changes in the [=snapshot containing block size=],
10721075
which causes the transition to [=skip the view transition|skip=].
10731076
[Discussion of this behavior](https://github.com/w3c/csswg-drafts/issues/8045).
10741077
</dl>
@@ -1189,7 +1192,7 @@ urlPrefix: https://wicg.github.io/navigation-api/; type: interface;
11891192

11901193
Note: This happens if |transition| was [=skip the view transition|skipped=] before this point.
11911194

1192-
1. If |transition|'s [=ViewTransition/initial snapshot root size=] is not equal to the [=snapshot root size=],
1195+
1. If |transition|'s [=ViewTransition/initial snapshot containing block size=] is not equal to the [=snapshot containing block size=],
11931196
then [=skip the view transition=] for |transition|, and return.
11941197

11951198
1. Set [=document/transition suppressing rendering=] to false.
@@ -1232,7 +1235,7 @@ urlPrefix: https://wicg.github.io/navigation-api/; type: interface;
12321235

12331236
1. Let |document| be |transition|'s [=relevant global object's=] [=associated document=].
12341237

1235-
1. Set |transition|'s [=ViewTransition/initial snapshot root size=] to the [=snapshot root size=].
1238+
1. Set |transition|'s [=ViewTransition/initial snapshot containing block size=] to the [=snapshot containing block size=].
12361239

12371240
1. [=list/For each=] |element| of every [=/element=] that is [=/connected=],
12381241
and has a [=node document=] equal to to |document|,
@@ -1267,12 +1270,12 @@ urlPrefix: https://wicg.github.io/navigation-api/; type: interface;
12671270

12681271
: 'transform'
12691272
:: A transform that would map |element|'s [=border box=] from
1270-
the [=snapshot root origin=] to its current visual position.
1273+
the [=snapshot containing block origin=] to its current visual position.
12711274
:: This value is identity for the [=document element=].
12721275

12731276
: 'width'
12741277
: 'height'
1275-
:: The size of the [=snapshot root=] if |element| is the [=document element=],
1278+
:: The size of the [=snapshot containing block=] if |element| is the [=document element=],
12761279
otherwise, the width and height of |element|'s border box.
12771280

12781281
: 'object-view-box'
@@ -1531,8 +1534,8 @@ urlPrefix: https://wicg.github.io/navigation-api/; type: interface;
15311534

15321535
1. If |element| is the [=document element=], then:
15331536

1534-
1. Render the region of the |element| and the [=top layer=] that intersects the [=snapshot root=],
1535-
on a transparent canvas the size of the [=snapshot root=],
1537+
1. Render the region of the |element| and the [=top layer=] that intersects the [=snapshot containing block=],
1538+
on a transparent canvas the size of the [=snapshot containing block=],
15361539
following the [=capture rendering characteristics=], and these additional characteristics:
15371540

15381541
- Areas outside |element|'s [=scrolling box=] should be rendered as if they were scrolled to, without moving or resizing the [=layout viewport=].
@@ -1560,7 +1563,7 @@ urlPrefix: https://wicg.github.io/navigation-api/; type: interface;
15601563
</figure>
15611564

15621565
1. Return the canvas as an image.
1563-
The natural size of the image is equal to the [=snapshot root=].
1566+
The natural size of the image is equal to the [=snapshot containing block=].
15641567

15651568
1. Otherwise:
15661569

@@ -1655,7 +1658,7 @@ urlPrefix: https://wicg.github.io/navigation-api/; type: interface;
16551658

16561659
1. Return.
16571660

1658-
1. If |transition|'s [=ViewTransition/initial snapshot root size=] is not equal to the [=snapshot root size=],
1661+
1. If |transition|'s [=ViewTransition/initial snapshot containing block size=] is not equal to the [=snapshot containing block size=],
16591662
then [=skip the view transition=] for |transition|, and return.
16601663

16611664
1. [=Update pseudo-element styles=] for |transition|.
@@ -1702,7 +1705,7 @@ urlPrefix: https://wicg.github.io/navigation-api/; type: interface;
17021705

17031706
1. Set |height| to the current height of |capturedElement|'s [=new element=]'s [=border box=].
17041707

1705-
1. Set |transform| to a transform that would map |capturedElement|'s [=new element=]'s [=border box=] from the [=snapshot root origin=] to its current visual position.
1708+
1. Set |transform| to a transform that would map |capturedElement|'s [=new element=]'s [=border box=] from the [=snapshot containing block origin=] to its current visual position.
17061709

17071710
1. Set |writingMode| to the [=computed value=] of 'writing-mode' on |capturedElement|'s [=new element=].
17081711

@@ -1804,7 +1807,7 @@ Changes from <a href="https://www.w3.org/TR/2022/WD-css-view-transitions-1-20221
18041807
* Add rendering constraints to elements participating in a transition. See <a href="https://github.com/w3c/csswg-drafts/issues/8139">issue 8139</a> and <a href="https://github.com/w3c/csswg-drafts/issues/7882">issue 7882</a>.
18051808
* Remove html specifics from UA stylesheet to support ViewTransitions on SVG Documents.
18061809
* Rename updateDOMCallback to {{UpdateCallback}}. See <a href="https://github.com/w3c/csswg-drafts/issues/8144">issue 8144</a>.
1807-
* Rename snapshot viewport to [=snapshot root=].
1810+
* Rename snapshot viewport to [=snapshot containing block=].
18081811
* Skip the transition if viewport size changes. See <a href="https://github.com/w3c/csswg-drafts/issues/8045">issue 8045</a>.
18091812
* Add support for :only-child. See <a href="https://github.com/w3c/csswg-drafts/issues/8057">issue 8057</a>.
18101813
* Add concept of a tree of pseudo-elements under [=pseudo-element root=]. See <a href="https://github.com/w3c/csswg-drafts/issues/8113">issue 8113</a>.

0 commit comments

Comments
 (0)