Use SMIL override value that has been processed during animation-only restyles for normal restyle.

In the case where we process an element which has SMIL animations in normal travesal
the SMIL styles must have been computed in animation-only restyles. So we
have only to pick the computed styles instead of recomputing it.
This commit is contained in:
Hiroyuki Ikezoe 2017-05-24 11:11:25 +09:00
parent 96d6b30eff
commit d30c4fe79d
3 changed files with 60 additions and 21 deletions

View file

@ -736,30 +736,32 @@ pub trait MatchMethods : TElement {
let stylist = &context.shared.stylist;
let style_attribute = self.style_attribute();
let smil_override = self.get_smil_override();
let animation_rules = self.get_animation_rules();
let bloom = context.thread_local.bloom_filter.filter();
{
let smil_override = data.get_smil_override();
let animation_rules = self.get_animation_rules();
let bloom = context.thread_local.bloom_filter.filter();
let map = &mut context.thread_local.selector_flags;
let mut set_selector_flags = |element: &Self, flags: ElementSelectorFlags| {
self.apply_selector_flags(map, element, flags);
};
let map = &mut context.thread_local.selector_flags;
let mut set_selector_flags = |element: &Self, flags: ElementSelectorFlags| {
self.apply_selector_flags(map, element, flags);
};
let mut matching_context =
MatchingContext::new(MatchingMode::Normal, Some(bloom));
let mut matching_context =
MatchingContext::new(MatchingMode::Normal, Some(bloom));
// Compute the primary rule node.
stylist.push_applicable_declarations(self,
implemented_pseudo.as_ref(),
style_attribute,
smil_override,
animation_rules,
&mut applicable_declarations,
&mut matching_context,
&mut set_selector_flags);
// Compute the primary rule node.
stylist.push_applicable_declarations(self,
implemented_pseudo.as_ref(),
style_attribute,
smil_override,
animation_rules,
&mut applicable_declarations,
&mut matching_context,
&mut set_selector_flags);
*relations = matching_context.relations;
*relations = matching_context.relations;
}
let primary_rule_node =
compute_rule_node::<Self>(stylist.rule_tree(),