From ae5cfc31e3a84ebc36bd405ebb65b4616f66ff18 Mon Sep 17 00:00:00 2001 From: Matt Brubeck Date: Thu, 10 Mar 2016 15:52:47 -0800 Subject: [PATCH] Compute damage even when incremental layout is disabled This fixes traversals that use the damage flags to decide which nodes to process, such as `resolve_generated_content`, which was broken in non-incremental mode. --- components/layout/layout_thread.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/components/layout/layout_thread.rs b/components/layout/layout_thread.rs index a0ee55ece66..9b70851c748 100644 --- a/components/layout/layout_thread.rs +++ b/components/layout/layout_thread.rs @@ -1291,9 +1291,11 @@ impl LayoutThread { self.profiler_metadata(), self.time_profiler_chan.clone(), || { - if opts::get().nonincremental_layout || - flow_ref::deref_mut(&mut root_flow).compute_layout_damage() - .contains(REFLOW_ENTIRE_DOCUMENT) { + // Call `compute_layout_damage` even in non-incremental mode, because it sets flags + // that are needed in both incremental and non-incremental traversals. + let damage = flow_ref::deref_mut(&mut root_flow).compute_layout_damage(); + + if opts::get().nonincremental_layout || damage.contains(REFLOW_ENTIRE_DOCUMENT) { flow_ref::deref_mut(&mut root_flow).reflow_entire_document() } });