Fixes the table_percentage_width_a.html reftest with incremental reflow turned on.

This commit is contained in:
Clark Gaebel 2014-10-17 13:23:42 -07:00
parent 852378209b
commit 81bd3cbd9d
11 changed files with 48 additions and 70 deletions

View file

@ -10,7 +10,7 @@ use construct::FlowConstructor;
use context::LayoutContext;
use flow::{Flow, MutableFlowUtils, PreorderFlowTraversal, PostorderFlowTraversal};
use flow;
use incremental::RestyleDamage;
use incremental::{RestyleDamage, BubbleISizes, Reflow};
use wrapper::{layout_node_to_unsafe_layout_node, LayoutNode};
use wrapper::{PostorderNodeMutTraversal, ThreadSafeLayoutNode, UnsafeLayoutNode};
use wrapper::{PreorderDomTraversal, PostorderDomTraversal};
@ -205,7 +205,7 @@ impl<'a> PostorderDomTraversal for ConstructFlows<'a> {
let tnode = ThreadSafeLayoutNode::new(&node);
// Always re-construct if incremental layout is turned off.
if !opts::get().incremental_layout {
if opts::get().nonincremental_layout {
unsafe {
node.set_dirty_descendants(true);
}
@ -283,6 +283,11 @@ impl<'a> PostorderFlowTraversal for BubbleISizes<'a> {
fn process(&self, flow: &mut Flow) {
flow.bubble_inline_sizes();
}
#[inline]
fn should_process(&self, flow: &mut Flow) -> bool {
flow::base(flow).restyle_damage.contains(BubbleISizes)
}
}
/// The assign-inline-sizes traversal. In Gecko this corresponds to `Reflow`.
@ -295,6 +300,11 @@ impl<'a> PreorderFlowTraversal for AssignISizes<'a> {
fn process(&self, flow: &mut Flow) {
flow.assign_inline_sizes(self.layout_context);
}
#[inline]
fn should_process(&self, flow: &mut Flow) -> bool {
flow::base(flow).restyle_damage.contains(Reflow)
}
}
/// The assign-block-sizes-and-store-overflow traversal, the last (and most expensive) part of
@ -318,7 +328,8 @@ impl<'a> PostorderFlowTraversal for AssignBSizesAndStoreOverflow<'a> {
#[inline]
fn should_process(&self, flow: &mut Flow) -> bool {
!flow::base(flow).flags.impacted_by_floats()
let base = flow::base(flow);
base.restyle_damage.contains(Reflow) && !base.flags.impacted_by_floats()
}
}