Bug 1383001: Minor reformatting. r?heycam draft
authorEmilio Cobos Álvarez <emilio@crisal.io>
Sat, 22 Jul 2017 14:38:36 +0200
changeset 613776 286907bac7aae14a13b308c5203cd581637045f9
parent 613453 199c62dc0df355b668b061ae98188039ea91be63
child 613777 aec0c74a9134bd32f35ed41a90cd6968f9a8934e
child 613781 85ac7449a19477fc5a13e2a287ebae74e655a749
push id69841
push userbmo:emilio+bugs@crisal.io
push dateSat, 22 Jul 2017 13:13:24 +0000
reviewersheycam
bugs1383001
milestone56.0a1
Bug 1383001: Minor reformatting. r?heycam MozReview-Commit-ID: KVCfX3LqccF
servo/components/style/data.rs
servo/components/style/dom.rs
--- a/servo/components/style/data.rs
+++ b/servo/components/style/data.rs
@@ -300,19 +300,20 @@ impl ElementData {
 
     /// 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 {
+    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;
@@ -330,46 +331,49 @@ impl ElementData {
         }
 
         debug_assert!(hint.has_recascade_self(),
                       "We definitely need to do something!");
         return RestyleKind::CascadeOnly;
     }
 
     /// Returns the kind of restyling for animation-only restyle.
-    pub fn restyle_kind_for_animation(&self,
-                                      shared_context: &SharedStyleContext)
-                                      -> RestyleKind {
+    fn restyle_kind_for_animation(
+        &self,
+        shared_context: &SharedStyleContext,
+    ) -> RestyleKind {
         debug_assert!(shared_context.traversal_flags.for_animation_only());
         debug_assert!(self.has_styles(),
                       "Unstyled element shouldn't be traversed during \
                        animation-only traversal");
 
         // return either CascadeWithReplacements or CascadeOnly in case of
         // animation-only restyle. I.e. animation-only restyle never does
         // selector matching.
         let hint = self.restyle.hint;
         if hint.has_animation_hint() {
             return RestyleKind::CascadeWithReplacements(hint & RestyleHint::for_animations());
         }
+
         return RestyleKind::CascadeOnly;
-
     }
 
     /// Return true if important rules are different.
     /// We use this to make sure the cascade of off-main thread animations is correct.
     /// Note: Ignore custom properties for now because we only support opacity and transform
     ///       properties for animations running on compositor. Actually, we only care about opacity
     ///       and transform for now, but it's fine to compare all properties and let the user
     ///       the check which properties do they want.
     ///       If it costs too much, get_properties_overriding_animations() should return a set
     ///       containing only opacity and transform properties.
-    pub fn important_rules_are_different(&self,
-                                         rules: &StrongRuleNode,
-                                         guards: &StylesheetGuards) -> bool {
+    pub fn important_rules_are_different(
+        &self,
+        rules: &StrongRuleNode,
+        guards: &StylesheetGuards
+    ) -> bool {
         debug_assert!(self.has_styles());
         let (important_rules, _custom) =
             self.styles.primary().rules().get_properties_overriding_animations(&guards);
         let (other_important_rules, _custom) = rules.get_properties_overriding_animations(&guards);
         important_rules != other_important_rules
     }
 
     /// Drops any restyle state from the element.
--- a/servo/components/style/dom.rs
+++ b/servo/components/style/dom.rs
@@ -475,19 +475,21 @@ pub trait TElement : Eq + PartialEq + De
         if self.has_snapshot() && !self.handled_snapshot() {
             return false;
         }
 
         data.has_styles() && !data.has_invalidations()
     }
 
     /// Returns whether the element's styles are up-to-date for |traversal_flags|.
-    fn has_current_styles_for_traversal(&self,
-                                        data: &ElementData,
-                                        traversal_flags: TraversalFlags) -> bool {
+    fn has_current_styles_for_traversal(
+        &self,
+        data: &ElementData,
+        traversal_flags: TraversalFlags,
+    ) -> bool {
         if traversal_flags.for_animation_only() {
             // In animation-only restyle we never touch snapshots and don't
             // care about them. But we can't assert '!self.handled_snapshot()'
             // here since there are some cases that a second animation-only
             // restyle which is a result of normal restyle (e.g. setting
             // animation-name in normal restyle and creating a new CSS
             // animation in a SequentialTask) is processed after the normal
             // traversal in that we had elements that handled snapshot.