Bug 1309752: Cleanup might_need_transitions_update. r?birtles
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.
MozReview-Commit-ID: 6vKwal4yzRU
--- a/servo/components/style/gecko/wrapper.rs
+++ b/servo/components/style/gecko/wrapper.rs
@@ -1584,35 +1584,34 @@ impl<'le> TElement for GeckoElement<'le>
fn xbl_binding_anonymous_content(&self) -> Option<GeckoNode<'le>> {
self.xbl_binding_with_content()
.map(|b| unsafe { GeckoNode::from_content(&*b.anon_content()) })
}
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.
// This is used as a more thoroughgoing check than the, cheaper
// might_need_transitions_update check.
//
// The following logic shadows the logic used on the Gecko side
// (nsTransitionManager::DoUpdateTransitions) where we actually perform the