Skip to content

Commit c3dde2f

Browse files
[css-view-transitions-1] Skip transition if viewport changes. Fixes #8045 (#8306)
1 parent a35fb70 commit c3dde2f

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

css-view-transitions-1/Overview.bs

+18
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,8 @@ urlPrefix: https://html.spec.whatwg.org/multipage/rendering.html; type: dfn;
393393

394394
The <dfn>snapshot viewport origin</dfn> refers to the start of the block and inline axes of the [=snapshot viewport=].
395395

396+
The <dfn>snapshot viewport size</dfn> refers to the width and height of the [=snapshot viewport=] as a [=/tuple=] of two numbers.
397+
396398
## The [=view-transition layer=] stacking layer ## {#view-transition-stacking-layer}
397399

398400
This specification introduces a stacking layer to the [[CSS2#elaborate-stacking-contexts]].
@@ -637,6 +639,14 @@ urlPrefix: https://html.spec.whatwg.org/multipage/rendering.html; type: dfn;
637639
: <dfn>transition root pseudo-element</dfn>
638640
:: a ''::view-transition''.
639641
Initially a new ''::view-transition''.
642+
643+
: <dfn>initial snapshot viewport size</dfn>
644+
:: a [=tuple=] of two numbers (width and height), or null.
645+
Initially null.
646+
647+
Note: This is used to detect changes in the [=snapshot viewport size=],
648+
which causes the transition to [=skip the view transition|skip=].
649+
[Discussion of this behavior](https://github.com/w3c/csswg-drafts/issues/8045).
640650
</dl>
641651

642652
The {{ViewTransition/finished}} [=getter steps=] are to return [=this's=] [=ViewTransition/finished promise=].
@@ -713,6 +723,8 @@ urlPrefix: https://html.spec.whatwg.org/multipage/rendering.html; type: dfn;
713723

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

726+
1. Set |transition|'s [=ViewTransition/initial snapshot viewport size=] to the [=snapshot viewport size=].
727+
716728
1. [=list/For each=] |element| of every {{Element}} and [=pseudo-element=] connected to |document|,
717729
in [paint order](https://drafts.csswg.org/css2/#painting-order):
718730

@@ -806,6 +818,9 @@ urlPrefix: https://html.spec.whatwg.org/multipage/rendering.html; type: dfn;
806818

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

821+
1. If |transition|'s [=ViewTransition/initial snapshot viewport size=] is not equal to the [=snapshot viewport size=],
822+
then [=skip the view transition=] for |transition|, and return.
823+
809824
1. Set [=document/transition suppressing rendering=] to false.
810825

811826
1. Let |usedTransitionNames| be a new [=/set=] of strings.
@@ -1012,6 +1027,9 @@ urlPrefix: https://html.spec.whatwg.org/multipage/rendering.html; type: dfn;
10121027

10131028
1. Return.
10141029

1030+
1. If |transition|'s [=ViewTransition/initial snapshot viewport size=] is not equal to the [=snapshot viewport size=],
1031+
then [=skip the view transition=] for |transition|, and return.
1032+
10151033
1. [=Update pseudo-element styles=] for |transition|.
10161034

10171035
Note: The above implies that a change in incoming element's size or position will cause a new keyframe to be generated.

0 commit comments

Comments
 (0)