mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Simplify LayoutDocument::root_node.
This commit is contained in:
parent
ee0b0c81d1
commit
1eb8900f48
1 changed files with 1 additions and 5 deletions
|
@ -369,11 +369,7 @@ impl<'le> LayoutDocument<'le> {
|
|||
}
|
||||
|
||||
pub fn root_node(&self) -> Option<LayoutNode<'le>> {
|
||||
let mut node = self.as_node().first_child();
|
||||
while node.is_some() && !node.unwrap().is_element() {
|
||||
node = node.unwrap().next_sibling();
|
||||
}
|
||||
node
|
||||
self.as_node().children().find(LayoutNode::is_element)
|
||||
}
|
||||
|
||||
pub fn drain_event_state_changes(&self) -> Vec<(LayoutElement, EventState)> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue