diff options
Diffstat (limited to 'components/style/servo/restyle_damage.rs')
-rw-r--r-- | components/style/servo/restyle_damage.rs | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/components/style/servo/restyle_damage.rs b/components/style/servo/restyle_damage.rs index 0d3a4b00092..1e9cae4ea08 100644 --- a/components/style/servo/restyle_damage.rs +++ b/components/style/servo/restyle_damage.rs @@ -64,16 +64,7 @@ impl ServoRestyleDamage { new: &ServoComputedValues) -> StyleDifference { let damage = compute_damage(old, new); - // If computed values for custom properties changed, we should cascade these changes to - // children (custom properties are all inherited). - // https://www.w3.org/TR/css-variables/#defining-variables - // (With Properties & Values, not all custom properties will be inherited!) - let variable_values_changed = old.get_custom_properties() != new.get_custom_properties(); - let change = if damage.is_empty() && !variable_values_changed { - StyleChange::Unchanged - } else { - StyleChange::Changed - }; + let change = if damage.is_empty() { StyleChange::Unchanged } else { StyleChange::Changed }; StyleDifference::new(damage, change) } @@ -285,6 +276,13 @@ fn compute_damage(old: &ServoComputedValues, new: &ServoComputedValues) -> Servo get_inheritedbox.visibility ]); + + // Paint worklets may depend on custom properties, + // so if they have changed we should repaint. + if old.get_custom_properties() != new.get_custom_properties() { + damage.insert(REPAINT); + } + // If the layer requirements of this flow have changed due to the value // of the transform, then reflow is required to rebuild the layers. if old.transform_requires_layer() != new.transform_requires_layer() { |