From 45435a57e934fb0af3a5eaa60818fabe292d45ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Sun, 8 Jul 2018 16:15:41 +0200 Subject: [PATCH] style: Cleanup might_need_transitions_update. Thought I had to update this as well, but nope. When basically any style changes we already update transitions. needs_transitions_update already handles the physical mapping changing by checking whether any transition for the physical property remain there or not. Bug: 1309752 Reviewed-by: birtles MozReview-Commit-ID: 6vKwal4yzRU --- components/style/gecko/wrapper.rs | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/components/style/gecko/wrapper.rs b/components/style/gecko/wrapper.rs index 00a7dcdb2c4..035cf0f7821 100644 --- a/components/style/gecko/wrapper.rs +++ b/components/style/gecko/wrapper.rs @@ -1589,25 +1589,24 @@ impl<'le> TElement for GeckoElement<'le> { fn might_need_transitions_update( &self, - old_values: Option<&ComputedValues>, - new_values: &ComputedValues, + old_style: Option<&ComputedValues>, + new_style: &ComputedValues, ) -> bool { - use properties::longhands::display::computed_value::T as Display; - - let old_values = match old_values { + let old_style = match old_style { Some(v) => v, None => return false, }; - let new_box_style = new_values.get_box(); - let transition_not_running = !self.has_css_transitions() && - new_box_style.transition_property_count() == 1 && - new_box_style.transition_combined_duration_at(0) <= 0.0f32; - let new_display_style = new_box_style.clone_display(); - let old_display_style = old_values.get_box().clone_display(); + let new_box_style = new_style.get_box(); + if !self.has_css_transitions() && !new_box_style.specifies_transitions() { + return false; + } - new_box_style.transition_property_count() > 0 && !transition_not_running && - (new_display_style != Display::None && old_display_style != Display::None) + if new_box_style.clone_display().is_none() || old_style.clone_display().is_none() { + return false; + } + + return true; } // Detect if there are any changes that require us to update transitions.