Repository navigation
Conversation
The reload case in document-state.https.html asserts Sec-Fetch-Site before the referrer, so engines failing that check never report the referrer result. This adds referrer-only coverage for cross-site and same-origin navigations, checking both the Referer header and document.referrer.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
After an A -> B navigation,
location.reload()on B should reuse the referrer stored in B's document state by that navigation, not compute a new one from B's own URL.Spec: reload reuses the document state's request referrer (whatwg/html#6315).
Why a new test
html/browsers/browsing-the-web/history-traversal/document-state.https.htmlhas alocation.reload()case that checks the referrer, but it assertsSec-Fetch-Sitefirst. Engines that fail that assertion never report the referrer result, so the referrer behaviour isn't visible on wpt.fyi for them. This test checks the referrer only.Coverage
html/browsers/history/the-location-interface/location_reload-referrer.https.html, four subtests:HTTPS_NOTSAMESITE_ORIGIN)Refererrequest headerdocument.referrerRefererrequest headerdocument.referrerIt uses
RemoteContextHelper, the same harness asdocument-state.https.html. Each subtest asserts the referrer on the original A -> B navigation as a precondition before reloading, so a failure points at the reload rather than the setup.It uses a long timeout because it opens and reloads a window for each scenario, which took about 12s on Firefox Nightly in CI.
Results
From this PR's CI runs:
In Chrome and Safari the preconditions pass, and the reload reports B's own URL as the referrer.
./wpt lintis clean.Related bugs