diff options
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 { |