Make the HTML parser parse into the document rather than an element.

This removes the duplicate html element.
This commit is contained in:
Ms2ger 2013-11-15 15:05:05 +01:00
parent 800c2b3c0f
commit dc6dbc63af
5 changed files with 18 additions and 32 deletions

View file

@ -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 {