diff --git a/components/script/layout_image.rs b/components/script/layout_image.rs index 7fd23804ffd..df542b4b759 100644 --- a/components/script/layout_image.rs +++ b/components/script/layout_image.rs @@ -119,7 +119,10 @@ pub(crate) fn fetch_image_for_layout( ) .origin(document.origin().immutable().clone()) .destination(Destination::Image) - .pipeline_id(Some(document.global().pipeline_id())); + .pipeline_id(Some(document.global().pipeline_id())) + .insecure_requests_policy(document.insecure_requests_policy()) + .has_trustworthy_ancestor_origin(document.has_trustworthy_ancestor_origin()) + .policy_container(document.policy_container().to_owned()); // Layout image loads do not delay the document load event. document.fetch_background(request, context); diff --git a/tests/wpt/mozilla/meta/MANIFEST.json b/tests/wpt/mozilla/meta/MANIFEST.json index c18a78786aa..2cf09181acc 100644 --- a/tests/wpt/mozilla/meta/MANIFEST.json +++ b/tests/wpt/mozilla/meta/MANIFEST.json @@ -12755,6 +12755,13 @@ {} ] ], + "background_image_csp.sub.html": [ + "c326f54de52c6a36cbaf4871c947c5b785cac83d", + [ + null, + {} + ] + ], "binding_keyword.html": [ "818d2aa29471026c1b4215dfcd1b9939a052b1ea", [ diff --git a/tests/wpt/mozilla/tests/mozilla/background_image_csp.sub.html b/tests/wpt/mozilla/tests/mozilla/background_image_csp.sub.html new file mode 100644 index 00000000000..c326f54de52 --- /dev/null +++ b/tests/wpt/mozilla/tests/mozilla/background_image_csp.sub.html @@ -0,0 +1,34 @@ + + + + + +
+ +