From b1fca78cba8dddf41802c5a2001290ae8b6f46a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Fri, 12 Aug 2016 14:35:03 -0700 Subject: [PATCH] layout: Mark correctly parents of dirty elements. --- components/layout_thread/lib.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/components/layout_thread/lib.rs b/components/layout_thread/lib.rs index acc1daca80b..f9389fc1ecd 100644 --- a/components/layout_thread/lib.rs +++ b/components/layout_thread/lib.rs @@ -1114,6 +1114,14 @@ impl LayoutThread { if node.needs_dirty_on_viewport_size_changed() { // NB: The dirty bit is propagated down the tree. unsafe { node.set_dirty(true); } + + let mut current = node.parent_node(); + while let Some(node) = current { + if node.has_dirty_descendants() { break; } + unsafe { node.set_dirty_descendants(true); } + current = node.parent_node(); + } + next = iter.next_skipping_children(); } else { next = iter.next();