mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Pass a callback to recalc_style_at to avoid traversing children twice.
MozReview-Commit-ID: DIHXaVNzbFM
This commit is contained in:
parent
e534ec9e47
commit
b7de96e702
6 changed files with 166 additions and 188 deletions
|
@ -202,13 +202,11 @@ fn top_down_dom<'a, 'scope, E, D>(nodes: &'a [SendNode<E::ConcreteNode>],
|
|||
|
||||
let node = **n;
|
||||
let mut children_to_process = 0isize;
|
||||
traversal.process_preorder(&traversal_data, &mut context, node);
|
||||
if let Some(el) = node.as_element() {
|
||||
traversal.traverse_children(&mut context, el, |_context, kid| {
|
||||
children_to_process += 1;
|
||||
discovered_child_nodes.push(unsafe { SendNode::new(kid) })
|
||||
});
|
||||
}
|
||||
traversal.process_preorder(&traversal_data, &mut context, node, |n| {
|
||||
children_to_process += 1;
|
||||
let send_n = unsafe { SendNode::new(n) };
|
||||
discovered_child_nodes.push(send_n);
|
||||
});
|
||||
|
||||
traversal.handle_postorder_traversal(&mut context, root, node,
|
||||
children_to_process);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue