Disable remaining reflow traversal pruning for now

We don't reuse Flow objects between reflows, so we have no old values to fall
back to.

I think this used to work because FlowContexts (as they were called then) were
stored in a DOM node's LayoutData and reused.  But it's possible that it never
really worked, and my testing when I landed the restyle damage code was
insufficient (I didn't understand the layout code nearly as well back then).
This commit is contained in:
Keegan McAllister 2013-12-11 16:00:53 -08:00
parent 0238410b47
commit 53747638a1

View file

@ -15,7 +15,7 @@ use layout::extra::LayoutAuxMethods;
use layout::flow::{Flow, ImmutableFlowUtils, MutableFlowUtils, PreorderFlowTraversal}; use layout::flow::{Flow, ImmutableFlowUtils, MutableFlowUtils, PreorderFlowTraversal};
use layout::flow::{PostorderFlowTraversal}; use layout::flow::{PostorderFlowTraversal};
use layout::flow; use layout::flow;
use layout::incremental::{RestyleDamage, BubbleWidths}; use layout::incremental::{RestyleDamage};
use layout::util::{LayoutData, LayoutDataAccess}; use layout::util::{LayoutData, LayoutDataAccess};
use extra::arc::{Arc, RWArc, MutexArc}; use extra::arc::{Arc, RWArc, MutexArc};
@ -143,10 +143,13 @@ impl<'self> PostorderFlowTraversal for BubbleWidthsTraversal<'self> {
true true
} }
// FIXME: We can't prune until we start reusing flows
/*
#[inline] #[inline]
fn should_prune(&mut self, flow: &mut Flow) -> bool { fn should_prune(&mut self, flow: &mut Flow) -> bool {
flow::mut_base(flow).restyle_damage.lacks(BubbleWidths) flow::mut_base(flow).restyle_damage.lacks(BubbleWidths)
} }
*/
} }
/// The assign-widths traversal. In Gecko this corresponds to `Reflow`. /// The assign-widths traversal. In Gecko this corresponds to `Reflow`.
@ -372,10 +375,9 @@ impl LayoutTask {
layout_context: &mut LayoutContext) { layout_context: &mut LayoutContext) {
let _ = layout_root.traverse_postorder(&mut BubbleWidthsTraversal(layout_context)); let _ = layout_root.traverse_postorder(&mut BubbleWidthsTraversal(layout_context));
// FIXME(kmc): We want to do // FIXME(kmc): We want to prune nodes without the Reflow restyle damage
// for flow in layout_root.traverse_preorder_prune(|f| // bit, but FloatContext values can't be reused, so we need to
// f.restyle_damage().lacks(Reflow)) // recompute them every time.
// but FloatContext values can't be reused, so we need to recompute them every time.
// NOTE: this currently computes borders, so any pruning should separate that operation out. // NOTE: this currently computes borders, so any pruning should separate that operation out.
let _ = layout_root.traverse_preorder(&mut AssignWidthsTraversal(layout_context)); let _ = layout_root.traverse_preorder(&mut AssignWidthsTraversal(layout_context));