style: Avoid looking at descendant hints to check whether the element needs a restyle.

This commit is contained in:
Emilio Cobos Álvarez 2017-07-24 12:12:08 +02:00
parent 6e3397b907
commit af2b429557
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
2 changed files with 7 additions and 3 deletions

View file

@ -492,7 +492,7 @@ pub trait TElement : Eq + PartialEq + Debug + Hash + Sized + Copy + Clone +
return false;
}
data.has_styles() && !data.restyle.hint.has_non_animation_hint()
data.has_styles() && !data.restyle.hint.has_non_animation_invalidations()
}
/// Flags an element and its ancestors with a given `DescendantsBit`.

View file

@ -65,8 +65,12 @@ impl RestyleHint {
}
/// Returns whether we need to restyle this element.
pub fn has_self_invalidations(&self) -> bool {
self.intersects(RESTYLE_SELF | RECASCADE_SELF | Self::replacements())
pub fn has_non_animation_invalidations(&self) -> bool {
self.intersects(
RESTYLE_SELF |
RECASCADE_SELF |
(Self::replacements() & !Self::for_animations())
)
}
/// Propagates this restyle hint to a child element.