From 6e9a96a6f869c2514ab4d44a5ea5cc24289afb84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Mon, 28 Aug 2017 11:36:01 +0200 Subject: [PATCH] style: Recascade the document instead of using the dirty_on_viewport_percentage bit. --- components/layout_thread/lib.rs | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) diff --git a/components/layout_thread/lib.rs b/components/layout_thread/lib.rs index 0517c504b26..d8529b57a54 100644 --- a/components/layout_thread/lib.rs +++ b/components/layout_thread/lib.rs @@ -1167,27 +1167,8 @@ impl LayoutThread { .unwrap(); } if had_used_viewport_units { - let mut iter = element.as_node().traverse_preorder(); - - let mut next = iter.next(); - while let Some(node) = next { - if node.needs_dirty_on_viewport_size_changed() { - let el = node.as_element().unwrap(); - if let Some(mut d) = element.mutate_data() { - if d.has_styles() { - // FIXME(emilio): This only needs to recascade, - // afaict. - d.restyle.hint.insert(RestyleHint::restyle_subtree()); - } - } - if let Some(p) = el.parent_element() { - unsafe { p.note_dirty_descendant() }; - } - - next = iter.next_skipping_children(); - } else { - next = iter.next(); - } + if let Some(mut data) = element.mutate_data() { + data.restyle.hint.insert(RestyleHint::recascade_subtree()); } } }