Bug 1383001: Update has_current_styles_for_this_traversal to not look at animation hints in non-animation traversals. r?heycam draft
authorEmilio Cobos Álvarez <emilio@crisal.io>
Sat, 22 Jul 2017 14:58:07 +0200
changeset 613782 8d802b35960f6862abea72958683c7b322926634
parent 613781 85ac7449a19477fc5a13e2a287ebae74e655a749
child 613783 64fc072325b60a9a6270b38c373394f23c3cee07
push id69842
push userbmo:emilio+bugs@crisal.io
push dateSat, 22 Jul 2017 13:14:27 +0000
reviewersheycam
bugs1383001
milestone56.0a1
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
servo/components/style/data.rs
servo/components/style/dom.rs
--- 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.