mirror of
https://github.com/servo/servo.git
synced 2025-06-21 15:49:04 +01:00
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:
commit
8d3c7a2ded
4 changed files with 17 additions and 22 deletions
|
@ -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)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue