From 072f93e41e3d771b938cd8e3ade5cdbfbcd34784 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Fri, 3 Mar 2017 01:00:24 +0100 Subject: [PATCH] layout_thread: Simplify needs_dirtying setup. --- components/layout_thread/lib.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/components/layout_thread/lib.rs b/components/layout_thread/lib.rs index f15ee197dfd..1838eb7126f 100644 --- a/components/layout_thread/lib.rs +++ b/components/layout_thread/lib.rs @@ -1031,9 +1031,6 @@ impl LayoutThread { Au::from_f32_px(constraints.size.height)) }); - // Handle conditions where the entire flow tree is invalid. - let mut needs_dirtying = false; - let viewport_size_changed = self.viewport_size != old_viewport_size; if viewport_size_changed { if let Some(constraints) = rw_data.stylist.viewport_constraints() { @@ -1067,9 +1064,9 @@ impl LayoutThread { } // If the entire flow tree is invalid, then it will be reflowed anyhow. - needs_dirtying |= Arc::get_mut(&mut rw_data.stylist).unwrap().update(&data.document_stylesheets, - Some(&*UA_STYLESHEETS), - data.stylesheets_changed); + let needs_dirtying = Arc::get_mut(&mut rw_data.stylist).unwrap().update(&data.document_stylesheets, + Some(&*UA_STYLESHEETS), + data.stylesheets_changed); let needs_reflow = viewport_size_changed && !needs_dirtying; if needs_dirtying { if let Some(mut d) = element.mutate_data() {