diff options
author | Ms2ger <Ms2ger@gmail.com> | 2016-11-28 18:27:23 +0100 |
---|---|---|
committer | Ms2ger <Ms2ger@gmail.com> | 2016-12-23 11:15:46 +0100 |
commit | ec5d08c88730ac707368de03528744677a75231d (patch) | |
tree | 0548c655e1493f90a4f0c3d74587d6d70d42ae3a /components/script/dom/document.rs | |
parent | 01e336f6912292b5ca4c7349846a5d100974d99e (diff) | |
download | servo-ec5d08c88730ac707368de03528744677a75231d.tar.gz servo-ec5d08c88730ac707368de03528744677a75231d.zip |
Pass the Document's origin to its constructor.
CC #10963.
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, |