From 53747638a1f4b2f39cb54c453c07a307596b7982 Mon Sep 17 00:00:00 2001 From: Keegan McAllister Date: Wed, 11 Dec 2013 16:00:53 -0800 Subject: [PATCH] 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). --- src/components/main/layout/layout_task.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/components/main/layout/layout_task.rs b/src/components/main/layout/layout_task.rs index be46d173d0e..501c4fb6cad 100644 --- a/src/components/main/layout/layout_task.rs +++ b/src/components/main/layout/layout_task.rs @@ -15,7 +15,7 @@ use layout::extra::LayoutAuxMethods; use layout::flow::{Flow, ImmutableFlowUtils, MutableFlowUtils, PreorderFlowTraversal}; use layout::flow::{PostorderFlowTraversal}; use layout::flow; -use layout::incremental::{RestyleDamage, BubbleWidths}; +use layout::incremental::{RestyleDamage}; use layout::util::{LayoutData, LayoutDataAccess}; use extra::arc::{Arc, RWArc, MutexArc}; @@ -143,10 +143,13 @@ impl<'self> PostorderFlowTraversal for BubbleWidthsTraversal<'self> { true } + // FIXME: We can't prune until we start reusing flows + /* #[inline] fn should_prune(&mut self, flow: &mut Flow) -> bool { flow::mut_base(flow).restyle_damage.lacks(BubbleWidths) } + */ } /// The assign-widths traversal. In Gecko this corresponds to `Reflow`. @@ -372,10 +375,9 @@ impl LayoutTask { layout_context: &mut LayoutContext) { let _ = layout_root.traverse_postorder(&mut BubbleWidthsTraversal(layout_context)); - // FIXME(kmc): We want to do - // for flow in layout_root.traverse_preorder_prune(|f| - // f.restyle_damage().lacks(Reflow)) - // but FloatContext values can't be reused, so we need to recompute them every time. + // FIXME(kmc): We want to prune nodes without the Reflow restyle damage + // bit, 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. let _ = layout_root.traverse_preorder(&mut AssignWidthsTraversal(layout_context));