style: Skip custom properties comparison if other inherited properties changed.
draft
style: Skip custom properties comparison if other inherited properties changed.
MozReview-Commit-ID: 5Wc51VygLAo
--- a/servo/components/style/gecko/restyle_damage.rs
+++ b/servo/components/style/gecko/restyle_damage.rs
@@ -52,16 +52,24 @@ impl GeckoRestyleDamage {
let hint = unsafe {
bindings::Gecko_CalcStyleDifference(
old_style,
new_style,
&mut any_style_changed,
&mut reset_only,
)
};
+ if reset_only {
+ // The Gecko_CalcStyleDifference call only checks the non-custom
+ // property structs. Check the custom properties here.
+ if old_style.custom_properties() != new_style.custom_properties() {
+ any_style_changed = true;
+ reset_only = false;
+ }
+ }
let change = if any_style_changed {
StyleChange::Changed { reset_only }
} else {
StyleChange::Unchanged
};
StyleDifference::new(GeckoRestyleDamage(nsChangeHint(hint)), change)
}