Move children_to_process to layout.

We don't need this for Gecko, and it's hard to implement in that case because
there's nowhere obvious to put it (we don't plan to create TSDs for non-dirty
nodes, and non-dirty nodes can have dirty children which require the
children_to_process atomic). There are various solutions here, but punting is
the easiest.

We'll need to rethink this if/when we need to do a bottom-up traversal for
Gecko.
This commit is contained in:
Bobby Holley 2016-10-08 18:08:01 -07:00
parent b1d8eff467
commit c72fffa8f8
8 changed files with 74 additions and 44 deletions

View file

@ -107,10 +107,7 @@ fn top_down_dom<N, C>(unsafe_nodes: UnsafeNodeList,
// Reset the count of children if we need to do a bottom-up traversal
// after the top up.
if context.needs_postorder_traversal() {
node.mutate_data().unwrap()
.parallel.children_to_process
.store(children_to_process,
Ordering::Relaxed);
node.store_children_to_process(children_to_process);
// If there were no more children, start walking back up.
if children_to_process == 0 {
@ -161,12 +158,8 @@ fn bottom_up_dom<N, C>(root: OpaqueNode,
Some(parent) => parent,
};
let parent_data = parent.borrow_data().unwrap();
if parent_data
.parallel
.children_to_process
.fetch_sub(1, Ordering::Relaxed) != 1 {
let remaining = parent.did_process_child();
if remaining != 0 {
// Get out of here and find another node to work on.
break
}