Skip to content

[css-view-transitions-2] Update the algorithm to check opt-in on outbound transition #10078

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 2 commits into from
Mar 15, 2024

Conversation

noamr
Copy link
Collaborator

@noamr noamr commented Mar 14, 2024

Instead of relying on the source snapshot params in HTML, we update a flag every time something relevant changes, and HTML can read that flag.

[css-spec-shortname-1] Brief description which should also include the #issuenum-or-URL and/or link to relevant CSSWG minutes.

Copy the above line into the Title and replace with the relevant details. Fill in any additional details here. See https://github.com/w3c/csswg-drafts/blob/master/CONTRIBUTING.md for more info.

@noamr noamr requested a review from khushalsagar March 14, 2024 12:15
@noamr
Copy link
Collaborator Author

noamr commented Mar 14, 2024

This is required for whatwg/html#10178

…ound transition

Instead of relying on the source snapshot params in HTML, we update a flag
every time something relevant changes, and HTML can read that flag.
@@ -450,6 +450,11 @@ Note: as per default behavior, the ''@view-transition'' rule can be nested insid
Note: the [=@view-transition/type=] descriptor only applies to the {{Document}} in which it is defined.
The author is responsible for using their chosen set of types in both documents.

## Responding to changes in the ''@view-transition'' rule ## {#respond-to-rule-changes}

When the ''@view-transition'' rule changes for {{Document}} |document|, [=update the opt-in state for outbound transitions=] given |document|.
Copy link
Member

Choose a reason for hiding this comment

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

Should we leave a note here to the effect of, "The UA is responsible for deciding when style resolution is executed to keep the opt-in state in sync with style mutations".

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don't think that's necessary.

@@ -736,6 +747,10 @@ Prepend this to the [=Perform pending transition operations=] algorithm given a

1. [=Assert=]: |document| is [=fully active=].

1. [=Assert=]: |document| [=has been revealed=] is true.
Copy link
Member

Choose a reason for hiding this comment

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

Do we still need to export this algorithm? It looks like for the new Document we're calling it within this spec in "resolve cross-document view-transition" and html should now use the can initiate outbound view transition bit.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Export which algorithm?

Copy link
Member

Choose a reason for hiding this comment

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

"resolve cross-document view-transition" shouldn't need to be visible outside this spec now. Can fix after the html rewrite lands.

Copy link
Collaborator Author

@noamr noamr Mar 14, 2024

Choose a reason for hiding this comment

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

It's still called from page reveal, that's not changed here

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

What we don't need is "Resolve @view-transition rule", it's already not exported.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I renamed it, I think it's clearer now

@@ -736,6 +747,10 @@ Prepend this to the [=Perform pending transition operations=] algorithm given a

1. [=Assert=]: |document| is [=fully active=].

1. [=Assert=]: |document| [=has been revealed=] is true.
Copy link
Member

Choose a reason for hiding this comment

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

"resolve cross-document view-transition" shouldn't need to be visible outside this spec now. Can fix after the html rewrite lands.

domenic pushed a commit to whatwg/html that referenced this pull request Mar 15, 2024
This refactors the cross-document deactivation part of the navigation algorithm to use fewer closures and instead a couple of top-level algorithms.

It also fixes an issue where the incorrect document was being checked for the view transitions opt-in. This integrates with the new View Transitions hook being introduced in w3c/csswg-drafts#10078.
@noamr noamr merged commit 3ec9eb1 into w3c:main Mar 15, 2024
rubberyuzu pushed a commit to rubberyuzu/html that referenced this pull request Mar 21, 2024
This refactors the cross-document deactivation part of the navigation algorithm to use fewer closures and instead a couple of top-level algorithms.

It also fixes an issue where the incorrect document was being checked for the view transitions opt-in. This integrates with the new View Transitions hook being introduced in w3c/csswg-drafts#10078.
lozy219 pushed a commit to lozy219/html that referenced this pull request Mar 10, 2025
This refactors the cross-document deactivation part of the navigation algorithm to use fewer closures and instead a couple of top-level algorithms.

It also fixes an issue where the incorrect document was being checked for the view transitions opt-in. This integrates with the new View Transitions hook being introduced in w3c/csswg-drafts#10078.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants