diff options
author | Anthony Ramine <n.oxyde@gmail.com> | 2015-10-17 03:10:16 +0200 |
---|---|---|
committer | Anthony Ramine <n.oxyde@gmail.com> | 2015-10-19 09:36:54 +0200 |
commit | ce6aab6cb1c1de5d77a14602a99af57a7fe8eb4f (patch) | |
tree | 2c89c103b03c5a764952091fff236c30d9e58453 /components/script/dom/domimplementation.rs | |
parent | 6ab7f646203e168c8067acf69ad262e0f3c3fe19 (diff) | |
download | servo-ce6aab6cb1c1de5d77a14602a99af57a7fe8eb4f.tar.gz servo-ce6aab6cb1c1de5d77a14602a99af57a7fe8eb4f.zip |
Do not root DOMImplementation::document
Diffstat (limited to 'components/script/dom/domimplementation.rs')
-rw-r--r-- | components/script/dom/domimplementation.rs | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/components/script/dom/domimplementation.rs b/components/script/dom/domimplementation.rs index e506c7369c8..93eb8cf8e0a 100644 --- a/components/script/dom/domimplementation.rs +++ b/components/script/dom/domimplementation.rs @@ -53,17 +53,14 @@ impl DOMImplementationMethods for DOMImplementation { fn CreateDocumentType(&self, qualified_name: DOMString, pubid: DOMString, sysid: DOMString) -> Fallible<Root<DocumentType>> { try!(validate_qualified_name(&qualified_name)); - let document = self.document.root(); - Ok(DocumentType::new(qualified_name, Some(pubid), Some(sysid), document.r())) + Ok(DocumentType::new(qualified_name, Some(pubid), Some(sysid), &self.document)) } // https://dom.spec.whatwg.org/#dom-domimplementation-createdocument fn CreateDocument(&self, namespace: Option<DOMString>, qname: DOMString, maybe_doctype: Option<&DocumentType>) -> Fallible<Root<Document>> { - let doc = self.document.root(); - let doc = doc.r(); - let win = doc.window(); - let loader = DocumentLoader::new(&*doc.loader()); + let win = self.document.window(); + let loader = DocumentLoader::new(&self.document.loader()); // Step 1. let doc = Document::new(win, None, IsHTMLDocument::NonHTMLDocument, @@ -108,10 +105,8 @@ impl DOMImplementationMethods for DOMImplementation { // https://dom.spec.whatwg.org/#dom-domimplementation-createhtmldocument fn CreateHTMLDocument(&self, title: Option<DOMString>) -> Root<Document> { - let document = self.document.root(); - let document = document.r(); - let win = document.window(); - let loader = DocumentLoader::new(&*document.loader()); + let win = self.document.window(); + let loader = DocumentLoader::new(&self.document.loader()); // Step 1-2. let doc = Document::new(win, None, IsHTMLDocument::HTMLDocument, None, None, |