layout_image: Include missing request settings in layout-initiated image loads (#36621)

This PR updates the `fetch_image_for_layout` function to include missing
security-related request settings:

- `insecure_requests_policy`
- `has_trustworthy_ancestor_origin`
- `policy_container`

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by
`[X]` when the step is complete, and replace `___` with appropriate
data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #36591

<!-- Either: -->
- [X] There are tests for these changes

Signed-off-by: Emmanuel Elom <elomemmanuel007@gmail.com>
This commit is contained in:
elomscansio 2025-04-24 13:12:39 +01:00 committed by GitHub
parent 878d595035
commit 189214810e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 45 additions and 1 deletions

View file

@ -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);