mirror of
https://github.com/servo/servo.git
synced 2025-06-20 15:18:58 +01:00
Make the HTML parser parse into the document rather than an element.
This removes the duplicate html element.
This commit is contained in:
parent
800c2b3c0f
commit
dc6dbc63af
5 changed files with 18 additions and 32 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue