diff options
author | Hiroyuki Ikezoe <hikezoe@mozilla.com> | 2017-08-03 06:42:38 +0900 |
---|---|---|
committer | Hiroyuki Ikezoe <hikezoe@mozilla.com> | 2017-08-03 07:18:32 +0900 |
commit | 07421a8e9cabd24f26e18d60506eec690a8b321f (patch) | |
tree | c6db81e93ce6d41484300880e4e2f9e5df3af56e /components/style/rule_tree | |
parent | 7651cebcd05376c034df38f480701f541fd38da1 (diff) | |
download | servo-07421a8e9cabd24f26e18d60506eec690a8b321f.tar.gz servo-07421a8e9cabd24f26e18d60506eec690a8b321f.zip |
Make replace_rules_internal return true only if important rules changed.
Diffstat (limited to 'components/style/rule_tree')
-rw-r--r-- | components/style/rule_tree/mod.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/components/style/rule_tree/mod.rs b/components/style/rule_tree/mod.rs index 0dc29232dac..1063cdba6c9 100644 --- a/components/style/rule_tree/mod.rs +++ b/components/style/rule_tree/mod.rs @@ -310,12 +310,14 @@ impl RuleTree { level: CascadeLevel, pdb: Option<ArcBorrow<Locked<PropertyDeclarationBlock>>>, path: &StrongRuleNode, - guards: &StylesheetGuards) + guards: &StylesheetGuards, + important_rules_changed: &mut bool) -> Option<StrongRuleNode> { debug_assert!(level.is_unique_per_element()); // TODO(emilio): Being smarter with lifetimes we could avoid a bit of // the refcount churn. let mut current = path.clone(); + *important_rules_changed = false; // First walk up until the first less-or-equally specific rule. let mut children = SmallVec::<[_; 10]>::new(); @@ -335,6 +337,8 @@ impl RuleTree { // special cases, and replacing them for a `while` loop, avoiding the // optimizations). if current.get().level == level { + *important_rules_changed |= level.is_important(); + if let Some(pdb) = pdb { // If the only rule at the level we're replacing is exactly the // same as `pdb`, we're done, and `path` is still valid. |