style: Avoid propagating the restyle flag all through the dom when a node gets dirty.

This puts us in pair with stylo.
This commit is contained in:
Emilio Cobos Álvarez 2016-07-22 19:33:53 -07:00
parent 96ea1a335c
commit d81fe27b11
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
4 changed files with 21 additions and 35 deletions

View file

@ -77,7 +77,9 @@ impl<'lc, N> DomTraversalContext<N> for RecalcStyleAndConstructFlows<'lc>
recalc_style_at(&self.context, self.root, node);
}
fn process_postorder(&self, node: N) { construct_flows_at(&self.context, self.root, node); }
fn process_postorder(&self, node: N) {
construct_flows_at(&self.context, self.root, node);
}
}
/// A bottom-up, parallelizable traversal.
@ -96,7 +98,7 @@ fn construct_flows_at<'a, N: LayoutNode>(context: &'a LayoutContext<'a>, root: O
// Always reconstruct if incremental layout is turned off.
let nonincremental_layout = opts::get().nonincremental_layout;
if nonincremental_layout || node.has_dirty_descendants() {
if nonincremental_layout || node.is_dirty() || node.has_dirty_descendants() {
let mut flow_constructor = FlowConstructor::new(context);
if nonincremental_layout || !flow_constructor.repair_if_possible(&tnode) {
flow_constructor.process(&tnode);