From f754cacbd53c47c63639e1d1226812427ef1eaad Mon Sep 17 00:00:00 2001 From: Shing Lyu Date: Wed, 22 Jun 2016 16:44:04 +0800 Subject: Only restyle viewport-relative nodes on viewport size change --- components/layout_thread/lib.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'components/layout_thread/lib.rs') diff --git a/components/layout_thread/lib.rs b/components/layout_thread/lib.rs index fe1f82f533b..e670d214e03 100644 --- a/components/layout_thread/lib.rs +++ b/components/layout_thread/lib.rs @@ -1072,9 +1072,15 @@ impl LayoutThread { .send(ConstellationMsg::ViewportConstrained(self.id, constraints)) .unwrap(); } - // FIXME (#10104): Only dirty nodes affected by vh/vw/vmin/vmax styles. if data.document_stylesheets.iter().any(|sheet| sheet.dirty_on_viewport_size_change) { - needs_dirtying = true; + for node in node.traverse_preorder() { + if node.needs_dirty_on_viewport_size_changed() { + node.dirty_self(); + node.dirty_descendants(); + // TODO(shinglyu): We can skip the traversal if the descendants were already + // dirtied + } + } } } -- cgit v1.2.3