Closed Bug 2084752 Opened 1 month ago Closed 24 days ago

[wpt-sync] Sync PR 63936 - [css] Use document referrer policy for fetching from inline CSS

Categories

(Core :: DOM: Security, task, P4)

task

Tracking

()

RESOLVED FIXED
162 Branch
Tracking Status
firefox162 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 63936 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/63936
Details from upstream follow.

Mike Taylor <miketaylr@chromium.org> wrote:

[css] Use document referrer policy for fetching from inline CSS

When parsing an inline stylesheet, CSSStyleSheet::InlineParserContext
previously constructed the CSSParserContext with
network::mojom::ReferrerPolicy::kDefault, causing subresource fetches
(such as fonts, images, or SVG resource references) initiated from
\<style> elements to ignore the owner document's referrer policy.

Instead, snapshot owner_node_document.GetReferrerPolicy() when
creating the inline CSSParserContext so that inline stylesheets use
the owner document's referrer policy active at parse time. Also guard
ExecutionContext::GetReferrerPolicy() when policy_container_ is
null (e.g. after TakePolicyContainer() on a cloned document).

Original patch by estark@chromium.org.

Bug: 40898994, 40229610
Fixed: 392139161
Test: external/wpt/referrer-policy/css-integration/
Change-Id: Ieb123531d3fac6cbc8d32d6378b6d15168518f1a
TAG=agy
CONV=0f543df6-f84d-421a-bec5-5db380444d4d
Reviewed-on: https://chromium-review.googlesource.com/8602043
WPT-Export-Revision: 3e24fcec64a6600fb7db938912c114a87ba8e727

Component: web-platform-tests → DOM: Security
Product: Testing → Core

CI Results

Ran 9 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI

Total 21 tests and 1 subtests

Status Summary

Firefox

OK : 3[GitHub] 21[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]
PASS: 3[GitHub] 21[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]

Chrome

OK : 3
PASS: 1
FAIL: 2

Safari

OK : 3
PASS: 3

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Pushed by wptsync@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/60fee2046a85 https://hg.mozilla.org/integration/autoland/rev/3afcbb9944da [wpt PR 63936] - [css] Use document referrer policy for fetching from inline CSS, a=testonly
Status: NEW → RESOLVED
Closed: 24 days ago
Resolution: --- → FIXED
Target Milestone: --- → 162 Branch
You need to log in before you can comment on or make changes to this bug.