[wpt-sync] Sync PR 23516 - Fix module script referrer port
Categories
(Core :: DOM: Core & HTML, task, P4)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox78 | --- | fixed |
People
(Reporter: wpt-sync, Unassigned)
References
()
Details
(Whiteboard: [wptsync downstream])
Sync web-platform-tests PR 23516 into mozilla-central (this bug is closed when the sync is complete).
PR: https://github.com/web-platform-tests/wpt/pull/23516
Details from upstream follow.
Dominic Farolino <domfarolino@gmail.com> wrote:
Fix module script referrer port
The
origin-when-cross-originmodule script descendant test requires maintaining a variableremoteOrigin, whose value is the "cross-origin" origin that we're using to host remote-origin scripts for the test. It is initialized as:const remoteOrigin = "http://{{domains[www1]}}:{{ports[http][0]}}/";
The problematic bit is
ports[http][0]. When running this locally, it is not port80, so tests such as this one report a referrer with a non-80port, and the comparison works.However on sites like
wpt.live, this test seems to fail (in Chrome, whose implementation is spec-conformant, and obviously in any browser that isn't). It is becausereferrerOrigincontains the port number:80, but the generatedRefererfrom the browser never contains the port number:80if that's where the site is hosted. There are two solutions:
- Definitely use a non-
80port-number (which is what this PR does)- Detect if
{{ports[http][0]}} == 80, and strip the:80fromreferrerOrigin
- This seemed complex, so I didn't do it
Anne, do you know why browsers do not include
:80in theReferer? I couldn't find it from an admittedly cursory search through Fetch and Referrer Policy.
| Assignee | ||
Updated•6 years ago
|
| Assignee | ||
Comment 1•6 years ago
|
||
| Assignee | ||
Comment 2•6 years ago
|
||
CI Results
Ran 0 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI
Total 1 tests and 6 subtests
Status Summary
Firefox
OK : 1
PASS: 4
FAIL: 2
Chrome
OK : 1
PASS: 6
Safari
OK : 1
PASS: 3
FAIL: 3
Links
Details
New Tests That Don't Pass
/html/semantics/scripting-1/the-script-element/module/referrer-origin-when-cross-origin.sub.html
Importing a remote-origin descendant script from a remote-origin top-level script with the origin-when-cross-origin policy.: FAIL (Chrome: PASS, Safari: FAIL)
Importing a same-origin descendant script from a remote-origin top-level script with the origin-when-cross-origin policy.: FAIL (Chrome: PASS, Safari: FAIL)
Comment 5•6 years ago
|
||
| bugherder | ||
Description
•