mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
layout: Don't restart a transition if the end value for the new
transition is the same as the end value for a running transition per CSS-TRANSITIONS § 3. Besides being contrary to spec, the old behavior could cause a cascade of CSS transitions incorrectly triggering themselves when calls to `getComputedStyle()` were intermingled with them. Improves performance of nytimes.com.
This commit is contained in:
parent
f378f2807e
commit
89dff2d77f
3 changed files with 66 additions and 25 deletions
|
@ -124,6 +124,20 @@ impl AnimatedProperty {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn has_the_same_end_value_as(&self, other: &AnimatedProperty) -> bool {
|
||||
match (self, other) {
|
||||
% for prop in data.longhands:
|
||||
% if prop.animatable:
|
||||
(&AnimatedProperty::${prop.camel_case}(_, ref this_end_value),
|
||||
&AnimatedProperty::${prop.camel_case}(_, ref other_end_value)) => {
|
||||
this_end_value == other_end_value
|
||||
}
|
||||
% endif
|
||||
% endfor
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn update(&self, style: &mut ComputedValues, progress: f64) {
|
||||
match *self {
|
||||
% for prop in data.longhands:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue