diff options
Diffstat (limited to 'components/script/dom/document.rs')
-rw-r--r-- | components/script/dom/document.rs | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/components/script/dom/document.rs b/components/script/dom/document.rs index 6f8f2435311..79acb69096d 100644 --- a/components/script/dom/document.rs +++ b/components/script/dom/document.rs @@ -1822,6 +1822,7 @@ impl Document { pub fn new_inherited(window: &Window, browsing_context: Option<&BrowsingContext>, url: Option<ServoUrl>, + origin: Origin, is_html_document: IsHTMLDocument, content_type: Option<DOMString>, last_modified: Option<String>, @@ -1838,15 +1839,6 @@ impl Document { (DocumentReadyState::Complete, true) }; - // Incomplete implementation of Document origin specification at - // https://html.spec.whatwg.org/multipage/#origin:document - let origin = if url_has_network_scheme(&url) { - Origin::new(&url) - } else { - // Default to DOM standard behaviour - Origin::opaque_identifier() - }; - Document { node: Node::new_document_node(), window: JS::from_ref(window), @@ -1932,6 +1924,7 @@ impl Document { Ok(Document::new(window, None, None, + doc.origin().alias(), IsHTMLDocument::NonHTMLDocument, None, None, @@ -1944,6 +1937,7 @@ impl Document { pub fn new(window: &Window, browsing_context: Option<&BrowsingContext>, url: Option<ServoUrl>, + origin: Origin, doctype: IsHTMLDocument, content_type: Option<DOMString>, last_modified: Option<String>, @@ -1955,6 +1949,7 @@ impl Document { let document = reflect_dom_object(box Document::new_inherited(window, browsing_context, url, + origin, doctype, content_type, last_modified, @@ -2026,6 +2021,8 @@ impl Document { let new_doc = Document::new(self.window(), None, None, + // https://github.com/whatwg/html/issues/2109 + Origin::opaque_identifier(), doctype, None, None, |