-
Notifications
You must be signed in to change notification settings - Fork 756
[css-view-transitions-2] Allow transitions when traversing into a document that was created using cross-origin redirects #11070
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
Conversation
…ument that was created using cross-origin redirects This restriction only makes sense for the initial navigation, not for traversal. Closes w3c#11063
css-view-transitions-2/Overview.bs
Outdated
|
|
||
| 1. If |newDocument| [=was created via cross-origin redirects=], then return false. | ||
|
|
||
| 1. If |navigationType| is {{NavigationType/traverse}}, then return true. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it's a non-BFCache traverse navigation, then the cross-origin restriction should still apply. It's no different from a push navigation then.
That said, we might have been overly conservative limiting navigations with cross-origin redirects. I don't quite remember the rationale other than "there could be an information leak and it's a rare use-case". So also happy to re-open that conversation if you'd like.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does the HTML spec's wording for the page swap event work here? https://html.spec.whatwg.org/multipage/browsing-the-web.html#updating-the-traversable:latest-entry
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I was thinking the same. Amended the PR
…ld succeed even if the Document was created with a cross-origin redirect. https://bugs.webkit.org/show_bug.cgi?id=282012 <rdar://138517027> Reviewed by Charlie Wolfe. As per https://html.spec.whatwg.org/multipage/browsing-the-web.html#updating-the-traversable:latest-entry, the cross-origin redirect check should only apply if not loading from BFCache. I'm also changing the view-transitions logic, which isn't currently in the spec, but is drafted here: w3c/csswg-drafts#11070. Without this change, navigating to a site via a cross-origin redirect marks the initial Document as having being created with a cross-origin redirect. If you then navigate within the site, and then back to the initial, the view transition is blocked due to this despite the redirect being unrelated to the 'back' traversal. * LayoutTests/http/wpt/css/css-view-transitions/navigation/cross-origin-bfcache-expected.txt: Added. * LayoutTests/http/wpt/css/css-view-transitions/navigation/cross-origin-bfcache.html: Added. * Source/WebCore/loader/DocumentLoader.cpp: (WebCore::DocumentLoader::navigationCanTriggerCrossDocumentViewTransition): * Source/WebCore/loader/DocumentLoader.h: * Source/WebCore/loader/FrameLoader.cpp: (WebCore::FrameLoader::commitProvisionalLoad): * Source/WebCore/page/Navigation.cpp: (WebCore::Navigation::createForPageswapEvent): * Source/WebCore/page/Navigation.h: Canonical link: https://commits.webkit.org/285663@main
[css-view-transitions-2] Traversal navigations to a cached entry should succeed even if the Document was created with a cross-origin redirect.
https://bugs.webkit.org/show_bug.cgi?id=282012
<rdar://138517027>
Reviewed by Charlie Wolfe.
As per
https://html.spec.whatwg.org/multipage/browsing-the-web.html#updating-the-traversable:latest-entry,
the cross-origin redirect check should only apply if not loading from BFCache.
I'm also changing the view-transitions logic, which isn't currently in the spec,
but is drafted here: w3c/csswg-drafts#11070.
Without this change, navigating to a site via a cross-origin redirect marks the
initial Document as having being created with a cross-origin redirect. If you
then navigate within the site, and then back to the initial, the view
transition is blocked due to this despite the redirect being unrelated to the
'back' traversal.
* LayoutTests/http/wpt/css/css-view-transitions/navigation/cross-origin-bfcache-expected.txt: Added.
* LayoutTests/http/wpt/css/css-view-transitions/navigation/cross-origin-bfcache.html: Added.
* Source/WebCore/loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::navigationCanTriggerCrossDocumentViewTransition):
* Source/WebCore/loader/DocumentLoader.h:
* Source/WebCore/loader/FrameLoader.cpp:
(WebCore::FrameLoader::commitProvisionalLoad):
* Source/WebCore/page/Navigation.cpp:
(WebCore::Navigation::createForPageswapEvent):
* Source/WebCore/page/Navigation.h:
Canonical link: https://commits.webkit.org/285663@main
Canonical link: https://commits.webkit.org/283286.371@safari-7620-branch
This restriction only makes sense for the initial navigation, not for traversal.
Closes #11063
[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.