diff options
author | Ms2ger <ms2ger@gmail.com> | 2013-11-15 15:05:05 +0100 |
---|---|---|
committer | Ms2ger <ms2ger@gmail.com> | 2013-11-17 13:58:24 +0100 |
commit | dc6dbc63af8d75006feaac77fefcaeedc20f045e (patch) | |
tree | 8bd3262e0d295ba5586a43ed69f1d584fbb1c9f6 /src/components/script/dom/document.rs | |
parent | 800c2b3c0f044776d9fa2aa2af5860ac248b8776 (diff) | |
download | servo-dc6dbc63af8d75006feaac77fefcaeedc20f045e.tar.gz servo-dc6dbc63af8d75006feaac77fefcaeedc20f045e.zip |
Make the HTML parser parse into the document rather than an element.
This removes the duplicate html element.
Diffstat (limited to 'src/components/script/dom/document.rs')
-rw-r--r-- | src/components/script/dom/document.rs | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/src/components/script/dom/document.rs b/src/components/script/dom/document.rs index a8c91558e7d..eb30f110533 100644 --- a/src/components/script/dom/document.rs +++ b/src/components/script/dom/document.rs @@ -77,17 +77,6 @@ impl AbstractDocument { document: ptr as *mut Box<Document> } } - - pub fn set_root(&self, root: AbstractNode<ScriptView>) { - assert!(do root.traverse_preorder().all |node| { - node.node().owner_doc() == *self - }); - - let document = self.mut_document(); - document.node.AppendChild(AbstractNode::from_document(*self), root); - // Register elements having "id" attribute to the owner doc. - document.register_nodes_with_id(&root); - } } #[deriving(Eq)] @@ -173,7 +162,9 @@ impl Reflectable for Document { impl Document { pub fn GetDocumentElement(&self) -> Option<AbstractNode<ScriptView>> { - self.node.first_child + do self.node.children().find |c| { + c.is_element() + } } fn get_cx(&self) -> *JSContext { |