Don't process style attribute changes in animation-only restyle.

This commit is contained in:
Hiroyuki Ikezoe 2017-05-24 14:00:30 +09:00
parent a921d1af22
commit 976b3ba6e7

View file

@ -983,7 +983,6 @@ pub trait MatchMethods : TElement {
let element_styles = &mut data.styles_mut();
let primary_rules = &mut element_styles.primary.rules;
let mut result = false;
let replace_rule_node = |level: CascadeLevel,
pdb: Option<&Arc<Locked<PropertyDeclarationBlock>>>,
@ -999,6 +998,20 @@ pub trait MatchMethods : TElement {
}
};
if !context.shared.traversal_flags.for_animation_only() {
let mut result = false;
if replacements.contains(RESTYLE_STYLE_ATTRIBUTE) {
let style_attribute = self.style_attribute();
result |= replace_rule_node(CascadeLevel::StyleAttributeNormal,
style_attribute,
primary_rules);
result |= replace_rule_node(CascadeLevel::StyleAttributeImportant,
style_attribute,
primary_rules);
}
return result;
}
// Animation restyle hints are processed prior to other restyle
// hints in the animation-only traversal.
//
@ -1032,17 +1045,9 @@ pub trait MatchMethods : TElement {
replace_rule_node_for_animation(CascadeLevel::Animations,
primary_rules);
}
} else if replacements.contains(RESTYLE_STYLE_ATTRIBUTE) {
let style_attribute = self.style_attribute();
result |= replace_rule_node(CascadeLevel::StyleAttributeNormal,
style_attribute,
primary_rules);
result |= replace_rule_node(CascadeLevel::StyleAttributeImportant,
style_attribute,
primary_rules);
}
result
false
}
/// Attempts to share a style with another node. This method is unsafe