Bug 1383001: Update has_current_styles_for_this_traversal to not look at animation hints in non-animation traversals. r?heycam
MozReview-Commit-ID: 4bwwIGcoXqA
--- a/servo/components/style/data.rs
+++ b/servo/components/style/data.rs
@@ -293,33 +293,26 @@ impl ElementData {
}
}
/// Returns true if this element has styles.
pub fn has_styles(&self) -> bool {
self.styles.primary.is_some()
}
- /// Returns whether we have any outstanding style invalidation.
- pub fn has_invalidations(&self) -> bool {
- self.restyle.hint.has_self_invalidations()
- }
-
/// Returns the kind of restyling that we're going to need to do on this
/// element, based of the stored restyle hint.
pub fn restyle_kind(
&self,
shared_context: &SharedStyleContext
) -> RestyleKind {
if shared_context.traversal_flags.for_animation_only() {
return self.restyle_kind_for_animation(shared_context);
}
- debug_assert!(!self.has_styles() || self.has_invalidations(),
- "Should've stopped earlier");
if !self.has_styles() {
return RestyleKind::MatchAndCascade;
}
let hint = self.restyle.hint;
if hint.match_self() {
return RestyleKind::MatchAndCascade;
}
--- a/servo/components/style/dom.rs
+++ b/servo/components/style/dom.rs
@@ -487,17 +487,17 @@ pub trait TElement : Eq + PartialEq + De
return data.has_styles() &&
!data.restyle.hint.has_animation_hint_or_recascade();
}
if self.has_snapshot() && !self.handled_snapshot() {
return false;
}
- data.has_styles() && !data.has_invalidations()
+ data.has_styles() && !data.restyle.hint.has_non_animation_hint()
}
/// Flags an element and its ancestors with a given `DescendantsBit`.
///
/// TODO(emilio): We call this conservatively from restyle_element_internal
/// because we never flag unstyled stuff. A different setup for this may be
/// a bit cleaner, but it's probably not worth to invest on it right now
/// unless necessary.