mirror of
https://github.com/servo/servo.git
synced 2025-06-21 23:59:00 +01:00
Make Document::root private, in preparation for removing it as part of making Document a Node.
This commit is contained in:
parent
fc9fdf30a6
commit
b6b2606c96
4 changed files with 17 additions and 22 deletions
|
@ -62,18 +62,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