style: Propagate changes in custom properties' computed values to descendants.

If ComputedValues.custom_properties differs between the old and new
ComputedValues, indicate that we have to propogate changes to
descendants by setting child_cascade_requirement to
MustCascadeDescendants in cascade_primary.

style::matching::TElement::cascade_primary already calls
accumulate_damage, which eventually calls
ServoRestyleDamage::compute_style_difference in order to check if other
properties' computed values changed. If any of those change, we signal
that we need to propogate changes for inherited properties.

With Properties & Values, some custom properties will not be inherited,
and we will need to revisit this.
This commit is contained in:
Jonathan Chan 2017-06-12 15:03:25 -07:00
parent c1ea54d3c4
commit 32f62a5ac6
5 changed files with 57 additions and 2 deletions

View file

@ -66,7 +66,7 @@ pub struct BorrowedSpecifiedValue<'a> {
/// A computed value is just a set of tokens as well, until we resolve variables
/// properly.
#[derive(Clone, Debug)]
#[derive(Clone, Debug, Eq, PartialEq)]
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
pub struct ComputedValue {
css: String,