Always reset HAS_NEWLY_CONSTRUCTED_FLOW during flow construction

This extra reflows when the HAS_NEWLY_CONSTRUCTED_FLOW flag remained set
during a later reflow.  This masked other incremental layout bugs, including
the one tested by the reftest in the commit following this one.
This commit is contained in:
Matt Brubeck 2015-09-17 08:36:27 -07:00
parent 4e69f301e1
commit 040c09fbc5

View file

@ -1296,10 +1296,9 @@ impl<'a> FlowConstructor<'a> {
pub fn repair_if_possible(&mut self, node: &ThreadSafeLayoutNode) -> bool {
// We can skip reconstructing the flow if we don't have to reconstruct and none of our kids
// did either.
if node.restyle_damage().contains(RECONSTRUCT_FLOW) {
return false
}
//
// We visit the kids first and reset their HAS_NEWLY_CONSTRUCTED_FLOW flags after checking
// them. NOTE: Make sure not to bail out early before resetting all the flags!
let mut need_to_reconstruct = false;
for kid in node.children() {
if kid.flags().contains(HAS_NEWLY_CONSTRUCTED_FLOW) {
@ -1311,6 +1310,11 @@ impl<'a> FlowConstructor<'a> {
return false
}
if node.restyle_damage().contains(RECONSTRUCT_FLOW) {
return false
}
let mut style = node.style().clone();
let mut layout_data_ref = node.mutate_layout_data();
let layout_data = layout_data_ref.as_mut().expect("no layout data");