Skip to content
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

[css-view-transitions-1] Export an algorithm to skip a transition in a hidden document #9949

Merged
merged 3 commits into from
Feb 14, 2024
Merged
Changes from 2 commits
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
12 changes: 12 additions & 0 deletions css-view-transitions-1/Overview.bs
Original file line number Diff line number Diff line change
Expand Up @@ -1662,6 +1662,17 @@ urlPrefix: https://wicg.github.io/navigation-api/; type: interface;
then |transition|'s [=ViewTransition/finished promise=] will reject with the same reason.
</div>

## View transition page-visibility change steps ## {#page-visibility-change-steps}
<div algorithm>
The <dfn export>view transition page-visibility change steps</dfn> given {{Document}} |document| are:

1. If |document|'s [=Document/visibility state=] is "<code>hidden</code>",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With my code hat on, should we also assert that if the visibility state change is "visible" then there is no active-view-transition. :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added an assert.

and |document|'s [=active view transition=] is not null,
then [=skip the view transition|skip=] |document|'s [=active view transition=].

Note: this is called from the HTML spec.
</div>

## [=Capture the image=] ## {#capture-the-image-algorithm}

<div algorithm>
Expand Down Expand Up @@ -1939,6 +1950,7 @@ Changes from <a href="https://www.w3.org/TR/2023/WD-css-view-transitions-1-20230
* Add animation-delay inherit to UA stylesheet rules for (::view-transition) -image-pair, -old, and -new. See <a href="https://github.com/w3c/csswg-drafts/issues/9817">issue 9817</a>.
* Auto-skip animation when document is hidden. See <a href="https://github.com/w3c/csswg-drafts/issues/9543">issue 9543</a>.
* Remove references to cross-document view-transitions, to keep the L1 spec clean. See <a href="https://github.com/w3c/csswg-drafts/issues/9886">Issue 9886</a>.
* Export an algorithm to skip the active transition when the page is hidden. See <a href="https://github.com/w3c/csswg-drafts/issues/9543">issue 9543</a>.

<h3 id="changes-since-2022-05-25">
Changes from <a href="https://www.w3.org/TR/2023/WD-css-view-transitions-1-20230525/">2022-05-25 Working Draft</a>
Expand Down