mirror of
https://github.com/servo/servo.git
synced 2025-06-28 19:13:41 +01:00
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
This commit is contained in:
parent
856e5d1db6
commit
45435a57e9
1 changed files with 12 additions and 13 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue