Make replace_rules returning boolean.

We only use whether the return value is IMPORTANT_RULES_CHANGED or not, so we
can just return true if an important rules was changed in the function.
Also, we can just return false in case of animation rules changes sine for
animation we can ensure there is no importan rules.
Because of these changes, replace_rule_node does not borrow |result| so that
we can drop a scope there.
This commit is contained in:
Hiroyuki Ikezoe 2017-05-24 14:00:16 +09:00
parent fce7c2d885
commit a921d1af22
2 changed files with 55 additions and 59 deletions

View file

@ -770,11 +770,11 @@ fn compute_style<E, D>(_traversal: &D,
)
}
CascadeWithReplacements(flags) => {
let rules_changed = element.replace_rules(flags, context, data);
let important_rules_changed = element.replace_rules(flags, context, data);
element.cascade_primary_and_pseudos(
context,
data,
rules_changed.important_rules_changed()
important_rules_changed
)
}
CascadeOnly => {