зеркало из https://github.com/mozilla/gecko-dev.git
servo: Merge #17837 - style: Avoid looking at descendant hints to check whether the element needs a restyle (from emilio:assert-fix); r=hiikezoe
This makes us hit some assertions in Gecko. Source-Repo: https://github.com/servo/servo Source-Revision: 9f412caab21ae407173187cdb5d0250fb1ae6b37 --HG-- extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear extra : subtree_revision : ae0e07a5ec6e096ffed718463f616fcbf03ef913
This commit is contained in:
Родитель
ca5e1f2280
Коммит
3fa27b8306
|
@ -324,7 +324,7 @@ impl ElementData {
|
|||
}
|
||||
|
||||
debug_assert!(hint.has_recascade_self(),
|
||||
"We definitely need to do something!");
|
||||
"We definitely need to do something: {:?}!", hint);
|
||||
return RestyleKind::CascadeOnly;
|
||||
}
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
|
Загрузка…
Ссылка в новой задаче