Implemented paint worklet properties.

This commit is contained in:
Alan Jeffrey 2017-06-14 18:14:54 -05:00
parent de331c6bc8
commit ef033b8362
29 changed files with 353 additions and 118 deletions

View file

@ -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() {