mirror of
https://github.com/servo/servo.git
synced 2025-08-04 21:20:23 +01:00
Make replace_rules_internal return true only if important rules changed.
This commit is contained in:
parent
7651cebcd0
commit
07421a8e9c
2 changed files with 14 additions and 8 deletions
|
@ -703,15 +703,17 @@ pub trait MatchMethods : TElement {
|
|||
let replace_rule_node = |level: CascadeLevel,
|
||||
pdb: Option<ArcBorrow<Locked<PropertyDeclarationBlock>>>,
|
||||
path: &mut StrongRuleNode| -> bool {
|
||||
let mut important_rules_changed = false;
|
||||
let new_node = stylist.rule_tree()
|
||||
.update_rule_at_level(level, pdb, path, guards);
|
||||
match new_node {
|
||||
Some(n) => {
|
||||
*path = n;
|
||||
level.is_important()
|
||||
},
|
||||
None => false,
|
||||
.update_rule_at_level(level,
|
||||
pdb,
|
||||
path,
|
||||
guards,
|
||||
&mut important_rules_changed);
|
||||
if let Some(n) = new_node {
|
||||
*path = n;
|
||||
}
|
||||
important_rules_changed
|
||||
};
|
||||
|
||||
if !context.shared.traversal_flags.for_animation_only() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue