Skip to content

[css-view-transitions-1] A few clarifications and nits #9028

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jul 12, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Fix refs and split 'activate'
  • Loading branch information
noamr committed Jul 4, 2023
commit ab2eda938fffe6ff2c017c36b273f6bfc51ee1eb
50 changes: 28 additions & 22 deletions css-view-transitions-1/Overview.bs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ spec:css-display-3; type:dfn;
spec:css-cascade-5; type:dfn; text:computed value
spec:css22; type:dfn; text:element
spec:css-break-4; type:dfn; text:fragment
spec:css-viewport; type:dfn; text:interactive-widget;
</pre>

<pre class=anchors>
Expand Down Expand Up @@ -530,7 +531,7 @@ urlPrefix: https://wicg.github.io/navigation-api/; type: interface;

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

Expand Down Expand Up @@ -776,7 +777,7 @@ urlPrefix: https://wicg.github.io/navigation-api/; type: interface;
The ''::view-transition'' pseudo-element generates a new stacking context,
called the <dfn>view transition layer</dfn>,
which paints after all other content of the document
(including any content rendered in the [=top layer=] [[!FULLSCREEN]]),
(including any content rendered in the [=Document/top layer=]),
after any filters and effects that are applied to such content.
(It is not subject to such filters or effects,
except insofar as they affect the rendered contents
Expand Down Expand Up @@ -1242,40 +1243,45 @@ urlPrefix: https://wicg.github.io/navigation-api/; type: interface;

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

* If the promise was fulfilled, then:
* If the promise was fulfilled, then [=activate view transition|activate=] |transition|.
</div>

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

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

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

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

1. Set [=document/rendering suppression for view transitions=] to false.
1. Set [=document/rendering suppression for view transitions=] to false.

1. [=Capture the new state=] for |transition|.
1. [=Capture the new state=] for |transition|.

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

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

1. If |capturedElement|'s [=captured element/new element=] is not null,
then set |capturedElement|'s [=captured element/new element=]'s [=captured in a view transition=] to true.
1. If |capturedElement|'s [=captured element/new element=] is not null,
then set |capturedElement|'s [=captured element/new element=]'s [=captured in a view transition=] to true.

1. [=Setup transition pseudo-elements=] for |transition|.
1. [=Setup transition pseudo-elements=] for |transition|.

1. [=Update pseudo-element styles=] for |transition|.
1. [=Update pseudo-element styles=] for |transition|.

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

Note: The above steps will require running document lifecycle phases,
to compute information calculated during style/layout.
Note: The above steps will require running document lifecycle phases,
to compute information calculated during style/layout.

1. Set |transition|'s [=ViewTransition/phase=] to "`animating`".
1. Set |transition|'s [=ViewTransition/phase=] to "`animating`".

1. [=Resolve=] |transition|'s [=ViewTransition/ready promise=].
1. [=Resolve=] |transition|'s [=ViewTransition/ready promise=].
</div>

### [=Capture the old state=] ### {#capture-old-state-algorithm}
Expand Down