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

@ -9,7 +9,6 @@ use selector_impl::PseudoElement;
use std::collections::HashMap;
use std::hash::BuildHasherDefault;
use std::sync::Arc;
use std::sync::atomic::AtomicIsize;
pub struct PersistentStyleData {
/// The results of CSS styling for this node.
@ -18,9 +17,6 @@ pub struct PersistentStyleData {
/// The results of CSS styling for each pseudo-element (if any).
pub per_pseudo: HashMap<PseudoElement, Arc<ComputedValues>,
BuildHasherDefault<::fnv::FnvHasher>>,
/// Information needed during parallel traversals.
pub parallel: DomParallelInfo,
}
impl PersistentStyleData {
@ -28,22 +24,6 @@ impl PersistentStyleData {
PersistentStyleData {
style: None,
per_pseudo: HashMap::with_hasher(Default::default()),
parallel: DomParallelInfo::new(),
}
}
}
/// Information that we need stored in each DOM node.
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
pub struct DomParallelInfo {
/// The number of children that still need work done.
pub children_to_process: AtomicIsize,
}
impl DomParallelInfo {
pub fn new() -> DomParallelInfo {
DomParallelInfo {
children_to_process: AtomicIsize::new(0),
}
}
}