[wpt-sync] Sync PR 64021 - Skip inline-style CSP checks for DOMParser-created documents
Categories
(Testing :: web-platform-tests, task, P4)
Tracking
(firefox162 fixed)
| Tracking | Status | |
|---|---|---|
| firefox162 | --- | fixed |
People
(Reporter: wpt-sync, Unassigned)
References
()
Details
(Whiteboard: [wptsync downstream])
Sync web-platform-tests PR 64021 into mozilla-central (this bug is closed when the sync is complete).
PR: https://github.com/web-platform-tests/wpt/pull/64021
Details from upstream follow.
indura-perera-codimite <indura.perera@codimite.com> wrote:
Skip inline-style CSP checks for DOMParser-created documents
DOMParser.parseFromString() creates a Document with no browsing
context — it's never rendered or shown to the user. But style=""
attributes and \<style> elements parsed into it were still checked
against the calling page's CSP, so a page with a strict style-src
policy got a misleading "Refused to apply inline style" warning for
content nobody ever sees.This skips that check for DOMParser documents, using the existing
(and previously unused) Document::IsDOMParserDocument() flag — the
same idea Chromium already applies to inline event handlers, which
skip their CSP check when there's no browsing context.Fixed: 40731171
Change-Id: Ice3fdb454992679ea77236a3fd55666235a53821
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/8465902
Reviewed-by: Mike West \<mkwst@chromium.org>
Reviewed-by: Rune Lillesveen \<futhark@chromium.org>
Commit-Queue: Rune Lillesveen \<futhark@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1724859}
| Assignee | ||
Updated•1 month ago
|
| Assignee | ||
Updated•1 month ago
|
| Assignee | ||
Updated•1 month ago
|
| Assignee | ||
Updated•1 month ago
|
| Assignee | ||
Updated•1 month ago
|
| Assignee | ||
Updated•29 days ago
|
| Assignee | ||
Comment 1•29 days ago
|
||
Pushed to try (stability) https://treeherder.mozilla.org/jobs?repo=try&landoInstance=lando-prod-2025&landoCommitID=113668
| Assignee | ||
Comment 2•28 days ago
|
||
CI Results
Ran 9 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI
Total 33 tests and 5 subtests
Status Summary
Firefox
OK : 1[GitHub] 30[Gecko-windows11-64-25h2-debug] 31[Gecko-android-em-14-x86_64-debug-geckoview, Gecko-android-em-14-x86_64-lite-opt-geckoview, Gecko-android-em-14-x86_64-opt-geckoview, Gecko-linux2404-64-debug, Gecko-linux2404-64-opt, Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt, Gecko-windows11-64-25h2-opt]
PASS : 93[Gecko-windows11-64-25h2-debug] 97[Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt] 98[Gecko-android-em-14-x86_64-debug-geckoview, Gecko-android-em-14-x86_64-lite-opt-geckoview, Gecko-android-em-14-x86_64-opt-geckoview, Gecko-linux2404-64-debug, Gecko-linux2404-64-opt, Gecko-windows11-64-25h2-opt]
FAIL : 1[GitHub] 5[Gecko-android-em-14-x86_64-debug-geckoview, Gecko-android-em-14-x86_64-lite-opt-geckoview, Gecko-android-em-14-x86_64-opt-geckoview, Gecko-linux2404-64-debug, Gecko-linux2404-64-opt, Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt]
NOTRUN: 1
Chrome
OK : 1
PASS : 1
Safari
OK : 1
FAIL : 1
Links
Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base
Details
New Tests That Don't Pass
- /content-security-policy/generic/filesystem-urls-do-not-match-self.sub.html [wpt.fyi]:
SKIP - /content-security-policy/generic/domparser-document-suppresses-csp-warning-for-inline-style.tentative.html [wpt.fyi]
- DOMParser-parsed inline styles remain blocked by the calling page's CSP; only the console warning is suppressed:
FAIL(Chrome:PASS, Safari:FAIL)
- DOMParser-parsed inline styles remain blocked by the calling page's CSP; only the console warning is suppressed:
- /content-security-policy/generic/filesystem-urls-match-filesystem.sub.html [wpt.fyi]
- Expecting logs: ["PASS (1/1)"]:
NOTRUN
- Expecting logs: ["PASS (1/1)"]:
- /content-security-policy/generic/src-trailing-dot.sub.any.html [wpt.fyi]
- Fetch from host with trailing dot should be allowed by CSP.:
FAIL
- Fetch from host with trailing dot should be allowed by CSP.:
- /content-security-policy/generic/src-trailing-dot.sub.any.sharedworker.html [wpt.fyi]
- Fetch from host with trailing dot should be allowed by CSP.:
FAIL
- Fetch from host with trailing dot should be allowed by CSP.:
- /content-security-policy/generic/src-trailing-dot.sub.any.serviceworker.html [wpt.fyi]
- Fetch from host with trailing dot should be allowed by CSP.:
FAIL
- Fetch from host with trailing dot should be allowed by CSP.:
- /content-security-policy/generic/src-trailing-dot.sub.any.worker.html [wpt.fyi]
- Fetch from host with trailing dot should be allowed by CSP.:
FAIL
- Fetch from host with trailing dot should be allowed by CSP.:
- /content-security-policy/generic/wildcard-host-part.sub.window.html [wpt.fyi]:
OK[Gecko-android-em-14-x86_64-debug-geckoview,Gecko-android-em-14-x86_64-lite-opt-geckoview,Gecko-android-em-14-x86_64-opt-geckoview,Gecko-linux2404-64-debug,Gecko-linux2404-64-opt,Gecko-windows11-32-25h2-debug,Gecko-windows11-32-25h2-opt,Gecko-windows11-64-25h2-opt],SKIP[Gecko-windows11-64-25h2-debug]
Tests Disabled in Gecko Infrastructure
- /content-security-policy/generic/filesystem-urls-do-not-match-self.sub.html [wpt.fyi]:
SKIP - /content-security-policy/generic/wildcard-host-part.sub.window.html [wpt.fyi]:
OK[Gecko-android-em-14-x86_64-debug-geckoview,Gecko-android-em-14-x86_64-lite-opt-geckoview,Gecko-android-em-14-x86_64-opt-geckoview,Gecko-linux2404-64-debug,Gecko-linux2404-64-opt,Gecko-windows11-32-25h2-debug,Gecko-windows11-32-25h2-opt,Gecko-windows11-64-25h2-opt],SKIP[Gecko-windows11-64-25h2-debug]
Comment 4•26 days ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/24fe67f73f43
https://hg.mozilla.org/mozilla-central/rev/8132d32d64a5
Description
•