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

Add location.reload() document state test #39878

Merged
merged 1 commit into from
May 18, 2023

Conversation

chromium-wpt-export-bot
Copy link
Collaborator

@chromium-wpt-export-bot chromium-wpt-export-bot commented May 6, 2023

This CL is a follow-up to https://crrev.com/c/3936785 and
whatwg/html#6813 (comment). It
adds a test asserting the document state preservation as described more
below, in the location.reload() case, alongside a very similar test
that asserts the same for the document repopulation case.

The HTML Standard specifies the behavior of location.reload() to
preserve the existing history entry's document state's initiator origin
and referrer, as described in:
https://html.spec.whatwg.org/multipage/browsing-the-web.html#apply-the-history-step:~:text=If%20targetEntry%27s%20document%20is%20null%2C%20or%20targetEntry%27s%20document%20state%27s%20reload%20pending%20is%20true%2C%20then.

This means that when a page is navigated to from a cross-origin
predecessor, and then location.reload()s itself, Sec-Fetch-Site
should be cross-site and the Referer header should remain the same
as the original navigation.

Chromium currently fails this test, per
whatwg/html#6813 (comment) and
the code pointer described by that comment.

R=[email protected]

Bug: N/A
Change-Id: I868ac9fad7e63df251d6c4b0d0ac8b099b81d25b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4504799
Commit-Queue: Domenic Denicola <[email protected]>
Auto-Submit: Dominic Farolino <[email protected]>
Reviewed-by: Domenic Denicola <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1145759}

Copy link
Collaborator

@wpt-pr-bot wpt-pr-bot left a comment

Choose a reason for hiding this comment

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

The review process for this patch is being conducted in the Chromium project.

@chromium-wpt-export-bot chromium-wpt-export-bot force-pushed the chromium-export-cl-4504799 branch 2 times, most recently from 21e2129 to aeeb64d Compare May 17, 2023 19:47
This CL is a follow-up to https://crrev.com/c/3936785 and
whatwg/html#6813 (comment). It
adds a test asserting the document state preservation as described more
below, in the `location.reload()` case, alongside a very similar test
that asserts the same for the document repopulation case.

The HTML Standard specifies the behavior of `location.reload()` to
preserve the existing history entry's document state's initiator origin
and referrer, as described in:
https://html.spec.whatwg.org/multipage/browsing-the-web.html#apply-the-history-step:~:text=If%20targetEntry%27s%20document%20is%20null%2C%20or%20targetEntry%27s%20document%20state%27s%20reload%20pending%20is%20true%2C%20then.

This means that when a page is navigated to from a cross-origin
predecessor, and then `location.reload()`s itself, `Sec-Fetch-Site`
should be `cross-site` and the `Referer` header should remain the same
as the original navigation.

Chromium currently fails this test, per
whatwg/html#6813 (comment) and
the code pointer described by that comment.

[email protected]

Bug: N/A
Change-Id: I868ac9fad7e63df251d6c4b0d0ac8b099b81d25b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4504799
Commit-Queue: Domenic Denicola <[email protected]>
Auto-Submit: Dominic Farolino <[email protected]>
Reviewed-by: Domenic Denicola <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1145759}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants