auto merge of #1051 : Ms2ger/servo/private-root, r=jdm

In preparation for removing it as part of making Document a Node.
This commit is contained in:
bors-servo 2013-10-14 10:22:00 -07:00
commit 8d3c7a2ded
4 changed files with 17 additions and 22 deletions

View file

@ -61,18 +61,11 @@ impl HTMLDocument {
}
pub fn GetHead(&self) -> Option<AbstractNode<ScriptView>> {
match self.parent.root {
match self.parent.GetDocumentElement() {
None => None,
Some(root) => {
let mut headNode: Option<AbstractNode<ScriptView>> = None;
let _ = for child in root.traverse_preorder() {
if child.type_id() == ElementNodeTypeId(HTMLHeadElementTypeId) {
headNode = Some(child);
break;
}
};
headNode
}
Some(root) => root.traverse_preorder().find(|child| {
child.type_id() == ElementNodeTypeId(HTMLHeadElementTypeId)
})
}
}