-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Open
Labels
A-content/domInteracting with the DOM from web contentInteracting with the DOM from web content
Description
https://html.spec.whatwg.org/multipage/urls-and-fetching.html#fallback-base-url describes how to use an initialized about base URL. Our current implementation relies on synchronously querying the parent, which is broken in our current implementation when the iframe is sandboxed.
servo/components/script/dom/document.rs
Lines 814 to 829 in 9a0f2be
| if let Some(browsing_context) = self.browsing_context() { | |
| // Step 1: If document is an iframe srcdoc document, then return the | |
| // document base URL of document's browsing context's container document. | |
| let container_base_url = browsing_context | |
| .parent() | |
| .and_then(|parent| parent.document()) | |
| .map(|document| document.base_url()); | |
| if document_url.as_str() == "about:srcdoc" { | |
| if let Some(base_url) = container_base_url { | |
| return base_url; | |
| } | |
| } | |
| // Step 2: If document's URL is about:blank, and document's browsing | |
| // context's creator base URL is non-null, then return that creator base URL. | |
| if document_url.as_str() == "about:blank" && browsing_context.has_creator_base_url() { | |
| return browsing_context.creator_base_url().unwrap(); |
Tests: ./mach test-wpt tests/wpt/tests/html/infrastructure/urls/terminology-0/document-base-url-about-srcdoc.https.window.html
Metadata
Metadata
Assignees
Labels
A-content/domInteracting with the DOM from web contentInteracting with the DOM from web content