mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
style: Avoid looking at descendant hints to check whether the element needs a restyle.
This commit is contained in:
parent
6e3397b907
commit
af2b429557
2 changed files with 7 additions and 3 deletions
|
@ -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`.
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue