Bug 1489862 - Format style component. r=emilio
authorchansuke <chansuke@georepublic.de>
Sun, 09 Sep 2018 16:24:45 +0200
changeset 435333 9070b703aadf916ba787296f3a41c04752368db2
parent 435332 516eec51de7502c0ced6ec22f97bfa1aad59ede7
child 435334 d6e7aa82b3397ad51d67dc48eb450e46747dc784
push id107631
push userncsoregi@mozilla.com
push dateSun, 09 Sep 2018 21:50:08 +0000
treeherdermozilla-inbound@488a82fa06e1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersemilio
bugs1489862, 21652
milestone64.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1489862 - Format style component. r=emilio This cherry-picks servo/servo#21652.
servo/components/style/animation.rs
servo/components/style/applicable_declarations.rs
servo/components/style/attr.rs
servo/components/style/author_styles.rs
servo/components/style/build_gecko.rs
servo/components/style/counter_style/mod.rs
servo/components/style/custom_properties.rs
servo/components/style/data.rs
servo/components/style/dom.rs
servo/components/style/dom_apis.rs
servo/components/style/font_face.rs
servo/components/style/gecko/conversions.rs
servo/components/style/gecko/data.rs
servo/components/style/gecko/media_features.rs
servo/components/style/gecko/media_queries.rs
servo/components/style/gecko/pseudo_element.rs
servo/components/style/gecko/rules.rs
servo/components/style/gecko/selector_parser.rs
servo/components/style/gecko/snapshot_helpers.rs
servo/components/style/gecko/url.rs
servo/components/style/gecko/values.rs
servo/components/style/gecko/wrapper.rs
servo/components/style/gecko_bindings/mod.rs
servo/components/style/gecko_bindings/sugar/ns_style_coord.rs
servo/components/style/gecko_bindings/sugar/refptr.rs
servo/components/style/gecko_bindings/sugar/style_complex_color.rs
servo/components/style/invalidation/element/element_wrapper.rs
servo/components/style/invalidation/element/invalidation_map.rs
servo/components/style/invalidation/element/restyle_hints.rs
servo/components/style/invalidation/element/state_and_attributes.rs
servo/components/style/lib.rs
servo/components/style/logical_geometry.rs
servo/components/style/macros.rs
servo/components/style/matching.rs
servo/components/style/media_queries/media_condition.rs
servo/components/style/media_queries/media_feature.rs
servo/components/style/media_queries/media_feature_expression.rs
servo/components/style/media_queries/media_list.rs
servo/components/style/media_queries/media_query.rs
servo/components/style/parser.rs
servo/components/style/rule_tree/mod.rs
servo/components/style/selector_map.rs
servo/components/style/servo/restyle_damage.rs
servo/components/style/servo/selector_parser.rs
servo/components/style/sharing/mod.rs
servo/components/style/style_adjuster.rs
servo/components/style/style_resolver.rs
servo/components/style/stylesheet_set.rs
servo/components/style/stylesheets/document_rule.rs
servo/components/style/stylesheets/font_feature_values_rule.rs
servo/components/style/stylesheets/keyframes_rule.rs
servo/components/style/stylesheets/mod.rs
servo/components/style/stylesheets/rule_list.rs
servo/components/style/stylesheets/rule_parser.rs
servo/components/style/stylesheets/rules_iterator.rs
servo/components/style/stylesheets/stylesheet.rs
servo/components/style/stylesheets/supports_rule.rs
servo/components/style/stylesheets/viewport_rule.rs
servo/components/style/stylist.rs
servo/components/style/traversal.rs
servo/components/style/use_counters/mod.rs
servo/components/style/values/animated/color.rs
servo/components/style/values/animated/mod.rs
servo/components/style/values/computed/angle.rs
servo/components/style/values/computed/box.rs
servo/components/style/values/computed/counters.rs
servo/components/style/values/computed/effects.rs
servo/components/style/values/computed/font.rs
servo/components/style/values/computed/length.rs
servo/components/style/values/computed/motion.rs
servo/components/style/values/computed/percentage.rs
servo/components/style/values/computed/transform.rs
servo/components/style/values/generics/background.rs
servo/components/style/values/generics/basic_shape.rs
servo/components/style/values/generics/border.rs
servo/components/style/values/generics/box.rs
servo/components/style/values/generics/column.rs
servo/components/style/values/generics/counters.rs
servo/components/style/values/generics/effects.rs
servo/components/style/values/generics/flex.rs
servo/components/style/values/generics/font.rs
servo/components/style/values/generics/gecko.rs
servo/components/style/values/generics/grid.rs
servo/components/style/values/generics/image.rs
servo/components/style/values/generics/mod.rs
servo/components/style/values/generics/position.rs
servo/components/style/values/generics/rect.rs
servo/components/style/values/generics/size.rs
servo/components/style/values/generics/svg.rs
servo/components/style/values/generics/text.rs
servo/components/style/values/generics/transform.rs
servo/components/style/values/generics/ui.rs
servo/components/style/values/generics/url.rs
servo/components/style/values/mod.rs
servo/components/style/values/specified/align.rs
servo/components/style/values/specified/background.rs
servo/components/style/values/specified/basic_shape.rs
servo/components/style/values/specified/border.rs
servo/components/style/values/specified/box.rs
servo/components/style/values/specified/color.rs
servo/components/style/values/specified/column.rs
servo/components/style/values/specified/counters.rs
servo/components/style/values/specified/effects.rs
servo/components/style/values/specified/font.rs
servo/components/style/values/specified/grid.rs
servo/components/style/values/specified/image.rs
servo/components/style/values/specified/length.rs
servo/components/style/values/specified/list.rs
servo/components/style/values/specified/mod.rs
servo/components/style/values/specified/motion.rs
servo/components/style/values/specified/outline.rs
servo/components/style/values/specified/position.rs
servo/components/style/values/specified/resolution.rs
servo/components/style/values/specified/source_size_list.rs
servo/components/style/values/specified/svg.rs
servo/components/style/values/specified/svg_path.rs
servo/components/style/values/specified/table.rs
servo/components/style/values/specified/text.rs
servo/components/style/values/specified/time.rs
servo/components/style/values/specified/ui.rs
--- a/servo/components/style/animation.rs
+++ b/servo/components/style/animation.rs
@@ -208,17 +208,22 @@ pub enum Animation {
     /// the f64 field is the start time as returned by `time::precise_time_s()`.
     ///
     /// The `bool` field is werther this animation should no longer run.
     Transition(OpaqueNode, f64, AnimationFrame, bool),
     /// A keyframes animation is identified by a name, and can have a
     /// node-dependent state (i.e. iteration count, etc.).
     ///
     /// TODO(emilio): The animation object could be refcounted.
-    Keyframes(OpaqueNode, KeyframesAnimation, Atom, KeyframesAnimationState),
+    Keyframes(
+        OpaqueNode,
+        KeyframesAnimation,
+        Atom,
+        KeyframesAnimationState,
+    ),
 }
 
 impl Animation {
     /// Mark this animation as expired.
     #[inline]
     pub fn mark_as_expired(&mut self) {
         debug_assert!(!self.is_expired());
         match *self {
@@ -299,30 +304,28 @@ impl PropertyAnimation {
     ) -> Vec<PropertyAnimation> {
         let mut result = vec![];
         let box_style = new_style.get_box();
         let transition_property = box_style.transition_property_at(transition_index);
         let timing_function = box_style.transition_timing_function_mod(transition_index);
         let duration = box_style.transition_duration_mod(transition_index);
 
         match transition_property {
-            TransitionProperty::Custom(..) |
-            TransitionProperty::Unsupported(..) => result,
+            TransitionProperty::Custom(..) | TransitionProperty::Unsupported(..) => result,
             TransitionProperty::Shorthand(ref shorthand_id) => shorthand_id
                 .longhands()
                 .filter_map(|longhand| {
                     PropertyAnimation::from_longhand(
                         longhand,
                         timing_function,
                         duration,
                         old_style,
                         new_style,
                     )
-                })
-                .collect(),
+                }).collect(),
             TransitionProperty::Longhand(longhand_id) => {
                 let animation = PropertyAnimation::from_longhand(
                     longhand_id,
                     timing_function,
                     duration,
                     old_style,
                     new_style,
                 );
@@ -450,18 +453,17 @@ pub fn start_transitions_if_applicable(
                 .send(Animation::Transition(
                     opaque_node,
                     start_time,
                     AnimationFrame {
                         duration: box_style.transition_duration_mod(i).seconds() as f64,
                         property_animation: property_animation,
                     },
                     /* is_expired = */ false,
-                ))
-                .unwrap();
+                )).unwrap();
 
             had_animations = true;
         }
     }
 
     had_animations
 }
 
@@ -500,17 +502,19 @@ where
                 /* pseudo = */ None,
                 previous_style.rules(),
                 &context.guards,
                 iter,
                 Some(previous_style),
                 Some(previous_style),
                 Some(previous_style),
                 font_metrics_provider,
-                CascadeMode::Unvisited { visited_rules: None },
+                CascadeMode::Unvisited {
+                    visited_rules: None,
+                },
                 context.quirks_mode(),
                 /* rule_cache = */ None,
                 &mut Default::default(),
                 /* element = */ None,
             );
             computed
         },
     }
@@ -591,18 +595,17 @@ where
                         delay: delay as f64,
                         iteration_state: iteration_state,
                         running_state: running_state,
                         direction: animation_direction,
                         current_direction: initial_direction,
                         expired: false,
                         cascade_style: new_style.clone(),
                     },
-                ))
-                .unwrap();
+                )).unwrap();
             had_animations = true;
         }
     }
 
     had_animations
 }
 
 /// Updates a given computed style for a given animation frame. Returns a bool
@@ -730,18 +733,17 @@ pub fn update_style_for_animation<E>(
 
                     last_keyframe_position = target_keyframe_position
                         .and_then(|pos| {
                             if pos != animation.steps.len() - 1 {
                                 Some(pos + 1)
                             } else {
                                 None
                             }
-                        })
-                        .unwrap_or(animation.steps.len() - 1);
+                        }).unwrap_or(animation.steps.len() - 1);
                 },
                 _ => unreachable!(),
             }
 
             debug!(
                 "update_style_for_animation: keyframe from {:?} to {:?}",
                 last_keyframe_position, target_keyframe_position
             );
--- a/servo/components/style/applicable_declarations.rs
+++ b/servo/components/style/applicable_declarations.rs
@@ -33,17 +33,18 @@ const SOURCE_ORDER_MASK: u32 = SOURCE_OR
 
 /// We store up-to-15 shadow order levels.
 ///
 /// You'd need an element slotted across 16 components with ::slotted rules to
 /// trigger this as of this writing, which looks... Unlikely.
 const SHADOW_CASCADE_ORDER_SHIFT: usize = SOURCE_ORDER_BITS;
 const SHADOW_CASCADE_ORDER_BITS: usize = 4;
 const SHADOW_CASCADE_ORDER_MAX: u8 = (1 << SHADOW_CASCADE_ORDER_BITS) - 1;
-const SHADOW_CASCADE_ORDER_MASK: u32 = (SHADOW_CASCADE_ORDER_MAX as u32) << SHADOW_CASCADE_ORDER_SHIFT;
+const SHADOW_CASCADE_ORDER_MASK: u32 =
+    (SHADOW_CASCADE_ORDER_MAX as u32) << SHADOW_CASCADE_ORDER_SHIFT;
 
 const CASCADE_LEVEL_SHIFT: usize = SOURCE_ORDER_BITS + SHADOW_CASCADE_ORDER_BITS;
 const CASCADE_LEVEL_BITS: usize = 4;
 const CASCADE_LEVEL_MAX: u8 = (1 << CASCADE_LEVEL_BITS) - 1;
 const CASCADE_LEVEL_MASK: u32 = (CASCADE_LEVEL_MAX as u32) << CASCADE_LEVEL_SHIFT;
 
 /// Stores the source order of a block, the cascade level it belongs to, and the
 /// counter needed to handle Shadow DOM cascade order properly.
@@ -56,17 +57,18 @@ impl ApplicableDeclarationBits {
         cascade_level: CascadeLevel,
         shadow_cascade_order: ShadowCascadeOrder,
     ) -> Self {
         debug_assert!(
             cascade_level as u8 <= CASCADE_LEVEL_MAX,
             "Gotta find more bits!"
         );
         let mut bits = ::std::cmp::min(source_order, SOURCE_ORDER_MAX);
-        bits |= ((shadow_cascade_order & SHADOW_CASCADE_ORDER_MAX) as u32) << SHADOW_CASCADE_ORDER_SHIFT;
+        bits |= ((shadow_cascade_order & SHADOW_CASCADE_ORDER_MAX) as u32) <<
+            SHADOW_CASCADE_ORDER_SHIFT;
         bits |= (cascade_level as u8 as u32) << CASCADE_LEVEL_SHIFT;
         ApplicableDeclarationBits(bits)
     }
 
     fn source_order(&self) -> u32 {
         (self.0 & SOURCE_ORDER_MASK) >> SOURCE_ORDER_SHIFT
     }
 
--- a/servo/components/style/attr.rs
+++ b/servo/components/style/attr.rs
@@ -153,25 +153,25 @@ pub fn parse_double(string: &str) -> Res
         value *= 10f64.powi(exp)
     };
 
     Ok(value)
 }
 
 impl AttrValue {
     pub fn from_serialized_tokenlist(tokens: String) -> AttrValue {
-        let atoms = split_html_space_chars(&tokens).map(Atom::from).fold(
-            vec![],
-            |mut acc, atom| {
-                if !acc.contains(&atom) {
-                    acc.push(atom)
-                }
-                acc
-            },
-        );
+        let atoms =
+            split_html_space_chars(&tokens)
+                .map(Atom::from)
+                .fold(vec![], |mut acc, atom| {
+                    if !acc.contains(&atom) {
+                        acc.push(atom)
+                    }
+                    acc
+                });
         AttrValue::TokenList(tokens, atoms)
     }
 
     pub fn from_comma_separated_tokenlist(tokens: String) -> AttrValue {
         let atoms = split_commas(&tokens)
             .map(Atom::from)
             .fold(vec![], |mut acc, atom| {
                 if !acc.contains(&atom) {
--- a/servo/components/style/author_styles.rs
+++ b/servo/components/style/author_styles.rs
@@ -55,25 +55,27 @@ where
         &mut self,
         device: &Device,
         quirks_mode: QuirksMode,
         guard: &SharedRwLockReadGuard,
     ) where
         E: TElement,
         S: ToMediaListKey,
     {
-        let flusher = self.stylesheets
+        let flusher = self
+            .stylesheets
             .flush::<E>(/* host = */ None, /* snapshot_map = */ None);
 
         if flusher.sheets.dirty() {
             self.quirks_mode = quirks_mode;
         }
 
         // Ignore OOM.
-        let _ = self.data
+        let _ = self
+            .data
             .rebuild(device, quirks_mode, flusher.sheets, guard);
     }
 }
 
 #[cfg(feature = "gecko")]
 unsafe impl HasFFI for AuthorStyles<::gecko::data::GeckoStyleSheet> {
     type FFIType = ::gecko_bindings::bindings::RawServoAuthorStyles;
 }
--- a/servo/components/style/build_gecko.rs
+++ b/servo/components/style/build_gecko.rs
@@ -317,23 +317,21 @@ mod bindings {
             .lines()
             .map(|line| line.trim())
             .filter(|line| !line.is_empty())
             .map(|line| {
                 re.captures(&line)
                     .expect(&format!(
                         "Unrecognized line in ServoArcTypeList.h: '{}'",
                         line
-                    ))
-                    .get(1)
+                    )).get(1)
                     .unwrap()
                     .as_str()
                     .to_string()
-            })
-            .collect()
+            }).collect()
     }
 
     struct BuilderWithConfig<'a> {
         builder: Builder,
         config: &'a Table,
         used_keys: HashSet<&'static str>,
     }
     impl<'a> BuilderWithConfig<'a> {
@@ -431,18 +429,17 @@ mod bindings {
                     rep: format!("::gecko_bindings::structs::{}", gecko_name),
                 });
                 builder.blacklist_type(gecko).raw_line(format!(
                     "pub type {0}{2} = {1}{2};",
                     gecko_name,
                     servo,
                     if generic { "<T>" } else { "" }
                 ))
-            })
-            .get_builder();
+            }).get_builder();
         write_binding_file(builder, STRUCTS_FILE, &fixups);
     }
 
     fn setup_logging() -> bool {
         use log;
 
         struct BuildLogger {
             file: Option<Mutex<fs::File>>,
@@ -548,18 +545,17 @@ mod bindings {
             .handle_str_items("servo-borrow-types", |b, ty| b.mutable_borrowed_type(ty))
             .get_builder();
         for ty in get_arc_types().iter() {
             builder = builder
                 .blacklist_type(format!("{}Strong", ty))
                 .raw_line(format!(
                     "pub type {0}Strong = ::gecko_bindings::sugar::ownership::Strong<{0}>;",
                     ty
-                ))
-                .borrowed_type(ty)
+                )).borrowed_type(ty)
                 .zero_size_type(ty, &structs_types);
         }
         write_binding_file(builder, BINDINGS_FILE, &fixups);
     }
 
     fn generate_atoms() {
         let script = PathBuf::from(env::var_os("CARGO_MANIFEST_DIR").unwrap())
             .join("gecko")
--- a/servo/components/style/counter_style/mod.rs
+++ b/servo/components/style/counter_style/mod.rs
@@ -86,29 +86,29 @@ pub fn parse_counter_style_body<'i, 't>(
             context: context,
             rule: &mut rule,
         };
         let mut iter = DeclarationListParser::new(input, parser);
         while let Some(declaration) = iter.next() {
             if let Err((error, slice)) = declaration {
                 let location = error.location;
                 let error = ContextualParseError::UnsupportedCounterStyleDescriptorDeclaration(
-                    slice,
-                    error,
+                    slice, error,
                 );
                 context.log_css_error(location, error)
             }
         }
     }
     let error = match *rule.resolved_system() {
         ref system @ System::Cyclic |
         ref system @ System::Fixed { .. } |
         ref system @ System::Symbolic |
         ref system @ System::Alphabetic |
-        ref system @ System::Numeric if rule.symbols.is_none() =>
+        ref system @ System::Numeric
+            if rule.symbols.is_none() =>
         {
             let system = system.to_css_string();
             Some(ContextualParseError::InvalidCounterStyleWithoutSymbols(
                 system,
             ))
         }
         ref system @ System::Alphabetic | ref system @ System::Numeric
             if rule.symbols().unwrap().0.len() < 2 =>
@@ -491,22 +491,23 @@ impl Parse for Ranges {
             input
                 .parse_comma_separated(|input| {
                     let opt_start = parse_bound(context, input)?;
                     let opt_end = parse_bound(context, input)?;
                     if let (CounterBound::Integer(start), CounterBound::Integer(end)) =
                         (opt_start, opt_end)
                     {
                         if start > end {
-                            return Err(input.new_custom_error(StyleParseErrorKind::UnspecifiedError));
+                            return Err(
+                                input.new_custom_error(StyleParseErrorKind::UnspecifiedError)
+                            );
                         }
                     }
                     Ok(opt_start..opt_end)
-                })
-                .map(Ranges)
+                }).map(Ranges)
         }
     }
 }
 
 fn parse_bound<'i, 't>(
     context: &ParserContext,
     input: &mut Parser<'i, 't>,
 ) -> Result<CounterBound, ParseError<'i>> {
--- a/servo/components/style/custom_properties.rs
+++ b/servo/components/style/custom_properties.rs
@@ -238,17 +238,18 @@ impl VariableValue {
         // In that case, css_*_token_type is nonsensical.
         if css.is_empty() {
             return;
         }
 
         self.first_token_type.set_if_nothing(css_first_token_type);
         // If self.first_token_type was nothing,
         // self.last_token_type is also nothing and this will be false:
-        if self.last_token_type
+        if self
+            .last_token_type
             .needs_separator_when_before(css_first_token_type)
         {
             self.css.push_str("/**/")
         }
         self.css.push_str(css);
         self.last_token_type = css_last_token_type
     }
 
@@ -564,17 +565,18 @@ impl<'a> CustomPropertiesBuilder<'a> {
                 // Custom properties are inherited by default. So
                 // explicit 'inherit' or 'unset' means we can just use
                 // any existing value in the inherited CustomPropertiesMap.
                 return false;
             },
             _ => {},
         }
 
-        let existing_value = self.custom_properties
+        let existing_value = self
+            .custom_properties
             .as_ref()
             .and_then(|m| m.get(name))
             .or_else(|| self.inherited.and_then(|m| m.get(name)));
 
         match (existing_value, value) {
             (None, &DeclaredValue::CSSWideKeyword(CSSWideKeyword::Initial)) => {
                 // The initial value of a custom property is the same as it
                 // not existing in the map.
--- a/servo/components/style/data.rs
+++ b/servo/components/style/data.rs
@@ -267,22 +267,18 @@ impl ElementData {
             element.handled_snapshot(),
             element.implemented_pseudo_element()
         );
 
         if !element.has_snapshot() || element.handled_snapshot() {
             return InvalidationResult::empty();
         }
 
-        let mut processor = StateAndAttrInvalidationProcessor::new(
-            shared_context,
-            element,
-            self,
-            nth_index_cache,
-        );
+        let mut processor =
+            StateAndAttrInvalidationProcessor::new(shared_context, element, self, nth_index_cache);
 
         let invalidator = TreeStyleInvalidator::new(element, stack_limit_checker, &mut processor);
 
         let result = invalidator.invalidate();
 
         unsafe { element.set_handled_snapshot() }
         debug_assert!(element.handled_snapshot());
 
@@ -300,17 +296,18 @@ impl ElementData {
         ResolvedElementStyles {
             primary: self.share_primary_style(),
             pseudos: self.styles.pseudos.clone(),
         }
     }
 
     /// Returns this element's primary style as a resolved style to use for sharing.
     pub fn share_primary_style(&self) -> PrimaryStyle {
-        let reused_via_rule_node = self.flags
+        let reused_via_rule_node = self
+            .flags
             .contains(ElementDataFlags::PRIMARY_STYLE_REUSED_VIA_RULE_NODE);
 
         PrimaryStyle {
             style: ResolvedStyle(self.styles.primary().clone()),
             reused_via_rule_node,
         }
     }
 
@@ -385,17 +382,18 @@ impl ElementData {
     ///       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 {
         debug_assert!(self.has_styles());
-        let (important_rules, _custom) = self.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
@@ -37,17 +37,20 @@ use traversal_flags::TraversalFlags;
 /// performed on this node is to compare it to another opaque handle or to another
 /// OpaqueNode.
 ///
 /// Layout and Graphics use this to safely represent nodes for comparison purposes.
 /// Because the script task's GC does not trace layout, node data cannot be safely stored in layout
 /// data structures. Also, layout code tends to be faster when the DOM is not being accessed, for
 /// locality reasons. Using `OpaqueNode` enforces this invariant.
 #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
-#[cfg_attr(feature = "servo", derive(MallocSizeOf, Deserialize, Serialize))]
+#[cfg_attr(
+    feature = "servo",
+    derive(MallocSizeOf, Deserialize, Serialize)
+)]
 pub struct OpaqueNode(pub usize);
 
 impl OpaqueNode {
     /// Returns the address of this node, for debugging purposes.
     #[inline]
     pub fn id(&self) -> usize {
         self.0
     }
@@ -454,17 +457,19 @@ pub trait TElement:
 
     /// Return whether this element is an element in the MathML namespace.
     fn is_mathml_element(&self) -> bool;
 
     /// Return whether this element is an element in the SVG namespace.
     fn is_svg_element(&self) -> bool;
 
     /// Return whether this element is an element in the XUL namespace.
-    fn is_xul_element(&self) -> bool { false }
+    fn is_xul_element(&self) -> bool {
+        false
+    }
 
     /// Return the list of slotted nodes of this node.
     fn slotted_nodes(&self) -> &[Self::ConcreteNode] {
         &[]
     }
 
     /// Get this element's style attribute.
     fn style_attribute(&self) -> Option<ArcBorrow<Locked<PropertyDeclarationBlock>>>;
@@ -887,21 +892,17 @@ pub trait TElement:
     /// the `lang=""` attribute) on this element.
     fn lang_attr(&self) -> Option<AttrValue>;
 
     /// Returns whether this element's language matches the language tag
     /// `value`.  If `override_lang` is not `None`, it specifies the value
     /// of the `xml:lang=""` or `lang=""` attribute to use in place of
     /// looking at the element and its ancestors.  (This argument is used
     /// to implement matching of `:lang()` against snapshots.)
-    fn match_element_lang(
-        &self,
-        override_lang: Option<Option<AttrValue>>,
-        value: &Lang,
-    ) -> bool;
+    fn match_element_lang(&self, override_lang: Option<Option<AttrValue>>, value: &Lang) -> bool;
 
     /// Returns whether this element is the main body element of the HTML
     /// document it is on.
     fn is_html_document_body_element(&self) -> bool;
 
     /// Generate the proper applicable declarations due to presentational hints,
     /// and insert them into `hints`.
     fn synthesize_presentational_hints_for_legacy_attributes<V>(
--- a/servo/components/style/dom_apis.rs
+++ b/servo/components/style/dom_apis.rs
@@ -421,18 +421,17 @@ where
                         // root that match the selector list with that id.
                         collect_elements_with_id::<E, Q, _>(root, id, results, quirks_mode, |e| {
                             matching::matches_selector_list(selector_list, &e, matching_context)
                         });
 
                         return Ok(());
                     }
 
-                    let elements =
-                        fast_connected_elements_with_id(root, id, quirks_mode)?;
+                    let elements = fast_connected_elements_with_id(root, id, quirks_mode)?;
                     if elements.is_empty() {
                         return Ok(());
                     }
 
                     // Results need to be in document order. Let's not bother
                     // reordering or deduplicating nodes, which we would need to
                     // do if one element with the given id were a descendant of
                     // another element with that given id.
--- a/servo/components/style/font_face.rs
+++ b/servo/components/style/font_face.rs
@@ -99,36 +99,38 @@ pub enum FontDisplay {
 pub struct FontWeight(pub AbsoluteFontWeight, pub Option<AbsoluteFontWeight>);
 
 impl Parse for FontWeight {
     fn parse<'i, 't>(
         context: &ParserContext,
         input: &mut Parser<'i, 't>,
     ) -> Result<Self, ParseError<'i>> {
         let first = AbsoluteFontWeight::parse(context, input)?;
-        let second =
-            input.try(|input| AbsoluteFontWeight::parse(context, input)).ok();
+        let second = input
+            .try(|input| AbsoluteFontWeight::parse(context, input))
+            .ok();
         Ok(FontWeight(first, second))
     }
 }
 
 /// The font-stretch descriptor:
 ///
 /// https://drafts.csswg.org/css-fonts-4/#descdef-font-face-font-stretch
 #[derive(Clone, Debug, PartialEq, ToCss)]
 pub struct FontStretch(pub SpecifiedFontStretch, pub Option<SpecifiedFontStretch>);
 
 impl Parse for FontStretch {
     fn parse<'i, 't>(
         context: &ParserContext,
         input: &mut Parser<'i, 't>,
     ) -> Result<Self, ParseError<'i>> {
         let first = SpecifiedFontStretch::parse(context, input)?;
-        let second =
-            input.try(|input| SpecifiedFontStretch::parse(context, input)).ok();
+        let second = input
+            .try(|input| SpecifiedFontStretch::parse(context, input))
+            .ok();
         Ok(FontStretch(first, second))
     }
 }
 
 /// The font-style descriptor:
 ///
 /// https://drafts.csswg.org/css-fonts-4/#descdef-font-face-font-style
 #[derive(Clone, Debug, PartialEq)]
@@ -144,22 +146,22 @@ impl Parse for FontStyle {
         context: &ParserContext,
         input: &mut Parser<'i, 't>,
     ) -> Result<Self, ParseError<'i>> {
         let style = SpecifiedFontStyle::parse(context, input)?;
         Ok(match style {
             GenericFontStyle::Normal => FontStyle::Normal,
             GenericFontStyle::Italic => FontStyle::Italic,
             GenericFontStyle::Oblique(angle) => {
-                let second_angle = input.try(|input| {
-                    SpecifiedFontStyle::parse_angle(context, input)
-                }).unwrap_or_else(|_| angle.clone());
+                let second_angle = input
+                    .try(|input| SpecifiedFontStyle::parse_angle(context, input))
+                    .unwrap_or_else(|_| angle.clone());
 
                 FontStyle::Oblique(angle, second_angle)
-            }
+            },
         })
     }
 }
 
 impl ToCss for FontStyle {
     fn to_css<W>(&self, dest: &mut CssWriter<W>) -> fmt::Result
     where
         W: fmt::Write,
@@ -173,17 +175,17 @@ impl ToCss for FontStyle {
                     dest.write_char(' ')?;
                     first.to_css(dest)?;
                 }
                 if first != second {
                     dest.write_char(' ')?;
                     second.to_css(dest)?;
                 }
                 Ok(())
-            }
+            },
         }
     }
 }
 
 /// Parse the block inside a `@font-face` rule.
 ///
 /// Note that the prelude parsing code lives in the `stylesheets` module.
 pub fn parse_font_face_block(
@@ -230,25 +232,23 @@ impl<'a> FontFace<'a> {
                 .iter()
                 .rev()
                 .filter(|source| {
                     if let Source::Url(ref url_source) = **source {
                         let hints = &url_source.format_hints;
                         // We support only opentype fonts and truetype is an alias for
                         // that format. Sources without format hints need to be
                         // downloaded in case we support them.
-                        hints.is_empty() ||
-                            hints.iter().any(|hint| {
-                                hint == "truetype" || hint == "opentype" || hint == "woff"
-                            })
+                        hints.is_empty() || hints
+                            .iter()
+                            .any(|hint| hint == "truetype" || hint == "opentype" || hint == "woff")
                     } else {
                         true
                     }
-                })
-                .cloned()
+                }).cloned()
                 .collect(),
         )
     }
 }
 
 #[cfg(feature = "servo")]
 impl Iterator for EffectiveSources {
     type Item = Source;
--- a/servo/components/style/gecko/conversions.rs
+++ b/servo/components/style/gecko/conversions.rs
@@ -135,20 +135,17 @@ impl Angle {
             nsCSSUnit::eCSSUnit_Grad => Angle::Grad(value),
             nsCSSUnit::eCSSUnit_Radian => Angle::Rad(value),
             nsCSSUnit::eCSSUnit_Turn => Angle::Turn(value),
             _ => panic!("Unexpected unit for angle"),
         }
     }
 }
 
-fn line_direction(
-    horizontal: LengthOrPercentage,
-    vertical: LengthOrPercentage,
-) -> LineDirection {
+fn line_direction(horizontal: LengthOrPercentage, vertical: LengthOrPercentage) -> LineDirection {
     use values::computed::position::Position;
     use values::specified::position::{X, Y};
 
     let horizontal_percentage = match horizontal {
         LengthOrPercentage::Percentage(percentage) => Some(percentage.0),
         _ => None,
     };
 
@@ -173,28 +170,28 @@ fn line_direction(
         } else if percentage == 1.0 {
             Some(Y::Bottom)
         } else {
             None
         }
     });
 
     if let (Some(hc), Some(vc)) = (horizontal_as_corner, vertical_as_corner) {
-        return LineDirection::Corner(hc, vc)
+        return LineDirection::Corner(hc, vc);
     }
 
     if let Some(hc) = horizontal_as_corner {
         if vertical_percentage == Some(0.5) {
-            return LineDirection::Horizontal(hc)
+            return LineDirection::Horizontal(hc);
         }
     }
 
     if let Some(vc) = vertical_as_corner {
         if horizontal_percentage == Some(0.5) {
-            return LineDirection::Vertical(vc)
+            return LineDirection::Vertical(vc);
         }
     }
 
     LineDirection::MozPosition(
         Some(Position {
             horizontal,
             vertical,
         }),
@@ -207,17 +204,20 @@ impl nsStyleImage {
     pub fn set(&mut self, image: Image) {
         match image {
             GenericImage::Gradient(boxed_gradient) => self.set_gradient(*boxed_gradient),
             GenericImage::Url(ref url) => unsafe {
                 bindings::Gecko_SetLayerImageImageValue(self, url.0.image_value.get());
             },
             GenericImage::Rect(ref image_rect) => {
                 unsafe {
-                    bindings::Gecko_SetLayerImageImageValue(self, image_rect.url.0.image_value.get());
+                    bindings::Gecko_SetLayerImageImageValue(
+                        self,
+                        image_rect.url.0.image_value.get(),
+                    );
                     bindings::Gecko_InitializeImageCropRect(self);
 
                     // Set CropRect
                     let ref mut rect = *self.mCropRect.mPtr;
                     image_rect
                         .top
                         .to_gecko_style_coord(&mut rect.data_at_mut(0));
                     image_rect
@@ -486,17 +486,18 @@ impl nsStyleImage {
                 Some(GenericImage::Element(Atom::from_raw(atom)))
             },
             _ => panic!("Unexpected image type"),
         }
     }
 
     unsafe fn get_image_url(&self) -> ComputedImageUrl {
         let image_request = bindings::Gecko_GetImageRequest(self)
-            .as_ref().expect("Null image request?");
+            .as_ref()
+            .expect("Null image request?");
         ComputedImageUrl::from_image_request(image_request)
     }
 
     unsafe fn get_gradient(self: &nsStyleImage) -> Box<Gradient> {
         use self::structs::NS_STYLE_GRADIENT_SIZE_CLOSEST_CORNER as CLOSEST_CORNER;
         use self::structs::NS_STYLE_GRADIENT_SIZE_CLOSEST_SIDE as CLOSEST_SIDE;
         use self::structs::NS_STYLE_GRADIENT_SIZE_FARTHEST_CORNER as FARTHEST_CORNER;
         use self::structs::NS_STYLE_GRADIENT_SIZE_FARTHEST_SIDE as FARTHEST_SIDE;
@@ -550,19 +551,19 @@ impl nsStyleImage {
                         _ => panic!("Found unexpected gecko_size"),
                     }
                 };
 
                 let shape = match gecko_gradient.mShape as u32 {
                     structs::NS_STYLE_GRADIENT_SHAPE_CIRCULAR => {
                         let circle = match gecko_gradient.mSize as u32 {
                             structs::NS_STYLE_GRADIENT_SIZE_EXPLICIT_SIZE => {
-                                let radius = Length::from_gecko_style_coord(
-                                    &gecko_gradient.mRadiusX,
-                                ).expect("mRadiusX could not convert to Length");
+                                let radius =
+                                    Length::from_gecko_style_coord(&gecko_gradient.mRadiusX)
+                                        .expect("mRadiusX could not convert to Length");
                                 debug_assert_eq!(
                                     radius,
                                     Length::from_gecko_style_coord(&gecko_gradient.mRadiusY)
                                         .unwrap()
                                 );
                                 Circle::Radius(radius)
                             },
                             size => Circle::Extent(gecko_size_to_keyword(size)),
@@ -627,18 +628,17 @@ impl nsStyleImage {
                             .expect("mLocation could not convert to LengthOrPercentage"),
                     )
                 } else {
                     GradientItem::ColorStop(ColorStop {
                         color: stop.mColor.into(),
                         position: LengthOrPercentage::from_gecko_style_coord(&stop.mLocation),
                     })
                 }
-            })
-            .collect();
+            }).collect();
 
         let compat_mode = if gecko_gradient.mMozLegacySyntax {
             CompatMode::Moz
         } else if gecko_gradient.mLegacySyntax {
             CompatMode::WebKit
         } else {
             CompatMode::Modern
         };
@@ -714,18 +714,20 @@ pub mod basic_shape {
 
         /// Generate a SVGPathData from StyleShapeSource if possible.
         fn to_svg_path(&self) -> Option<SVGPathData> {
             use gecko_bindings::structs::StylePathCommand;
             use values::specified::svg_path::PathCommand;
             match self.mType {
                 StyleShapeSourceType::Path => {
                     let gecko_path = unsafe { &*self.__bindgen_anon_1.mSVGPath.as_ref().mPtr };
-                    let result: Vec<PathCommand> =
-                        gecko_path.mPath.iter().map(|gecko: &StylePathCommand| {
+                    let result: Vec<PathCommand> = gecko_path
+                        .mPath
+                        .iter()
+                        .map(|gecko: &StylePathCommand| {
                             // unsafe: cbindgen ensures the representation is the same.
                             unsafe { ::std::mem::transmute(*gecko) }
                         }).collect();
                     Some(SVGPathData::new(result.into_boxed_slice()))
                 },
                 _ => None,
             }
         }
@@ -817,21 +819,25 @@ pub mod basic_shape {
                         FillRule::Nonzero
                     };
                     let mut coords = Vec::with_capacity(other.mCoordinates.len() / 2);
                     for i in 0..(other.mCoordinates.len() / 2) {
                         let x = 2 * i;
                         let y = x + 1;
                         coords.push(PolygonCoord(
                             LengthOrPercentage::from_gecko_style_coord(&other.mCoordinates[x])
-                                .expect("polygon() coordinate should be a length, percentage, \
-                                        or calc value"),
+                                .expect(
+                                    "polygon() coordinate should be a length, percentage, \
+                                     or calc value",
+                                ),
                             LengthOrPercentage::from_gecko_style_coord(&other.mCoordinates[y])
-                                .expect("polygon() coordinate should be a length, percentage, \
-                                        or calc value")
+                                .expect(
+                                    "polygon() coordinate should be a length, percentage, \
+                                     or calc value",
+                                ),
                         ))
                     }
                     GenericBasicShape::Polygon(Polygon {
                         fill: fill_rule,
                         coordinates: coords,
                     })
                 },
             }
--- a/servo/components/style/gecko/data.rs
+++ b/servo/components/style/gecko/data.rs
@@ -24,17 +24,18 @@ use stylist::Stylist;
 
 /// Little wrapper to a Gecko style sheet.
 #[derive(Eq, PartialEq)]
 pub struct GeckoStyleSheet(*const DomStyleSheet);
 
 impl fmt::Debug for GeckoStyleSheet {
     fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
         let contents = self.contents();
-        formatter.debug_struct("GeckoStyleSheet")
+        formatter
+            .debug_struct("GeckoStyleSheet")
             .field("origin", &contents.origin)
             .field("url_data", &*contents.url_data.read())
             .finish()
     }
 }
 
 impl ToMediaListKey for ::gecko::data::GeckoStyleSheet {
     fn to_media_list_key(&self) -> MediaListKey {
@@ -61,19 +62,17 @@ impl GeckoStyleSheet {
     }
 
     /// Get the raw `StyleSheet` that we're wrapping.
     pub fn raw(&self) -> &DomStyleSheet {
         unsafe { &*self.0 }
     }
 
     fn inner(&self) -> &StyleSheetInfo {
-        unsafe {
-            &*(self.raw().mInner as *const StyleSheetInfo)
-        }
+        unsafe { &*(self.raw().mInner as *const StyleSheetInfo) }
     }
 
     /// Gets the StylesheetContents for this stylesheet.
     pub fn contents(&self) -> &StylesheetContents {
         debug_assert!(!self.inner().mContents.mRawPtr.is_null());
         unsafe {
             let contents =
                 (&**StylesheetContents::as_arc(&&*self.inner().mContents.mRawPtr)) as *const _;
@@ -188,17 +187,18 @@ impl PerDocumentStyleDataImpl {
     /// Get the default computed values for this document.
     pub fn default_computed_values(&self) -> &Arc<ComputedValues> {
         self.stylist.device().default_computed_values_arc()
     }
 
     /// Returns whether visited styles are enabled.
     #[inline]
     pub fn visited_styles_enabled(&self) -> bool {
-        let doc = self.stylist
+        let doc = self
+            .stylist
             .device()
             .pres_context()
             .mDocument
             .raw::<nsIDocument>();
         unsafe { bindings::Gecko_VisitedStylesEnabled(doc) }
     }
 
     /// Measure heap usage.
--- a/servo/components/style/gecko/media_features.rs
+++ b/servo/components/style/gecko/media_features.rs
@@ -16,30 +16,26 @@ use values::computed::CSSPixelLength;
 use values::computed::Resolution;
 
 fn viewport_size(device: &Device) -> Size2D<Au> {
     let pc = device.pres_context();
     if pc.mIsRootPaginatedDocument() != 0 {
         // We want the page size, including unprintable areas and margins.
         // FIXME(emilio, bug 1414600): Not quite!
         let area = &pc.mPageSize;
-        return Size2D::new(Au(area.width), Au(area.height))
+        return Size2D::new(Au(area.width), Au(area.height));
     }
     device.au_viewport_size()
 }
 
 fn device_size(device: &Device) -> Size2D<Au> {
     let mut width = 0;
     let mut height = 0;
     unsafe {
-        bindings::Gecko_MediaFeatures_GetDeviceSize(
-            device.document(),
-            &mut width,
-            &mut height,
-        );
+        bindings::Gecko_MediaFeatures_GetDeviceSize(device.document(), &mut width, &mut height);
     }
     Size2D::new(Au(width), Au(height))
 }
 
 /// https://drafts.csswg.org/mediaqueries-4/#width
 fn eval_width(
     device: &Device,
     value: Option<CSSPixelLength>,
@@ -147,21 +143,17 @@ fn eval_device_pixel_ratio(
 
 #[derive(Clone, Copy, Debug, FromPrimitive, Parse, ToCss)]
 #[repr(u8)]
 enum Orientation {
     Landscape,
     Portrait,
 }
 
-fn eval_orientation_for<F>(
-    device: &Device,
-    value: Option<Orientation>,
-    get_size: F,
-) -> bool
+fn eval_orientation_for<F>(device: &Device, value: Option<Orientation>, get_size: F) -> bool
 where
     F: FnOnce(&Device) -> Size2D<Au>,
 {
     let query_orientation = match value {
         Some(v) => v,
         None => return true,
     };
 
@@ -171,74 +163,60 @@ where
     let is_landscape = size.width > size.height;
     match query_orientation {
         Orientation::Landscape => is_landscape,
         Orientation::Portrait => !is_landscape,
     }
 }
 
 /// https://drafts.csswg.org/mediaqueries-4/#orientation
-fn eval_orientation(
-    device: &Device,
-    value: Option<Orientation>,
-) -> bool {
+fn eval_orientation(device: &Device, value: Option<Orientation>) -> bool {
     eval_orientation_for(device, value, viewport_size)
 }
 
 /// FIXME: There's no spec for `-moz-device-orientation`.
-fn eval_device_orientation(
-    device: &Device,
-    value: Option<Orientation>,
-) -> bool {
+fn eval_device_orientation(device: &Device, value: Option<Orientation>) -> bool {
     eval_orientation_for(device, value, device_size)
 }
 
 /// Values for the display-mode media feature.
 #[derive(Clone, Copy, Debug, FromPrimitive, Parse, ToCss)]
 #[repr(u8)]
 #[allow(missing_docs)]
 pub enum DisplayMode {
-  Browser = 0,
-  MinimalUi,
-  Standalone,
-  Fullscreen,
+    Browser = 0,
+    MinimalUi,
+    Standalone,
+    Fullscreen,
 }
 
 /// https://w3c.github.io/manifest/#the-display-mode-media-feature
-fn eval_display_mode(
-    device: &Device,
-    query_value: Option<DisplayMode>,
-) -> bool {
+fn eval_display_mode(device: &Device, query_value: Option<DisplayMode>) -> bool {
     let query_value = match query_value {
         Some(v) => v,
         None => return true,
     };
 
-    let gecko_display_mode = unsafe {
-        bindings::Gecko_MediaFeatures_GetDisplayMode(device.document())
-    };
+    let gecko_display_mode =
+        unsafe { bindings::Gecko_MediaFeatures_GetDisplayMode(device.document()) };
 
     // NOTE: cbindgen guarantees the same representation.
     gecko_display_mode as u8 == query_value as u8
 }
 
 /// https://drafts.csswg.org/mediaqueries-4/#grid
 fn eval_grid(_: &Device, query_value: Option<bool>, _: Option<RangeOrOperator>) -> bool {
     // Gecko doesn't support grid devices (e.g., ttys), so the 'grid' feature
     // is always 0.
     let supports_grid = false;
     query_value.map_or(supports_grid, |v| v == supports_grid)
 }
 
 /// https://compat.spec.whatwg.org/#css-media-queries-webkit-transform-3d
-fn eval_transform_3d(
-    _: &Device,
-    query_value: Option<bool>,
-    _: Option<RangeOrOperator>,
-) -> bool {
+fn eval_transform_3d(_: &Device, query_value: Option<bool>, _: Option<RangeOrOperator>) -> bool {
     let supports_transforms = true;
     query_value.map_or(supports_transforms, |v| v == supports_transforms)
 }
 
 #[derive(Clone, Copy, Debug, FromPrimitive, Parse, ToCss)]
 #[repr(u8)]
 enum Scan {
     Progressive,
@@ -255,81 +233,65 @@ fn eval_scan(_: &Device, _: Option<Scan>
 /// https://drafts.csswg.org/mediaqueries-4/#color
 fn eval_color(
     device: &Device,
     query_value: Option<u32>,
     range_or_operator: Option<RangeOrOperator>,
 ) -> bool {
     let color_bits_per_channel =
         unsafe { bindings::Gecko_MediaFeatures_GetColorDepth(device.document()) };
-    RangeOrOperator::evaluate(
-        range_or_operator,
-        query_value,
-        color_bits_per_channel,
-    )
+    RangeOrOperator::evaluate(range_or_operator, query_value, color_bits_per_channel)
 }
 
 /// https://drafts.csswg.org/mediaqueries-4/#color-index
 fn eval_color_index(
     _: &Device,
     query_value: Option<u32>,
     range_or_operator: Option<RangeOrOperator>,
 ) -> bool {
     // We should return zero if the device does not use a color lookup table.
     let index = 0;
-    RangeOrOperator::evaluate(
-        range_or_operator,
-        query_value,
-        index,
-    )
+    RangeOrOperator::evaluate(range_or_operator, query_value, index)
 }
 
 /// https://drafts.csswg.org/mediaqueries-4/#monochrome
 fn eval_monochrome(
     _: &Device,
     query_value: Option<u32>,
     range_or_operator: Option<RangeOrOperator>,
 ) -> bool {
     // For color devices we should return 0.
     // FIXME: On a monochrome device, return the actual color depth, not 0!
     let depth = 0;
-    RangeOrOperator::evaluate(
-        range_or_operator,
-        query_value,
-        depth,
-    )
+    RangeOrOperator::evaluate(range_or_operator, query_value, depth)
 }
 
 /// https://drafts.csswg.org/mediaqueries-4/#resolution
 fn eval_resolution(
     device: &Device,
     query_value: Option<Resolution>,
     range_or_operator: Option<RangeOrOperator>,
 ) -> bool {
-    let resolution_dppx =
-        unsafe { bindings::Gecko_MediaFeatures_GetResolution(device.document()) };
+    let resolution_dppx = unsafe { bindings::Gecko_MediaFeatures_GetResolution(device.document()) };
     RangeOrOperator::evaluate(
         range_or_operator,
         query_value.map(|r| r.dppx()),
         resolution_dppx,
     )
 }
 
 #[derive(Clone, Copy, Debug, FromPrimitive, Parse, ToCss)]
 #[repr(u8)]
 enum PrefersReducedMotion {
     NoPreference,
     Reduce,
 }
 
 /// https://drafts.csswg.org/mediaqueries-5/#prefers-reduced-motion
-fn eval_prefers_reduced_motion(
-    device: &Device,
-    query_value: Option<PrefersReducedMotion>,
-) -> bool {
+fn eval_prefers_reduced_motion(device: &Device, query_value: Option<PrefersReducedMotion>) -> bool {
     let prefers_reduced =
         unsafe { bindings::Gecko_MediaFeatures_PrefersReducedMotion(device.document()) };
     let query_value = match query_value {
         Some(v) => v,
         None => return prefers_reduced,
     };
 
     match query_value {
@@ -347,19 +309,18 @@ fn eval_moz_is_glyph(
     query_value.map_or(is_glyph, |v| v == is_glyph)
 }
 
 fn eval_moz_is_resource_document(
     device: &Device,
     query_value: Option<bool>,
     _: Option<RangeOrOperator>,
 ) -> bool {
-    let is_resource_doc  = unsafe {
-        bindings::Gecko_MediaFeatures_IsResourceDocument(device.document())
-    };
+    let is_resource_doc =
+        unsafe { bindings::Gecko_MediaFeatures_IsResourceDocument(device.document()) };
     query_value.map_or(is_resource_doc, |v| v == is_resource_doc)
 }
 
 fn eval_system_metric(
     device: &Device,
     query_value: Option<bool>,
     metric: Atom,
     accessible_from_content: bool,
@@ -392,47 +353,40 @@ fn eval_moz_os_version(
     query_value: Option<Atom>,
     _: Option<RangeOrOperator>,
 ) -> bool {
     let query_value = match query_value {
         Some(v) => v,
         None => return false,
     };
 
-    let os_version = unsafe {
-        bindings::Gecko_MediaFeatures_GetOperatingSystemVersion(device.document())
-    };
+    let os_version =
+        unsafe { bindings::Gecko_MediaFeatures_GetOperatingSystemVersion(device.document()) };
 
     query_value.as_ptr() == os_version
 }
 
 macro_rules! system_metric_feature {
-    ($feature_name:expr) => {
-        {
-            fn __eval(
-                device: &Device,
-                query_value: Option<bool>,
-                _: Option<RangeOrOperator>,
-            ) -> bool {
-                eval_system_metric(
-                    device,
-                    query_value,
-                    $feature_name,
-                    /* accessible_from_content = */ false,
-                )
-            }
-
-            feature!(
+    ($feature_name:expr) => {{
+        fn __eval(device: &Device, query_value: Option<bool>, _: Option<RangeOrOperator>) -> bool {
+            eval_system_metric(
+                device,
+                query_value,
                 $feature_name,
-                AllowsRanges::No,
-                Evaluator::BoolInteger(__eval),
-                ParsingRequirements::CHROME_AND_UA_ONLY,
+                /* accessible_from_content = */ false,
             )
         }
-    }
+
+        feature!(
+            $feature_name,
+            AllowsRanges::No,
+            Evaluator::BoolInteger(__eval),
+            ParsingRequirements::CHROME_AND_UA_ONLY,
+        )
+    }};
 }
 
 lazy_static! {
     /// Adding new media features requires (1) adding the new feature to this
     /// array, with appropriate entries (and potentially any new code needed
     /// to support new types in these entries and (2) ensuring that either
     /// nsPresContext::MediaFeatureValuesChanged is called when the value that
     /// would be returned by the evaluator function could change.
--- a/servo/components/style/gecko/media_queries.rs
+++ b/servo/components/style/gecko/media_queries.rs
@@ -121,17 +121,18 @@ impl Device {
     /// Get the font size of the root element (for rem)
     pub fn root_font_size(&self) -> Au {
         self.used_root_font_size.store(true, Ordering::Relaxed);
         Au::new(self.root_font_size.load(Ordering::Relaxed) as i32)
     }
 
     /// Set the font size of the root element (for rem)
     pub fn set_root_font_size(&self, size: Au) {
-        self.root_font_size.store(size.0 as isize, Ordering::Relaxed)
+        self.root_font_size
+            .store(size.0 as isize, Ordering::Relaxed)
     }
 
     /// Sets the body text color for the "inherit color from body" quirk.
     ///
     /// <https://quirks.spec.whatwg.org/#the-tables-inherit-color-from-body-quirk>
     pub fn set_body_text_color(&self, color: RGBA) {
         self.body_text_color
             .store(convert_rgba_to_nscolor(&color) as usize, Ordering::Relaxed)
--- a/servo/components/style/gecko/pseudo_element.rs
+++ b/servo/components/style/gecko/pseudo_element.rs
@@ -57,17 +57,19 @@ impl PseudoElement {
         PseudoElementCascadeType::Lazy
     }
 
     /// Whether cascading this pseudo-element makes it inherit all properties,
     /// even reset ones.
     ///
     /// This is used in Servo for anonymous boxes, though it's likely broken.
     #[inline]
-    pub fn inherits_all(&self) -> bool { false }
+    pub fn inherits_all(&self) -> bool {
+        false
+    }
 
     /// Whether the pseudo-element should inherit from the default computed
     /// values instead of from the parent element.
     ///
     /// This is not the common thing, but there are some pseudos (namely:
     /// ::backdrop), that shouldn't inherit from the parent element.
     pub fn inherits_from_default_values(&self) -> bool {
         matches!(*self, PseudoElement::Backdrop)
--- a/servo/components/style/gecko/rules.rs
+++ b/servo/components/style/gecko/rules.rs
@@ -83,30 +83,30 @@ macro_rules! descriptor_range_conversion
     ($name:ident) => {
         impl<'a> ToNsCssValue for &'a $name {
             fn convert(self, nscssvalue: &mut nsCSSValue) {
                 let $name(ref first, ref second) = *self;
                 let second = match *second {
                     None => {
                         nscssvalue.set_from(first);
                         return;
-                    }
+                    },
                     Some(ref second) => second,
                 };
 
                 let mut a = nsCSSValue::null();
                 let mut b = nsCSSValue::null();
 
                 a.set_from(first);
                 b.set_from(second);
 
                 nscssvalue.set_pair(&a, &b);
             }
         }
-    }
+    };
 }
 
 descriptor_range_conversion!(FontWeight);
 descriptor_range_conversion!(FontStretch);
 
 impl<'a> ToNsCssValue for &'a FontStyle {
     fn convert(self, nscssvalue: &mut nsCSSValue) {
         match *self {
@@ -115,17 +115,17 @@ impl<'a> ToNsCssValue for &'a FontStyle 
             FontStyle::Oblique(ref first, ref second) => {
                 let mut a = nsCSSValue::null();
                 let mut b = nsCSSValue::null();
 
                 a.set_font_style(SpecifiedFontStyle::compute_angle(first).degrees());
                 b.set_font_style(SpecifiedFontStyle::compute_angle(second).degrees());
 
                 nscssvalue.set_pair(&a, &b);
-            }
+            },
         }
     }
 }
 
 impl<'a> ToNsCssValue for &'a font_language_override::SpecifiedValue {
     fn convert(self, nscssvalue: &mut nsCSSValue) {
         match *self {
             font_language_override::SpecifiedValue::Normal => nscssvalue.set_normal(),
--- a/servo/components/style/gecko/selector_parser.rs
+++ b/servo/components/style/gecko/selector_parser.rs
@@ -176,19 +176,18 @@ impl NonTSPseudoClass {
             NonTSPseudoClass::Fullscreen => unsafe {
                 mozilla::StaticPrefs_sVarCache_full_screen_api_unprefix_enabled
             },
             NonTSPseudoClass::Defined => unsafe {
                 structs::nsContentUtils_sIsCustomElementsEnabled
             },
             // Otherwise, a pseudo-class is enabled in content when it
             // doesn't have any enabled flag.
-            _ => !self.has_any_flag(
-                NonTSPseudoClassFlag::PSEUDO_CLASS_ENABLED_IN_UA_SHEETS_AND_CHROME,
-            ),
+            _ => !self
+                .has_any_flag(NonTSPseudoClassFlag::PSEUDO_CLASS_ENABLED_IN_UA_SHEETS_AND_CHROME),
         }
     }
 
     /// <https://drafts.csswg.org/selectors-4/#useraction-pseudos>
     ///
     /// We intentionally skip the link-related ones.
     pub fn is_safe_user_action_state(&self) -> bool {
         matches!(
@@ -228,18 +227,17 @@ impl NonTSPseudoClass {
             NonTSPseudoClass::MozWindowInactive => DocumentState::NS_DOCUMENT_STATE_WINDOW_INACTIVE,
             _ => DocumentState::empty(),
         }
     }
 
     /// Returns true if the given pseudoclass should trigger style sharing cache
     /// revalidation.
     pub fn needs_cache_revalidation(&self) -> bool {
-        self.state_flag().is_empty() &&
-            !matches!(*self,
+        self.state_flag().is_empty() && !matches!(*self,
                   // :-moz-any is handled by the revalidation visitor walking
                   // the things inside it; it does not need to cause
                   // revalidation on its own.
                   NonTSPseudoClass::MozAny(_) |
                   // :dir() depends on state only, but doesn't use state_flag
                   // because its semantics don't quite match.  Nevertheless, it
                   // doesn't need cache revalidation, because we already compare
                   // states for elements and candidates.
@@ -263,17 +261,18 @@ impl NonTSPseudoClass {
         )
     }
 
     /// Returns true if the evaluation of the pseudo-class depends on the
     /// element's attributes.
     pub fn is_attr_based(&self) -> bool {
         matches!(
             *self,
-            NonTSPseudoClass::MozTableBorderNonzero | NonTSPseudoClass::MozBrowserFrame |
+            NonTSPseudoClass::MozTableBorderNonzero |
+                NonTSPseudoClass::MozBrowserFrame |
                 NonTSPseudoClass::Lang(..)
         )
     }
 }
 
 impl ::selectors::parser::NonTSPseudoClass for NonTSPseudoClass {
     type Impl = SelectorImpl;
 
--- a/servo/components/style/gecko/snapshot_helpers.rs
+++ b/servo/components/style/gecko/snapshot_helpers.rs
@@ -36,35 +36,47 @@ unsafe fn get_class_from_attr(attr: &str
         return Class::None;
     }
     if base_type == structs::nsAttrValue_ValueBaseType_eAtomBase {
         return Class::One(ptr::<nsAtom>(attr));
     }
     debug_assert_eq!(base_type, structs::nsAttrValue_ValueBaseType_eOtherBase);
 
     let container = ptr::<structs::MiscContainer>(attr);
-    debug_assert_eq!((*container).mType, structs::nsAttrValue_ValueType_eAtomArray);
-    let array =
-        (*container).__bindgen_anon_1.mValue.as_ref().__bindgen_anon_1.mAtomArray.as_ref();
+    debug_assert_eq!(
+        (*container).mType,
+        structs::nsAttrValue_ValueType_eAtomArray
+    );
+    let array = (*container)
+        .__bindgen_anon_1
+        .mValue
+        .as_ref()
+        .__bindgen_anon_1
+        .mAtomArray
+        .as_ref();
     Class::More(&***array)
 }
 
 #[inline(always)]
 unsafe fn get_id_from_attr(attr: &structs::nsAttrValue) -> &WeakAtom {
-    debug_assert_eq!(base_type(attr), structs::nsAttrValue_ValueBaseType_eAtomBase);
+    debug_assert_eq!(
+        base_type(attr),
+        structs::nsAttrValue_ValueBaseType_eAtomBase
+    );
     WeakAtom::new(ptr::<nsAtom>(attr))
 }
 
 /// Find an attribute value with a given name and no namespace.
 #[inline(always)]
 pub fn find_attr<'a>(
     attrs: &'a [structs::AttrArray_InternalAttr],
     name: &Atom,
 ) -> Option<&'a structs::nsAttrValue> {
-    attrs.iter()
+    attrs
+        .iter()
         .find(|attr| attr.mName.mBits == name.as_ptr() as usize)
         .map(|attr| &attr.mValue)
 }
 
 /// Finds the id attribute from a list of attributes.
 #[inline(always)]
 pub fn get_id(attrs: &[structs::AttrArray_InternalAttr]) -> Option<&WeakAtom> {
     Some(unsafe { get_id_from_attr(find_attr(attrs, &atom!("id"))?) })
@@ -75,29 +87,27 @@ pub fn get_id(attrs: &[structs::AttrArra
 #[inline(always)]
 pub fn has_class(
     name: &Atom,
     case_sensitivity: CaseSensitivity,
     attr: &structs::nsAttrValue,
 ) -> bool {
     match unsafe { get_class_from_attr(attr) } {
         Class::None => false,
-        Class::One(atom) => unsafe {
-            case_sensitivity.eq_atom(name, WeakAtom::new(atom))
+        Class::One(atom) => unsafe { case_sensitivity.eq_atom(name, WeakAtom::new(atom)) },
+        Class::More(atoms) => match case_sensitivity {
+            CaseSensitivity::CaseSensitive => {
+                atoms.iter().any(|atom| atom.mRawPtr == name.as_ptr())
+            },
+            CaseSensitivity::AsciiCaseInsensitive => unsafe {
+                atoms
+                    .iter()
+                    .any(|atom| WeakAtom::new(atom.mRawPtr).eq_ignore_ascii_case(name))
+            },
         },
-        Class::More(atoms) => {
-            match case_sensitivity {
-                CaseSensitivity::CaseSensitive => {
-                    atoms.iter().any(|atom| atom.mRawPtr == name.as_ptr())
-                }
-                CaseSensitivity::AsciiCaseInsensitive => unsafe {
-                    atoms.iter().any(|atom| WeakAtom::new(atom.mRawPtr).eq_ignore_ascii_case(name))
-                }
-            }
-        }
     }
 }
 
 /// Given an item, a callback, and a getter, execute `callback` for each class
 /// this `item` has.
 #[inline(always)]
 pub fn each_class<F>(attr: &structs::nsAttrValue, mut callback: F)
 where
@@ -106,12 +116,12 @@ where
     unsafe {
         match get_class_from_attr(attr) {
             Class::None => {},
             Class::One(atom) => Atom::with(atom, callback),
             Class::More(atoms) => {
                 for atom in atoms {
                     Atom::with(atom.mRawPtr, &mut callback)
                 }
-            }
+            },
         }
     }
 }
--- a/servo/components/style/gecko/url.rs
+++ b/servo/components/style/gecko/url.rs
@@ -50,18 +50,17 @@ impl CssUrl {
     /// URLs in gecko, so we just return false here.
     /// use its |resolved| status.
     pub fn is_invalid(&self) -> bool {
         false
     }
 
     /// Convert from URLValueData to SpecifiedUrl.
     unsafe fn from_url_value_data(url: &URLValueData) -> Self {
-        let arc_type =
-            &url.mString as *const _ as *const RawOffsetArc<String>;
+        let arc_type = &url.mString as *const _ as *const RawOffsetArc<String>;
         CssUrl {
             serialization: Arc::from_raw_offset((*arc_type).clone()),
             extra_data: UrlExtraData(url.mExtraData.to_safe()),
         }
     }
 
     /// Returns true if this URL looks like a fragment.
     /// See https://drafts.csswg.org/css-values/#local-urls
@@ -135,17 +134,16 @@ impl SpecifiedUrl {
             // We do not expect Gecko_NewURLValue returns null.
             debug_assert!(!ptr.is_null());
             RefPtr::from_addrefed(ptr)
         };
         Self { url, url_value }
     }
 }
 
-
 impl PartialEq for SpecifiedUrl {
     fn eq(&self, other: &Self) -> bool {
         self.url.eq(&other.url)
     }
 }
 
 impl Eq for SpecifiedUrl {}
 
@@ -250,20 +248,17 @@ impl ToComputedValue for SpecifiedImageU
     }
 
     #[inline]
     fn from_computed_value(computed: &Self::ComputedValue) -> Self {
         computed.0.clone()
     }
 }
 
-fn serialize_computed_url<W>(
-    url_value_data: &URLValueData,
-    dest: &mut CssWriter<W>,
-) -> fmt::Result
+fn serialize_computed_url<W>(url_value_data: &URLValueData, dest: &mut CssWriter<W>) -> fmt::Result
 where
     W: Write,
 {
     dest.write_str("url(")?;
     unsafe {
         let mut string = nsCString::new();
         bindings::Gecko_GetComputedURLSpec(url_value_data, &mut string);
         string.as_str_unchecked().to_css(dest)?;
@@ -276,17 +271,17 @@ where
 /// The only difference between specified and computed URLs is the
 /// serialization.
 #[derive(Clone, Debug, Eq, MallocSizeOf, PartialEq)]
 pub struct ComputedUrl(pub SpecifiedUrl);
 
 impl ToCss for ComputedUrl {
     fn to_css<W>(&self, dest: &mut CssWriter<W>) -> fmt::Result
     where
-        W: Write
+        W: Write,
     {
         serialize_computed_url(&self.0.url_value._base, dest)
     }
 }
 
 impl ComputedUrl {
     /// Convert from RefPtr<URLValue> to ComputedUrl.
     pub unsafe fn from_url_value(url_value: RefPtr<URLValue>) -> Self {
@@ -297,17 +292,17 @@ impl ComputedUrl {
 
 /// The computed value of a CSS `url()` for image.
 #[derive(Clone, Debug, Eq, MallocSizeOf, PartialEq)]
 pub struct ComputedImageUrl(pub SpecifiedImageUrl);
 
 impl ToCss for ComputedImageUrl {
     fn to_css<W>(&self, dest: &mut CssWriter<W>) -> fmt::Result
     where
-        W: Write
+        W: Write,
     {
         serialize_computed_url(&self.0.image_value._base, dest)
     }
 }
 
 impl ComputedImageUrl {
     /// Convert from nsStyleImageReques to ComputedImageUrl.
     pub unsafe fn from_image_request(image_request: &nsStyleImageRequest) -> Self {
--- a/servo/components/style/gecko/values.rs
+++ b/servo/components/style/gecko/values.rs
@@ -483,17 +483,19 @@ where
             return Some(Perspective::None);
         }
         Some(Perspective::Length(L::from_gecko_style_coord(coord)?))
     }
 }
 
 /// Convert a given RGBA value to `nscolor`.
 pub fn convert_rgba_to_nscolor(rgba: &RGBA) -> u32 {
-    ((rgba.alpha as u32) << 24) | ((rgba.blue as u32) << 16) | ((rgba.green as u32) << 8) |
+    ((rgba.alpha as u32) << 24) |
+        ((rgba.blue as u32) << 16) |
+        ((rgba.green as u32) << 8) |
         (rgba.red as u32)
 }
 
 /// Convert a given `nscolor` to a Servo RGBA value.
 pub fn convert_nscolor_to_rgba(color: u32) -> RGBA {
     RGBA::new(
         (color & 0xff) as u8,
         (color >> 8 & 0xff) as u8,
@@ -532,18 +534,17 @@ impl CounterStyleOrNone {
             },
             CounterStyleOrNone::Symbols(symbols_type, symbols) => {
                 let symbols: Vec<_> = symbols
                     .0
                     .iter()
                     .map(|symbol| match *symbol {
                         Symbol::String(ref s) => nsCStr::from(s),
                         Symbol::Ident(_) => unreachable!("Should not have identifier in symbols()"),
-                    })
-                    .collect();
+                    }).collect();
                 let symbols: Vec<_> = symbols
                     .iter()
                     .map(|symbol| symbol as &nsACString as *const _)
                     .collect();
                 unsafe {
                     set_symbols(
                         gecko_value,
                         symbols_type.to_gecko_keyword(),
--- a/servo/components/style/gecko/wrapper.rs
+++ b/servo/components/style/gecko/wrapper.rs
@@ -81,17 +81,16 @@ use shared_lock::Locked;
 use std::cell::RefCell;
 use std::fmt;
 use std::hash::{Hash, Hasher};
 use std::mem;
 use std::ptr;
 use string_cache::{Atom, Namespace, WeakAtom, WeakNamespace};
 use stylist::CascadeData;
 
-
 #[inline]
 fn elements_with_id<'a, 'le>(
     array: *const structs::nsTArray<*mut RawGeckoElement>,
 ) -> &'a [GeckoElement<'le>] {
     unsafe {
         if array.is_null() {
             return &[];
         }
@@ -167,22 +166,21 @@ impl<'lr> TShadowRoot for GeckoShadowRoo
     }
 
     #[inline]
     fn style_data<'a>(&self) -> Option<&'a CascadeData>
     where
         Self: 'a,
     {
         let author_styles = unsafe {
-            (self.0.mServoStyles.mPtr
-                as *const structs::RawServoAuthorStyles
-                as *const bindings::RawServoAuthorStyles).as_ref()?
+            (self.0.mServoStyles.mPtr as *const structs::RawServoAuthorStyles
+                as *const bindings::RawServoAuthorStyles)
+                .as_ref()?
         };
 
-
         let author_styles = AuthorStyles::<GeckoStyleSheet>::from_ffi(author_styles);
 
         debug_assert!(
             author_styles.quirks_mode == self.as_node().owner_doc().quirks_mode() ||
                 author_styles.stylesheets.is_empty() ||
                 author_styles.stylesheets.dirty()
         );
 
@@ -370,17 +368,18 @@ impl<'ln> TNode for GeckoNode<'ln> {
     fn parent_node(&self) -> Option<Self> {
         unsafe { self.0.mParent.as_ref().map(GeckoNode) }
     }
 
     #[inline]
     fn first_child(&self) -> Option<Self> {
         unsafe {
             self.0
-                .mFirstChild.raw::<nsIContent>()
+                .mFirstChild
+                .raw::<nsIContent>()
                 .as_ref()
                 .map(GeckoNode::from_content)
         }
     }
 
     #[inline]
     fn last_child(&self) -> Option<Self> {
         unsafe { Gecko_GetLastChild(self.0).map(GeckoNode) }
@@ -390,17 +389,18 @@ impl<'ln> TNode for GeckoNode<'ln> {
     fn prev_sibling(&self) -> Option<Self> {
         unsafe { Gecko_GetPreviousSibling(self.0).map(GeckoNode) }
     }
 
     #[inline]
     fn next_sibling(&self) -> Option<Self> {
         unsafe {
             self.0
-                .mNextSibling.raw::<nsIContent>()
+                .mNextSibling
+                .raw::<nsIContent>()
                 .as_ref()
                 .map(GeckoNode::from_content)
         }
     }
 
     #[inline]
     fn owner_doc(&self) -> Self::ConcreteDocument {
         debug_assert!(!self.node_info().mDocument.is_null());
@@ -595,17 +595,17 @@ impl<'le> GeckoElement<'le> {
     fn get_class_attr(&self) -> Option<&structs::nsAttrValue> {
         if !self.may_have_class() {
             return None;
         }
 
         if self.is_svg_element() {
             let svg_class = unsafe { bindings::Gecko_GetSVGAnimatedClass(self.0).as_ref() };
             if let Some(c) = svg_class {
-                return Some(c)
+                return Some(c);
             }
         }
 
         snapshot_helpers::find_attr(self.attrs(), &atom!("class"))
     }
 
     #[inline]
     fn closest_anon_subtree_root_parent(&self) -> Option<Self> {
@@ -667,18 +667,17 @@ impl<'le> GeckoElement<'le> {
 
     /// Returns a reference to the extended DOM slots for this Element.
     #[inline]
     fn extended_slots(&self) -> Option<&structs::FragmentOrElement_nsExtendedDOMSlots> {
         self.dom_slots().and_then(|s| unsafe {
             // For the bit usage, see nsContentSlots::GetExtendedSlots.
             let e_slots = s._base.mExtendedSlots &
                 !structs::nsIContent_nsContentSlots_sNonOwningExtendedSlotsFlag;
-            (e_slots as *const structs::FragmentOrElement_nsExtendedDOMSlots)
-                .as_ref()
+            (e_slots as *const structs::FragmentOrElement_nsExtendedDOMSlots).as_ref()
         })
     }
 
     #[inline]
     fn may_be_in_binding_manager(&self) -> bool {
         self.flags() & (structs::NODE_MAY_BE_IN_BINDING_MNGR as u32) != 0
     }
 
@@ -714,45 +713,46 @@ impl<'le> GeckoElement<'le> {
             // rather than in slots.  So just get it through FFI for now.
             unsafe { bindings::Gecko_GetBindingParent(self.0).map(GeckoElement) }
         } else {
             let binding_parent = unsafe { self.non_xul_xbl_binding_parent_raw_content().as_ref() }
                 .map(GeckoNode::from_content)
                 .and_then(|n| n.as_element());
 
             debug_assert!(
-                binding_parent == unsafe {
-                    bindings::Gecko_GetBindingParent(self.0).map(GeckoElement)
-                }
+                binding_parent ==
+                    unsafe { bindings::Gecko_GetBindingParent(self.0).map(GeckoElement) }
             );
             binding_parent
         }
     }
 
     #[inline]
     fn non_xul_xbl_binding_parent_raw_content(&self) -> *mut nsIContent {
         debug_assert!(!self.is_xul_element());
-        self.extended_slots()
-            .map_or(ptr::null_mut(), |slots| slots._base.mBindingParent.raw::<nsIContent>())
+        self.extended_slots().map_or(ptr::null_mut(), |slots| {
+            slots._base.mBindingParent.raw::<nsIContent>()
+        })
     }
 
     #[inline]
     fn namespace_id(&self) -> i32 {
         self.as_node().node_info().mInner.mNamespaceID
     }
 
     #[inline]
     fn has_id(&self) -> bool {
         self.as_node()
             .get_bool_flag(nsINode_BooleanFlag::ElementHasID)
     }
 
     #[inline]
     fn state_internal(&self) -> u64 {
-        if !self.as_node()
+        if !self
+            .as_node()
             .get_bool_flag(nsINode_BooleanFlag::ElementHasLockedStyleStates)
         {
             return self.0.mState.mStates;
         }
         unsafe { Gecko_ElementState(self.0) }
     }
 
     #[inline]
@@ -873,19 +873,17 @@ impl<'le> GeckoElement<'le> {
 
     /// Returns true if this node is the shadow root of an use-element shadow tree.
     #[inline]
     fn is_root_of_use_element_shadow_tree(&self) -> bool {
         if !self.as_node().is_in_shadow_tree() {
             return false;
         }
         match self.containing_shadow_host() {
-            Some(e) => {
-                e.is_svg_element() && e.local_name() == &*local_name!("use")
-            },
+            Some(e) => e.is_svg_element() && e.local_name() == &*local_name!("use"),
             None => false,
         }
     }
 
     fn css_transitions_info(&self) -> FxHashMap<LonghandId, Arc<AnimationValue>> {
         use gecko_bindings::bindings::Gecko_ElementTransitions_EndValueAt;
         use gecko_bindings::bindings::Gecko_ElementTransitions_Length;
 
@@ -929,23 +927,22 @@ impl<'le> GeckoElement<'le> {
             return ***existing != after_value;
         }
 
         let from = AnimationValue::from_computed_values(longhand_id, before_change_style);
         let to = AnimationValue::from_computed_values(longhand_id, after_change_style);
 
         debug_assert_eq!(to.is_some(), from.is_some());
 
-        combined_duration > 0.0f32 && from != to &&
-            from.unwrap()
-                .animate(
-                    to.as_ref().unwrap(),
-                    Procedure::Interpolate { progress: 0.5 },
-                )
-                .is_ok()
+        combined_duration > 0.0f32 && from != to && from
+            .unwrap()
+            .animate(
+                to.as_ref().unwrap(),
+                Procedure::Interpolate { progress: 0.5 },
+            ).is_ok()
     }
 }
 
 /// Converts flags from the layout used by rust-selectors to the layout used
 /// by Gecko. We could align these and then do this without conditionals, but
 /// it's probably not worth the trouble.
 fn selector_flags_to_node_flags(flags: ElementSelectorFlags) -> u32 {
     use gecko_bindings::structs::*;
@@ -975,17 +972,19 @@ fn get_animation_rule(
 
     // There's a very rough correlation between the number of effects
     // (animations) on an element and the number of properties it is likely to
     // animate, so we use that as an initial guess for the size of the
     // AnimationValueMap in order to reduce the number of re-allocations needed.
     let effect_count = unsafe { Gecko_GetAnimationEffectCount(element.0) };
     // Also, we should try to reuse the PDB, to avoid creating extra rule nodes.
     let mut animation_values = AnimationValueMap::with_capacity_and_hasher(
-        effect_count.min(ANIMATABLE_PROPERTY_COUNT), Default::default());
+        effect_count.min(ANIMATABLE_PROPERTY_COUNT),
+        Default::default(),
+    );
     if unsafe {
         Gecko_GetAnimationRule(
             element.0,
             cascade_level,
             AnimationValueMap::as_ffi_mut(&mut animation_values),
         )
     } {
         let shared_lock = &GLOBAL_STYLE_DATA.shared_lock;
@@ -1079,29 +1078,33 @@ impl structs::FontSizePrefs {
 
 impl<'le> TElement for GeckoElement<'le> {
     type ConcreteNode = GeckoNode<'le>;
     type FontMetricsProvider = GeckoFontMetricsProvider;
     type TraversalChildrenIterator = GeckoChildrenIterator<'le>;
 
     fn inheritance_parent(&self) -> Option<Self> {
         if self.implemented_pseudo_element().is_some() {
-            return self.pseudo_element_originating_element()
+            return self.pseudo_element_originating_element();
         }
 
-        self.as_node().flattened_tree_parent().and_then(|n| n.as_element())
+        self.as_node()
+            .flattened_tree_parent()
+            .and_then(|n| n.as_element())
     }
 
     fn traversal_children(&self) -> LayoutIterator<GeckoChildrenIterator<'le>> {
         // This condition is similar to the check that
         // StyleChildrenIterator::IsNeeded does, except that it might return
         // true if we used to (but no longer) have anonymous content from
         // ::before/::after, XBL bindings, or nsIAnonymousContentCreators.
-        if self.is_in_anonymous_subtree() || self.has_xbl_binding_with_content() ||
-            self.is_html_slot_element() || self.shadow_root().is_some() ||
+        if self.is_in_anonymous_subtree() ||
+            self.has_xbl_binding_with_content() ||
+            self.is_html_slot_element() ||
+            self.shadow_root().is_some() ||
             self.may_have_anonymous_children()
         {
             unsafe {
                 let mut iter: structs::StyleChildrenIterator = ::std::mem::zeroed();
                 bindings::Gecko_ConstructStyleChildrenIterator(self.0, &mut iter);
                 return LayoutIterator(GeckoChildrenIterator::GeckoIterator(iter));
             }
         }
@@ -1152,27 +1155,26 @@ impl<'le> TElement for GeckoElement<'le>
         }
 
         // FIXME(emilio): Workaround a bindgen bug on Android that causes
         // mAssignedNodes to be at the wrong offset. See bug 1466406.
         //
         // Bug 1466580 tracks running the Android layout tests on automation.
         //
         // The actual bindgen bug still needs reduction.
-        let assigned_nodes: &[structs::RefPtr<structs::nsINode>] =
-            if !cfg!(target_os = "android") {
-                debug_assert_eq!(
-                    unsafe { bindings::Gecko_GetAssignedNodes(self.0) },
-                    &slot.mAssignedNodes as *const _,
-                );
+        let assigned_nodes: &[structs::RefPtr<structs::nsINode>] = if !cfg!(target_os = "android") {
+            debug_assert_eq!(
+                unsafe { bindings::Gecko_GetAssignedNodes(self.0) },
+                &slot.mAssignedNodes as *const _,
+            );
 
-                &*slot.mAssignedNodes
-            } else {
-                unsafe { &**bindings::Gecko_GetAssignedNodes(self.0) }
-            };
+            &*slot.mAssignedNodes
+        } else {
+            unsafe { &**bindings::Gecko_GetAssignedNodes(self.0) }
+        };
 
         debug_assert_eq!(
             mem::size_of::<structs::RefPtr<structs::nsINode>>(),
             mem::size_of::<Self::ConcreteNode>(),
             "Bad cast!"
         );
 
         unsafe { mem::transmute(assigned_nodes) }
@@ -1234,21 +1236,20 @@ impl<'le> TElement for GeckoElement<'le>
     }
 
     #[inline]
     fn as_node(&self) -> Self::ConcreteNode {
         unsafe { GeckoNode(&*(self.0 as *const _ as *const RawGeckoNode)) }
     }
 
     fn owner_doc_matches_for_testing(&self, device: &Device) -> bool {
-        self.as_node().owner_doc().0 as *const structs::nsIDocument ==
-            device
-                .pres_context()
-                .mDocument
-                .raw::<structs::nsIDocument>()
+        self.as_node().owner_doc().0 as *const structs::nsIDocument == device
+            .pres_context()
+            .mDocument
+            .raw::<structs::nsIDocument>()
     }
 
     fn style_attribute(&self) -> Option<ArcBorrow<Locked<PropertyDeclarationBlock>>> {
         if !self.may_have_style_attribute() {
             return None;
         }
 
         let declarations = unsafe { Gecko_GetStyleAttrDeclarationBlock(self.0) };
@@ -1373,17 +1374,18 @@ impl<'le> TElement for GeckoElement<'le>
         )
     }
 
     #[inline]
     unsafe fn clear_dirty_bits(&self) {
         self.unset_flags(
             ELEMENT_HAS_DIRTY_DESCENDANTS_FOR_SERVO as u32 |
                 ELEMENT_HAS_ANIMATION_ONLY_DIRTY_DESCENDANTS_FOR_SERVO as u32 |
-                NODE_DESCENDANTS_NEED_FRAMES as u32 | NODE_NEEDS_FRAME as u32,
+                NODE_DESCENDANTS_NEED_FRAMES as u32 |
+                NODE_NEEDS_FRAME as u32,
         )
     }
 
     fn is_visited_link(&self) -> bool {
         self.state().intersects(ElementState::IN_VISITED_STATE)
     }
 
     /// This logic is duplicated in Gecko's nsINode::IsInNativeAnonymousSubtree.
@@ -1433,18 +1435,20 @@ impl<'le> TElement for GeckoElement<'le>
             self.0.mServoData.set(ptr);
         }
         self.mutate_data().unwrap()
     }
 
     unsafe fn clear_data(&self) {
         let ptr = self.0.mServoData.get();
         self.unset_flags(
-            ELEMENT_HAS_SNAPSHOT as u32 | ELEMENT_HANDLED_SNAPSHOT as u32 |
-                structs::Element_kAllServoDescendantBits | NODE_NEEDS_FRAME as u32,
+            ELEMENT_HAS_SNAPSHOT as u32 |
+                ELEMENT_HANDLED_SNAPSHOT as u32 |
+                structs::Element_kAllServoDescendantBits |
+                NODE_NEEDS_FRAME as u32,
         );
         if !ptr.is_null() {
             debug!("Dropping ElementData for {:?}", self);
             let data = Box::from_raw(self.0.mServoData.get());
             self.0.mServoData.set(ptr::null_mut());
 
             // Perform a mutable borrow of the data in debug builds. This
             // serves as an assertion that there are no outstanding borrows
@@ -1663,31 +1667,29 @@ impl<'le> TElement for GeckoElement<'le>
             // We don't need to update transition for none/custom properties.
             if is_none_or_custom_property(property) {
                 continue;
             }
 
             let transition_property: TransitionProperty = property.into();
 
             let mut property_check_helper = |property: LonghandId| -> bool {
-                let property =
-                    property.to_physical(after_change_style.writing_mode);
+                let property = property.to_physical(after_change_style.writing_mode);
                 transitions_to_keep.insert(property);
                 self.needs_transitions_update_per_property(
                     property,
                     combined_duration,
                     before_change_style,
                     after_change_style,
                     &existing_transitions,
                 )
             };
 
             match transition_property {
-                TransitionProperty::Custom(..) |
-                TransitionProperty::Unsupported(..) => {},
+                TransitionProperty::Custom(..) | TransitionProperty::Unsupported(..) => {},
                 TransitionProperty::Shorthand(ref shorthand) => {
                     if shorthand.longhands().any(property_check_helper) {
                         return true;
                     }
                 },
                 TransitionProperty::Longhand(longhand_id) => {
                     if property_check_helper(longhand_id) {
                         return true;
@@ -1708,21 +1710,17 @@ impl<'le> TElement for GeckoElement<'le>
         let ptr = unsafe { bindings::Gecko_LangValue(self.0) };
         if ptr.is_null() {
             None
         } else {
             Some(unsafe { Atom::from_addrefed(ptr) })
         }
     }
 
-    fn match_element_lang(
-        &self,
-        override_lang: Option<Option<AttrValue>>,
-        value: &Lang,
-    ) -> bool {
+    fn match_element_lang(&self, override_lang: Option<Option<AttrValue>>, value: &Lang) -> bool {
         // Gecko supports :lang() from CSS Selectors 3, which only accepts a
         // single language tag, and which performs simple dash-prefix matching
         // on it.
         let override_lang_ptr = match &override_lang {
             &Some(Some(ref atom)) => atom.as_ptr(),
             _ => ptr::null_mut(),
         };
         unsafe {
@@ -1855,17 +1853,18 @@ impl<'le> TElement for GeckoElement<'le>
                 declarations.and_then(|s| s.as_arc_opt());
             if let Some(decl) = declarations {
                 hints.push(ApplicableDeclarationBlock::from_declarations(
                     decl.clone_arc(),
                     ServoCascadeLevel::PresHints,
                 ));
             }
 
-            let active = self.state()
+            let active = self
+                .state()
                 .intersects(NonTSPseudoClass::Active.state_flag());
             if active {
                 let declarations = unsafe { Gecko_GetActiveLinkAttrDeclarationBlock(self.0) };
                 let declarations: Option<
                     &RawOffsetArc<Locked<PropertyDeclarationBlock>>,
                 > = declarations.and_then(|s| s.as_arc_opt());
                 if let Some(decl) = declarations {
                     hints.push(ApplicableDeclarationBlock::from_declarations(
@@ -2065,30 +2064,38 @@ impl<'le> ::selectors::Element for Gecko
                     }
                 },
             }
         }
     }
 
     #[inline]
     fn is_root(&self) -> bool {
-        if self.as_node().get_bool_flag(nsINode_BooleanFlag::ParentIsContent) {
+        if self
+            .as_node()
+            .get_bool_flag(nsINode_BooleanFlag::ParentIsContent)
+        {
             return false;
         }
 
         if !self.as_node().is_in_document() {
             return false;
         }
 
-        debug_assert!(self.as_node().parent_node().map_or(false, |p| p.is_document()));
+        debug_assert!(
+            self.as_node()
+                .parent_node()
+                .map_or(false, |p| p.is_document())
+        );
         unsafe { bindings::Gecko_IsRootElement(self.0) }
     }
 
     fn is_empty(&self) -> bool {
-        !self.as_node()
+        !self
+            .as_node()
             .dom_children()
             .any(|child| unsafe { Gecko_IsSignificantChild(child.0, true) })
     }
 
     #[inline]
     fn local_name(&self) -> &WeakAtom {
         unsafe { WeakAtom::new(self.as_node().node_info().mInner.mName) }
     }
@@ -2189,17 +2196,18 @@ impl<'le> ::selectors::Element for Gecko
                         return false;
                     }
                     elem = next;
                 }
                 true
             },
             NonTSPseudoClass::MozOnlyWhitespace => {
                 flags_setter(self, ElementSelectorFlags::HAS_EMPTY_SELECTOR);
-                if self.as_node()
+                if self
+                    .as_node()
                     .dom_children()
                     .any(|c| c.contains_non_whitespace_content())
                 {
                     return false;
                 }
                 true
             },
             NonTSPseudoClass::MozNativeAnonymous => self.is_in_native_anonymous_subtree(),
@@ -2241,19 +2249,17 @@ impl<'le> ::selectors::Element for Gecko
                 let doc_is_rtl = self.document_state().contains(state_bit);
 
                 match dir.as_horizontal_direction() {
                     Some(HorizontalDirection::Ltr) => !doc_is_rtl,
                     Some(HorizontalDirection::Rtl) => doc_is_rtl,
                     None => false,
                 }
             },
-            NonTSPseudoClass::Dir(ref dir) => {
-                self.state().intersects(dir.element_state())
-            }
+            NonTSPseudoClass::Dir(ref dir) => self.state().intersects(dir.element_state()),
         }
     }
 
     fn match_pseudo_element(
         &self,
         pseudo_element: &PseudoElement,
         _context: &mut MatchingContext<Self::Impl>,
     ) -> bool {
--- a/servo/components/style/gecko_bindings/mod.rs
+++ b/servo/components/style/gecko_bindings/mod.rs
@@ -1,22 +1,33 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 //! Gecko's C++ bindings, along with some rust helpers to ease its use.
 
-#[allow(dead_code, improper_ctypes, non_camel_case_types, missing_docs)]
+#[allow(
+    dead_code,
+    improper_ctypes,
+    non_camel_case_types,
+    missing_docs
+)]
 pub mod bindings {
     include!(concat!(env!("OUT_DIR"), "/gecko/bindings.rs"));
 }
 
 // FIXME: We allow `improper_ctypes` (for now), because the lint doesn't allow
 // foreign structs to have `PhantomData`. We should remove this once the lint
 // ignores this case.
 
-#[allow(dead_code, improper_ctypes, non_camel_case_types, non_snake_case, non_upper_case_globals,
-        missing_docs)]
+#[allow(
+    dead_code,
+    improper_ctypes,
+    non_camel_case_types,
+    non_snake_case,
+    non_upper_case_globals,
+    missing_docs
+)]
 pub mod structs {
     include!(concat!(env!("OUT_DIR"), "/gecko/structs.rs"));
 }
 
 pub mod sugar;
--- a/servo/components/style/gecko_bindings/sugar/ns_style_coord.rs
+++ b/servo/components/style/gecko_bindings/sugar/ns_style_coord.rs
@@ -47,17 +47,18 @@ impl nsStyleCoord_CalcValue {
             mPercent: 0.0,
             mHasPercent: false,
         }
     }
 }
 
 impl PartialEq for nsStyleCoord_CalcValue {
     fn eq(&self, other: &Self) -> bool {
-        self.mLength == other.mLength && self.mPercent == other.mPercent &&
+        self.mLength == other.mLength &&
+            self.mPercent == other.mPercent &&
             self.mHasPercent == other.mHasPercent
     }
 }
 
 impl nsStyleSides {
     /// Immutably get the `nsStyleCoord`-like object representing the side at
     /// index `index`.
     #[inline]
@@ -404,30 +405,34 @@ pub unsafe trait CoordData {
         }
     }
 
     #[inline]
     /// Pretend inner value is a float; obtain it.
     unsafe fn get_float(&self) -> f32 {
         use gecko_bindings::structs::nsStyleUnit::*;
         debug_assert!(
-            self.unit() == eStyleUnit_Percent || self.unit() == eStyleUnit_Factor ||
-                self.unit() == eStyleUnit_Degree || self.unit() == eStyleUnit_Grad ||
-                self.unit() == eStyleUnit_Radian || self.unit() == eStyleUnit_Turn ||
+            self.unit() == eStyleUnit_Percent ||
+                self.unit() == eStyleUnit_Factor ||
+                self.unit() == eStyleUnit_Degree ||
+                self.unit() == eStyleUnit_Grad ||
+                self.unit() == eStyleUnit_Radian ||
+                self.unit() == eStyleUnit_Turn ||
                 self.unit() == eStyleUnit_FlexFraction
         );
         *self.union().mFloat.as_ref()
     }
 
     #[inline]
     /// Pretend inner value is an int; obtain it.
     unsafe fn get_integer(&self) -> i32 {
         use gecko_bindings::structs::nsStyleUnit::*;
         debug_assert!(
-            self.unit() == eStyleUnit_Coord || self.unit() == eStyleUnit_Integer ||
+            self.unit() == eStyleUnit_Coord ||
+                self.unit() == eStyleUnit_Integer ||
                 self.unit() == eStyleUnit_Enumerated
         );
         *self.union().mInt.as_ref()
     }
 
     #[inline]
     /// Pretend inner value is a calc; obtain it.
     /// Ensure that the unit is Calc before calling this.
--- a/servo/components/style/gecko_bindings/sugar/refptr.rs
+++ b/servo/components/style/gecko_bindings/sugar/refptr.rs
@@ -316,13 +316,9 @@ impl_threadsafe_refcount!(
 #[inline]
 unsafe fn addref_atom(atom: *mut structs::nsAtom) {
     mem::forget(Atom::from_raw(atom));
 }
 #[inline]
 unsafe fn release_atom(atom: *mut structs::nsAtom) {
     let _ = Atom::from_addrefed(atom);
 }
-impl_threadsafe_refcount!(
-    structs::nsAtom,
-    addref_atom,
-    release_atom
-);
+impl_threadsafe_refcount!(structs::nsAtom, addref_atom, release_atom);
--- a/servo/components/style/gecko_bindings/sugar/style_complex_color.rs
+++ b/servo/components/style/gecko_bindings/sugar/style_complex_color.rs
@@ -54,43 +54,43 @@ impl From<ComputedColor> for StyleComple
                 debug_assert!(ratios != ComplexColorRatios::NUMERIC);
                 debug_assert!(ratios != ComplexColorRatios::FOREGROUND);
                 StyleComplexColor {
                     mColor: convert_rgba_to_nscolor(&color).into(),
                     mBgRatio: ratios.bg,
                     mFgRatio: ratios.fg,
                     mTag: Tag::eComplex,
                 }
-            }
+            },
         }
     }
 }
 
 impl From<StyleComplexColor> for ComputedColor {
     fn from(other: StyleComplexColor) -> Self {
         match other.mTag {
             Tag::eNumeric => {
                 debug_assert!(other.mBgRatio == 1. && other.mFgRatio == 0.);
                 GenericColor::Numeric(convert_nscolor_to_rgba(other.mColor))
-            }
+            },
             Tag::eForeground => {
                 debug_assert!(other.mBgRatio == 0. && other.mFgRatio == 1.);
                 GenericColor::Foreground
-            }
+            },
             Tag::eComplex => {
                 debug_assert!(other.mBgRatio != 1. || other.mFgRatio != 0.);
                 debug_assert!(other.mBgRatio != 0. || other.mFgRatio != 1.);
                 GenericColor::Complex(
                     convert_nscolor_to_rgba(other.mColor),
                     ComplexColorRatios {
                         bg: other.mBgRatio,
                         fg: other.mFgRatio,
                     },
                 )
-            }
+            },
             Tag::eAuto => unreachable!("Unsupport StyleComplexColor with tag eAuto"),
         }
     }
 }
 
 impl From<ColorOrAuto> for StyleComplexColor {
     fn from(other: ColorOrAuto) -> Self {
         match other {
--- a/servo/components/style/invalidation/element/element_wrapper.rs
+++ b/servo/components/style/invalidation/element/element_wrapper.rs
@@ -41,17 +41,19 @@ pub trait ElementSnapshot: Sized {
     fn state(&self) -> Option<ElementState>;
 
     /// If this snapshot contains attribute information.
     fn has_attrs(&self) -> bool;
 
     /// Gets the attribute information of the snapshot as a string.
     ///
     /// Only for debugging purposes.
-    fn debug_list_attributes(&self) -> String { String::new() }
+    fn debug_list_attributes(&self) -> String {
+        String::new()
+    }
 
     /// The ID attribute per this snapshot. Should only be called if
     /// `has_attrs()` returns true.
     fn id_attr(&self) -> Option<&WeakAtom>;
 
     /// Whether this snapshot contains the class `name`. Should only be called
     /// if `has_attrs()` returns true.
     fn has_class(&self, name: &Atom, case_sensitivity: CaseSensitivity) -> bool;
@@ -228,31 +230,34 @@ where
                         return snapshot.mIsMozBrowserFrame();
                     }
                 }
             },
 
             // :lang() needs to match using the closest ancestor xml:lang="" or
             // lang="" attribtue from snapshots.
             NonTSPseudoClass::Lang(ref lang_arg) => {
-                return self.element
+                return self
+                    .element
                     .match_element_lang(Some(self.get_lang()), lang_arg);
             },
 
             _ => {},
         }
 
         let flag = pseudo_class.state_flag();
         if flag.is_empty() {
-            return self.element
+            return self
+                .element
                 .match_non_ts_pseudo_class(pseudo_class, context, &mut |_, _| {});
         }
         match self.snapshot().and_then(|s| s.state()) {
             Some(snapshot_state) => snapshot_state.intersects(flag),
-            None => self.element
+            None => self
+                .element
                 .match_non_ts_pseudo_class(pseudo_class, context, &mut |_, _| {}),
         }
     }
 
     fn match_pseudo_element(
         &self,
         pseudo_element: &PseudoElement,
         context: &mut MatchingContext<Self::Impl>,
--- a/servo/components/style/invalidation/element/invalidation_map.rs
+++ b/servo/components/style/invalidation/element/invalidation_map.rs
@@ -33,18 +33,20 @@ use smallvec::SmallVec;
 /// We generate a Dependency for both |a _ b:X _| and |a _ b:X _ c _ d:Y _|,
 /// even though those selectors may not appear on their own in any stylesheet.
 /// This allows us to quickly scan through the dependency sites of all style
 /// rules and determine the maximum effect that a given state or attribute
 /// change may have on the style of elements in the document.
 #[derive(Clone, Debug, MallocSizeOf)]
 pub struct Dependency {
     /// The dependency selector.
-    #[cfg_attr(feature = "gecko",
-               ignore_malloc_size_of = "CssRules have primary refs, we measure there")]
+    #[cfg_attr(
+        feature = "gecko",
+        ignore_malloc_size_of = "CssRules have primary refs, we measure there"
+    )]
     #[cfg_attr(feature = "servo", ignore_malloc_size_of = "Arc")]
     pub selector: Selector<SelectorImpl>,
 
     /// The offset into the selector that we should match on.
     pub selector_offset: usize,
 }
 
 /// The kind of elements down the tree this dependency may affect.
@@ -122,18 +124,20 @@ impl SelectorMapEntry for StateDependenc
     }
 }
 
 /// The same, but for document state selectors.
 #[derive(Clone, Debug, MallocSizeOf)]
 pub struct DocumentStateDependency {
     /// The selector that is affected. We don't need to track an offset, since
     /// when it changes it changes for the whole document anyway.
-    #[cfg_attr(feature = "gecko",
-               ignore_malloc_size_of = "CssRules have primary refs, we measure there")]
+    #[cfg_attr(
+        feature = "gecko",
+        ignore_malloc_size_of = "CssRules have primary refs, we measure there"
+    )]
     #[cfg_attr(feature = "servo", ignore_malloc_size_of = "Arc")]
     pub selector: Selector<SelectorImpl>,
     /// The state this dependency is affected by.
     pub state: DocumentState,
 }
 
 /// A map where we store invalidations.
 ///
@@ -180,17 +184,18 @@ impl InvalidationMap {
             other_attribute_affecting_selectors: SelectorMap::new(),
             has_class_attribute_selectors: false,
             has_id_attribute_selectors: false,
         }
     }
 
     /// Returns the number of dependencies stored in the invalidation map.
     pub fn len(&self) -> usize {
-        self.state_affecting_selectors.len() + self.document_state_selectors.len() +
+        self.state_affecting_selectors.len() +
+            self.document_state_selectors.len() +
             self.other_attribute_affecting_selectors.len() +
             self.id_to_selector
                 .iter()
                 .fold(0, |accum, (_, ref v)| accum + v.len()) +
             self.class_to_selector
                 .iter()
                 .fold(0, |accum, (_, ref v)| accum + v.len())
     }
--- a/servo/components/style/invalidation/element/restyle_hints.rs
+++ b/servo/components/style/invalidation/element/restyle_hints.rs
@@ -62,17 +62,18 @@ impl RestyleHint {
     /// descendants.
     pub fn contains_subtree(&self) -> bool {
         self.contains(RestyleHint::RESTYLE_SELF | RestyleHint::RESTYLE_DESCENDANTS)
     }
 
     /// Returns whether we need to restyle this element.
     pub fn has_non_animation_invalidations(&self) -> bool {
         self.intersects(
-            RestyleHint::RESTYLE_SELF | RestyleHint::RECASCADE_SELF |
+            RestyleHint::RESTYLE_SELF |
+                RestyleHint::RECASCADE_SELF |
                 (Self::replacements() & !Self::for_animations()),
         )
     }
 
     /// Propagates this restyle hint to a child element.
     pub fn propagate(&mut self, traversal_flags: &TraversalFlags) -> Self {
         use std::mem;
 
@@ -114,17 +115,18 @@ impl RestyleHint {
     /// Returns a hint that contains all the replacement hints.
     pub fn replacements() -> Self {
         RestyleHint::RESTYLE_STYLE_ATTRIBUTE | Self::for_animations()
     }
 
     /// The replacements for the animation cascade levels.
     #[inline]
     pub fn for_animations() -> Self {
-        RestyleHint::RESTYLE_SMIL | RestyleHint::RESTYLE_CSS_ANIMATIONS |
+        RestyleHint::RESTYLE_SMIL |
+            RestyleHint::RESTYLE_CSS_ANIMATIONS |
             RestyleHint::RESTYLE_CSS_TRANSITIONS
     }
 
     /// Returns whether the hint specifies that the currently element must be
     /// recascaded.
     pub fn has_recascade_self(&self) -> bool {
         self.contains(RestyleHint::RECASCADE_SELF)
     }
--- a/servo/components/style/invalidation/element/state_and_attributes.rs
+++ b/servo/components/style/invalidation/element/state_and_attributes.rs
@@ -195,27 +195,22 @@ where
         }
 
         if log_enabled!(::log::Level::Debug) {
             debug!("Collecting changes for: {:?}", element);
             if !state_changes.is_empty() {
                 debug!(" > state: {:?}", state_changes);
             }
             if snapshot.id_changed() {
-                debug!(
-                    " > id changed: +{:?} -{:?}",
-                    id_added,
-                    id_removed
-                );
+                debug!(" > id changed: +{:?} -{:?}", id_added, id_removed);
             }
             if snapshot.class_changed() {
                 debug!(
                     " > class changed: +{:?} -{:?}",
-                    classes_added,
-                    classes_removed
+                    classes_added, classes_removed
                 );
             }
             if snapshot.other_attr_changed() {
                 debug!(
                     " > attributes changed, old: {}",
                     snapshot.debug_list_attributes()
                 )
             }
@@ -228,17 +223,16 @@ where
         };
 
         let mut shadow_rule_datas = SmallVec::<[_; 3]>::new();
         let matches_document_author_rules =
             element.each_applicable_non_document_style_rule_data(|data, quirks_mode, host| {
                 shadow_rule_datas.push((data, quirks_mode, host.map(|h| h.opaque())))
             });
 
-
         let invalidated_self = {
             let mut collector = Collector {
                 wrapper,
                 lookup_element,
                 state_changes,
                 element,
                 snapshot: &snapshot,
                 matching_context: &mut self.matching_context,
@@ -405,20 +399,17 @@ where
                 }
                 self.scan_dependency(&dependency.dep);
                 true
             },
         );
     }
 
     /// Check whether a dependency should be taken into account.
-    fn check_dependency(
-        &mut self,
-        dependency: &Dependency,
-    ) -> bool {
+    fn check_dependency(&mut self, dependency: &Dependency) -> bool {
         let element = &self.element;
         let wrapper = &self.wrapper;
         let matches_now = matches_selector(
             &dependency.selector,
             dependency.selector_offset,
             None,
             element,
             &mut self.matching_context,
--- a/servo/components/style/lib.rs
+++ b/servo/components/style/lib.rs
@@ -195,17 +195,16 @@ pub mod properties {
 #[allow(unsafe_code)]
 pub mod gecko;
 
 // uses a macro from properties
 #[cfg(feature = "servo")]
 #[allow(unsafe_code)]
 pub mod servo;
 
-
 #[cfg(feature = "gecko")]
 #[allow(unsafe_code, missing_docs)]
 pub mod gecko_properties {
     include!(concat!(env!("OUT_DIR"), "/gecko_properties.rs"));
 }
 
 macro_rules! reexport_computed_values {
     ( $( { $name: ident, $boxed: expr } )+ ) => {
--- a/servo/components/style/logical_geometry.rs
+++ b/servo/components/style/logical_geometry.rs
@@ -952,18 +952,20 @@ impl<T: Copy> LogicalMargin<T> {
             LogicalMargin::from_physical(mode_to, self.to_physical(mode_from))
         }
     }
 }
 
 impl<T: PartialEq + Zero> LogicalMargin<T> {
     #[inline]
     pub fn is_zero(&self) -> bool {
-        self.block_start == Zero::zero() && self.inline_end == Zero::zero() &&
-            self.block_end == Zero::zero() && self.inline_start == Zero::zero()
+        self.block_start == Zero::zero() &&
+            self.inline_end == Zero::zero() &&
+            self.block_end == Zero::zero() &&
+            self.inline_start == Zero::zero()
     }
 }
 
 impl<T: Copy + Add<T, Output = T>> LogicalMargin<T> {
     #[inline]
     pub fn inline_start_end(&self) -> T {
         self.inline_start + self.inline_end
     }
--- a/servo/components/style/macros.rs
+++ b/servo/components/style/macros.rs
@@ -63,19 +63,29 @@ macro_rules! try_match_ident_ignore_asci
             ))
         }
     }}
 }
 
 macro_rules! define_keyword_type {
     ($name:ident, $css:expr) => {
         #[allow(missing_docs)]
-        #[derive(Animate, Clone, ComputeSquaredDistance, Copy, MallocSizeOf,
-                 PartialEq, SpecifiedValueInfo, ToAnimatedValue, ToAnimatedZero,
-                 ToComputedValue, ToCss)]
+        #[derive(
+            Animate,
+            Clone,
+            ComputeSquaredDistance,
+            Copy,
+            MallocSizeOf,
+            PartialEq,
+            SpecifiedValueInfo,
+            ToAnimatedValue,
+            ToAnimatedZero,
+            ToComputedValue,
+            ToCss,
+        )]
         pub struct $name;
 
         impl fmt::Debug for $name {
             fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
                 f.write_str($css)
             }
         }
 
--- a/servo/components/style/matching.rs
+++ b/servo/components/style/matching.rs
@@ -351,20 +351,19 @@ trait PrivateMatchMethods: TElement {
         // Bug 868975: These steps should examine and update the visited styles
         // in addition to the unvisited styles.
 
         let mut tasks = UpdateAnimationsTasks::empty();
         if self.needs_animations_update(context, old_values.as_ref().map(|s| &**s), new_values) {
             tasks.insert(UpdateAnimationsTasks::CSS_ANIMATIONS);
         }
 
-        let before_change_style = if self.might_need_transitions_update(
-            old_values.as_ref().map(|s| &**s),
-            new_values,
-        ) {
+        let before_change_style = if self
+            .might_need_transitions_update(old_values.as_ref().map(|s| &**s), new_values)
+        {
             let after_change_style = if self.has_css_transitions() {
                 self.after_change_style(context, new_values)
             } else {
                 None
             };
 
             // In order to avoid creating a SequentialTask for transitions which
             // may not be updated, we check it per property to make sure Gecko
@@ -464,19 +463,21 @@ trait PrivateMatchMethods: TElement {
         &self,
         shared_context: &SharedStyleContext,
         damage: &mut RestyleDamage,
         old_values: &ComputedValues,
         new_values: &ComputedValues,
         pseudo: Option<&PseudoElement>,
     ) -> ChildCascadeRequirement {
         debug!("accumulate_damage_for: {:?}", self);
-        debug_assert!(!shared_context
-            .traversal_flags
-            .contains(TraversalFlags::Forgetful));
+        debug_assert!(
+            !shared_context
+                .traversal_flags
+                .contains(TraversalFlags::Forgetful)
+        );
 
         let difference = self.compute_style_difference(old_values, new_values, pseudo);
 
         *damage |= difference.damage;
 
         debug!(" > style difference: {:?}", difference);
 
         // We need to cascade the children in order to ensure the correct
--- a/servo/components/style/media_queries/media_condition.rs
+++ b/servo/components/style/media_queries/media_condition.rs
@@ -48,33 +48,33 @@ impl ToCss for MediaCondition {
     {
         match *self {
             // NOTE(emilio): MediaFeatureExpression already includes the
             // parenthesis.
             MediaCondition::Feature(ref f) => f.to_css(dest),
             MediaCondition::Not(ref c) => {
                 dest.write_str("not ")?;
                 c.to_css(dest)
-            }
+            },
             MediaCondition::InParens(ref c) => {
                 dest.write_char('(')?;
                 c.to_css(dest)?;
                 dest.write_char(')')
-            }
+            },
             MediaCondition::Operation(ref list, op) => {
                 let mut iter = list.iter();
                 iter.next().unwrap().to_css(dest)?;
                 for item in iter {
                     dest.write_char(' ')?;
                     op.to_css(dest)?;
                     dest.write_char(' ')?;
                     item.to_css(dest)?;
                 }
                 Ok(())
-            }
+            },
         }
     }
 }
 
 impl MediaCondition {
     /// Parse a single media condition.
     pub fn parse<'i, 't>(
         context: &ParserContext,
@@ -99,24 +99,22 @@ impl MediaCondition {
         allow_or: AllowOr,
     ) -> Result<Self, ParseError<'i>> {
         let location = input.current_source_location();
 
         // FIXME(emilio): This can be cleaner with nll.
         let is_negation = match *input.next()? {
             Token::ParenthesisBlock => false,
             Token::Ident(ref ident) if ident.eq_ignore_ascii_case("not") => true,
-            ref t => {
-                return Err(location.new_unexpected_token_error(t.clone()))
-            }
+            ref t => return Err(location.new_unexpected_token_error(t.clone())),
         };
 
         if is_negation {
             let inner_condition = Self::parse_in_parens(context, input)?;
-            return Ok(MediaCondition::Not(Box::new(inner_condition)))
+            return Ok(MediaCondition::Not(Box::new(inner_condition)));
         }
 
         // ParenthesisBlock.
         let first_condition = Self::parse_paren_block(context, input)?;
         let operator = match input.try(Operator::parse) {
             Ok(op) => op,
             Err(..) => return Ok(first_condition),
         };
@@ -157,35 +155,31 @@ impl MediaCondition {
 
     fn parse_paren_block<'i, 't>(
         context: &ParserContext,
         input: &mut Parser<'i, 't>,
     ) -> Result<Self, ParseError<'i>> {
         input.parse_nested_block(|input| {
             // Base case.
             if let Ok(inner) = input.try(|i| Self::parse(context, i)) {
-                return Ok(MediaCondition::InParens(Box::new(inner)))
+                return Ok(MediaCondition::InParens(Box::new(inner)));
             }
             let expr = MediaFeatureExpression::parse_in_parenthesis_block(context, input)?;
             Ok(MediaCondition::Feature(expr))
         })
     }
 
     /// Whether this condition matches the device and quirks mode.
     pub fn matches(&self, device: &Device, quirks_mode: QuirksMode) -> bool {
         match *self {
             MediaCondition::Feature(ref f) => f.matches(device, quirks_mode),
             MediaCondition::InParens(ref c) => c.matches(device, quirks_mode),
             MediaCondition::Not(ref c) => !c.matches(device, quirks_mode),
             MediaCondition::Operation(ref conditions, op) => {
                 let mut iter = conditions.iter();
                 match op {
-                    Operator::And => {
-                        iter.all(|c| c.matches(device, quirks_mode))
-                    }
-                    Operator::Or => {
-                        iter.any(|c| c.matches(device, quirks_mode))
-                    }
+                    Operator::And => iter.all(|c| c.matches(device, quirks_mode)),
+                    Operator::Or => iter.any(|c| c.matches(device, quirks_mode)),
                 }
-            }
+            },
         }
     }
 }
--- a/servo/components/style/media_queries/media_feature.rs
+++ b/servo/components/style/media_queries/media_feature.rs
@@ -25,20 +25,19 @@ type MediaFeatureEvaluator<T> = fn(
 
 /// Serializes a given discriminant.
 ///
 /// FIXME(emilio): we could prevent this allocation if the ToCss code would
 /// generate a method for keywords to get the static string or something.
 pub type KeywordSerializer = fn(KeywordDiscriminant) -> String;
 
 /// Parses a given identifier.
-pub type KeywordParser = for <'a, 'i, 't> fn(
-    context: &'a ParserContext,
-    input: &'a mut Parser<'i, 't>,
-) -> Result<KeywordDiscriminant, ParseError<'i>>;
+pub type KeywordParser =
+    for<'a, 'i, 't> fn(context: &'a ParserContext, input: &'a mut Parser<'i, 't>)
+        -> Result<KeywordDiscriminant, ParseError<'i>>;
 
 /// An evaluator for a given media feature.
 ///
 /// This determines the kind of values that get parsed, too.
 #[allow(missing_docs)]
 pub enum Evaluator {
     Length(MediaFeatureEvaluator<CSSPixelLength>),
     Integer(MediaFeatureEvaluator<u32>),
@@ -65,60 +64,59 @@ pub enum Evaluator {
 }
 
 /// A simple helper macro to create a keyword evaluator.
 ///
 /// This assumes that keyword feature expressions don't accept ranges, and
 /// asserts if that's not true. As of today there's nothing like that (does that
 /// even make sense?).
 macro_rules! keyword_evaluator {
-    ($actual_evaluator:ident, $keyword_type:ty) => {
-        {
-            fn __parse<'i, 't>(
-                context: &$crate::parser::ParserContext,
-                input: &mut $crate::cssparser::Parser<'i, 't>,
-            ) -> Result<
-                $crate::media_queries::media_feature::KeywordDiscriminant,
-                ::style_traits::ParseError<'i>,
-            > {
-                let kw = <$keyword_type as $crate::parser::Parse>::parse(context, input)?;
-                Ok(kw as $crate::media_queries::media_feature::KeywordDiscriminant)
-            }
+    ($actual_evaluator:ident, $keyword_type:ty) => {{
+        fn __parse<'i, 't>(
+            context: &$crate::parser::ParserContext,
+            input: &mut $crate::cssparser::Parser<'i, 't>,
+        ) -> Result<
+            $crate::media_queries::media_feature::KeywordDiscriminant,
+            ::style_traits::ParseError<'i>,
+        > {
+            let kw = <$keyword_type as $crate::parser::Parse>::parse(context, input)?;
+            Ok(kw as $crate::media_queries::media_feature::KeywordDiscriminant)
+        }
 
-            fn __serialize(kw: $crate::media_queries::media_feature::KeywordDiscriminant) -> String {
-                // This unwrap is ok because the only discriminants that get
-                // back to us is the ones that `parse` produces.
-                let value: $keyword_type =
-                    ::num_traits::cast::FromPrimitive::from_u8(kw).unwrap();
-                <$keyword_type as ::style_traits::ToCss>::to_css_string(&value)
-            }
+        fn __serialize(kw: $crate::media_queries::media_feature::KeywordDiscriminant) -> String {
+            // This unwrap is ok because the only discriminants that get
+            // back to us is the ones that `parse` produces.
+            let value: $keyword_type = ::num_traits::cast::FromPrimitive::from_u8(kw).unwrap();
+            <$keyword_type as ::style_traits::ToCss>::to_css_string(&value)
+        }
 
-            fn __evaluate(
-                device: &$crate::media_queries::Device,
-                value: Option<$crate::media_queries::media_feature::KeywordDiscriminant>,
-                range_or_operator: Option<$crate::media_queries::media_feature_expression::RangeOrOperator>,
-            ) -> bool {
-                debug_assert!(
-                    range_or_operator.is_none(),
-                    "Since when do keywords accept ranges?"
-                );
-                // This unwrap is ok because the only discriminants that get
-                // back to us is the ones that `parse` produces.
-                let value: Option<$keyword_type> =
-                    value.map(|kw| ::num_traits::cast::FromPrimitive::from_u8(kw).unwrap());
-                $actual_evaluator(device, value)
-            }
+        fn __evaluate(
+            device: &$crate::media_queries::Device,
+            value: Option<$crate::media_queries::media_feature::KeywordDiscriminant>,
+            range_or_operator: Option<
+                $crate::media_queries::media_feature_expression::RangeOrOperator,
+            >,
+        ) -> bool {
+            debug_assert!(
+                range_or_operator.is_none(),
+                "Since when do keywords accept ranges?"
+            );
+            // This unwrap is ok because the only discriminants that get
+            // back to us is the ones that `parse` produces.
+            let value: Option<$keyword_type> =
+                value.map(|kw| ::num_traits::cast::FromPrimitive::from_u8(kw).unwrap());
+            $actual_evaluator(device, value)
+        }
 
-            $crate::media_queries::media_feature::Evaluator::Enumerated {
-                parser: __parse,
-                serializer: __serialize,
-                evaluator: __evaluate,
-            }
+        $crate::media_queries::media_feature::Evaluator::Enumerated {
+            parser: __parse,
+            serializer: __serialize,
+            evaluator: __evaluate,
         }
-    }
+    }};
 }
 
 bitflags! {
     /// Different requirements or toggles that change how a expression is
     /// parsed.
     pub struct ParsingRequirements: u8 {
         /// The feature should only be parsed in chrome and ua sheets.
         const CHROME_AND_UA_ONLY = 1 << 0;
@@ -164,17 +162,17 @@ impl MediaFeatureDescription {
 macro_rules! feature {
     ($name:expr, $allows_ranges:expr, $evaluator:expr, $reqs:expr,) => {
         $crate::media_queries::media_feature::MediaFeatureDescription {
             name: $name,
             allows_ranges: $allows_ranges,
             evaluator: $evaluator,
             requirements: $reqs,
         }
-    }
+    };
 }
 
 impl fmt::Debug for MediaFeatureDescription {
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
         f.debug_struct("MediaFeatureExpression")
             .field("name", &self.name)
             .field("allows_ranges", &self.allows_ranges)
             .field("requirements", &self.requirements)
--- a/servo/components/style/media_queries/media_feature_expression.rs
+++ b/servo/components/style/media_queries/media_feature_expression.rs
@@ -97,37 +97,29 @@ pub enum RangeOrOperator {
     Range(Range),
     /// An `Operator`.
     Operator(Operator),
 }
 
 impl RangeOrOperator {
     /// Evaluate a given range given an optional query value and a value from
     /// the browser.
-    pub fn evaluate<T>(
-        range_or_op: Option<Self>,
-        query_value: Option<T>,
-        value: T,
-    ) -> bool
+    pub fn evaluate<T>(range_or_op: Option<Self>, query_value: Option<T>, value: T) -> bool
     where
-        T: PartialOrd + Zero
+        T: PartialOrd + Zero,
     {
         match query_value {
             Some(v) => Self::evaluate_with_query_value(range_or_op, v, value),
             None => !value.is_zero(),
         }
     }
 
     /// Evaluate a given range given a non-optional query value and a value from
     /// the browser.
-    pub fn evaluate_with_query_value<T>(
-        range_or_op: Option<Self>,
-        query_value: T,
-        value: T,
-    ) -> bool
+    pub fn evaluate_with_query_value<T>(range_or_op: Option<Self>, query_value: T, value: T) -> bool
     where
         T: PartialOrd,
     {
         let cmp = match value.partial_cmp(&query_value) {
             Some(c) => c,
             None => return false,
         };
 
@@ -137,59 +129,57 @@ impl RangeOrOperator {
         };
 
         match range_or_op {
             RangeOrOperator::Range(range) => {
                 cmp == Ordering::Equal || match range {
                     Range::Min => cmp == Ordering::Greater,
                     Range::Max => cmp == Ordering::Less,
                 }
-            }
-            RangeOrOperator::Operator(op) => {
-                match op {
-                    Operator::Equal => cmp == Ordering::Equal,
-                    Operator::GreaterThan => cmp == Ordering::Greater,
-                    Operator::GreaterThanEqual => {
-                        cmp == Ordering::Equal || cmp == Ordering::Greater
-                    }
-                    Operator::LessThan => cmp == Ordering::Less,
-                    Operator::LessThanEqual => {
-                        cmp == Ordering::Equal || cmp == Ordering::Less
-                    }
-                }
-            }
+            },
+            RangeOrOperator::Operator(op) => match op {
+                Operator::Equal => cmp == Ordering::Equal,
+                Operator::GreaterThan => cmp == Ordering::Greater,
+                Operator::GreaterThanEqual => cmp == Ordering::Equal || cmp == Ordering::Greater,
+                Operator::LessThan => cmp == Ordering::Less,
+                Operator::LessThanEqual => cmp == Ordering::Equal || cmp == Ordering::Less,
+            },
         }
     }
 }
 
 /// A feature expression contains a reference to the media feature, the value
 /// the media query contained, and the range to evaluate.
 #[derive(Clone, Debug, MallocSizeOf)]
 pub struct MediaFeatureExpression {
     feature: &'static MediaFeatureDescription,
     value: Option<MediaExpressionValue>,
     range_or_operator: Option<RangeOrOperator>,
 }
 
 impl PartialEq for MediaFeatureExpression {
     fn eq(&self, other: &Self) -> bool {
         self.feature as *const _ == other.feature as *const _ &&
-        self.value == other.value &&
-        self.range_or_operator == other.range_or_operator
+            self.value == other.value &&
+            self.range_or_operator == other.range_or_operator
     }
 }
 
 impl ToCss for MediaFeatureExpression {
     fn to_css<W>(&self, dest: &mut CssWriter<W>) -> fmt::Result
     where
         W: fmt::Write,
     {
         dest.write_str("(")?;
 
-        if self.feature.requirements.contains(ParsingRequirements::WEBKIT_PREFIX) {
+        if self
+            .feature
+            .requirements
+            .contains(ParsingRequirements::WEBKIT_PREFIX)
+        {
             dest.write_str("-webkit-")?;
         }
 
         if let Some(RangeOrOperator::Range(range)) = self.range_or_operator {
             match range {
                 Range::Min => dest.write_str("min-")?,
                 Range::Max => dest.write_str("max-")?,
             }
@@ -210,19 +200,17 @@ impl ToCss for MediaFeatureExpression {
             val.to_css(dest, self)?;
         }
 
         dest.write_str(")")
     }
 }
 
 /// Consumes an operation or a colon, or returns an error.
-fn consume_operation_or_colon(
-    input: &mut Parser,
-) -> Result<Option<Operator>, ()> {
+fn consume_operation_or_colon(input: &mut Parser) -> Result<Option<Operator>, ()> {
     let first_delim = {
         let next_token = match input.next() {
             Ok(t) => t,
             Err(..) => return Err(()),
         };
 
         match *next_token {
             Token::Colon => return Ok(None),
@@ -233,50 +221,52 @@ fn consume_operation_or_colon(
     Ok(Some(match first_delim {
         '=' => Operator::Equal,
         '>' => {
             if input.try(|i| i.expect_delim('=')).is_ok() {
                 Operator::GreaterThanEqual
             } else {
                 Operator::GreaterThan
             }
-        }
+        },
         '<' => {
             if input.try(|i| i.expect_delim('=')).is_ok() {
                 Operator::LessThanEqual
             } else {
                 Operator::LessThan
             }
-        }
+        },
         _ => return Err(()),
     }))
 }
 
 impl MediaFeatureExpression {
     fn new(
         feature: &'static MediaFeatureDescription,
         value: Option<MediaExpressionValue>,
         range_or_operator: Option<RangeOrOperator>,
     ) -> Self {
-        Self { feature, value, range_or_operator }
+        Self {
+            feature,
+            value,
+            range_or_operator,
+        }
     }
 
     /// Parse a media expression of the form:
     ///
     /// ```
     /// (media-feature: media-value)
     /// ```
     pub fn parse<'i, 't>(
         context: &ParserContext,
         input: &mut Parser<'i, 't>,
     ) -> Result<Self, ParseError<'i>> {
         input.expect_parenthesis_block()?;
-        input.parse_nested_block(|input| {
-            Self::parse_in_parenthesis_block(context, input)
-        })
+        input.parse_nested_block(|input| Self::parse_in_parenthesis_block(context, input))
     }
 
     /// Parse a media feature expression where we've already consumed the
     /// parenthesis.
     pub fn parse_in_parenthesis_block<'i, 't>(
         context: &ParserContext,
         input: &mut Parser<'i, 't>,
     ) -> Result<Self, ParseError<'i>> {
@@ -289,36 +279,36 @@ impl MediaFeatureExpression {
         let feature;
         let range;
         {
             let location = input.current_source_location();
             let ident = input.expect_ident()?;
 
             let mut requirements = ParsingRequirements::empty();
 
-            if context.chrome_rules_enabled() ||
-                context.stylesheet_origin == Origin::UserAgent
-            {
+            if context.chrome_rules_enabled() || context.stylesheet_origin == Origin::UserAgent {
                 requirements.insert(ParsingRequirements::CHROME_AND_UA_ONLY);
             }
 
             let result = {
                 let mut feature_name = &**ident;
 
                 #[cfg(feature = "gecko")]
                 {
                     if unsafe { structs::StaticPrefs_sVarCache_layout_css_prefixes_webkit } &&
                         starts_with_ignore_ascii_case(feature_name, "-webkit-")
                     {
                         feature_name = &feature_name[8..];
                         requirements.insert(ParsingRequirements::WEBKIT_PREFIX);
                         if unsafe {
                             structs::StaticPrefs_sVarCache_layout_css_prefixes_device_pixel_ratio_webkit
                         } {
-                            requirements.insert(ParsingRequirements::WEBKIT_DEVICE_PIXEL_RATIO_PREF_ENABLED);
+                            requirements.insert(
+                                ParsingRequirements::WEBKIT_DEVICE_PIXEL_RATIO_PREF_ENABLED,
+                            );
                         }
                     }
                 }
 
                 let range = if starts_with_ignore_ascii_case(feature_name, "min-") {
                     feature_name = &feature_name[4..];
                     Some(Range::Min)
                 } else if starts_with_ignore_ascii_case(feature_name, "max-") {
@@ -365,113 +355,101 @@ impl MediaFeatureExpression {
             Err(..) => {
                 // If there's no colon, this is a media query of the
                 // form '(<feature>)', that is, there's no value
                 // specified.
                 //
                 // Gecko doesn't allow ranged expressions without a
                 // value, so just reject them here too.
                 if range.is_some() {
-                    return Err(input.new_custom_error(
-                        StyleParseErrorKind::RangedExpressionWithNoValue
-                    ));
+                    return Err(
+                        input.new_custom_error(StyleParseErrorKind::RangedExpressionWithNoValue)
+                    );
                 }
 
                 return Ok(Self::new(feature, None, None));
-            }
+            },
             Ok(operator) => operator,
         };
 
         let range_or_operator = match range {
             Some(range) => {
                 if operator.is_some() {
-                    return Err(input.new_custom_error(
-                        StyleParseErrorKind::MediaQueryUnexpectedOperator
-                    ));
+                    return Err(
+                        input.new_custom_error(StyleParseErrorKind::MediaQueryUnexpectedOperator)
+                    );
                 }
                 Some(RangeOrOperator::Range(range))
-            }
-            None => {
-                match operator {
-                    Some(operator) => {
-                        if !feature.allows_ranges() {
-                            return Err(input.new_custom_error(
-                                StyleParseErrorKind::MediaQueryUnexpectedOperator
-                            ));
-                        }
-                        Some(RangeOrOperator::Operator(operator))
+            },
+            None => match operator {
+                Some(operator) => {
+                    if !feature.allows_ranges() {
+                        return Err(input
+                            .new_custom_error(StyleParseErrorKind::MediaQueryUnexpectedOperator));
                     }
-                    None => None,
-                }
-            }
+                    Some(RangeOrOperator::Operator(operator))
+                },
+                None => None,
+            },
         };
 
-        let value =
-            MediaExpressionValue::parse(feature, context, input).map_err(|err| {
-                err.location
-                    .new_custom_error(StyleParseErrorKind::MediaQueryExpectedFeatureValue)
-            })?;
+        let value = MediaExpressionValue::parse(feature, context, input).map_err(|err| {
+            err.location
+                .new_custom_error(StyleParseErrorKind::MediaQueryExpectedFeatureValue)
+        })?;
 
         Ok(Self::new(feature, Some(value), range_or_operator))
     }
 
     /// Returns whether this media query evaluates to true for the given device.
     pub fn matches(&self, device: &Device, quirks_mode: QuirksMode) -> bool {
         let value = self.value.as_ref();
 
         macro_rules! expect {
             ($variant:ident) => {
-                value.map(|value| {
-                    match *value {
-                        MediaExpressionValue::$variant(ref v) => v,
-                        _ => unreachable!("Unexpected MediaExpressionValue"),
-                    }
+                value.map(|value| match *value {
+                    MediaExpressionValue::$variant(ref v) => v,
+                    _ => unreachable!("Unexpected MediaExpressionValue"),
                 })
-            }
+            };
         }
 
         match self.feature.evaluator {
             Evaluator::Length(eval) => {
                 let computed = expect!(Length).map(|specified| {
                     computed::Context::for_media_query_evaluation(device, quirks_mode, |context| {
                         specified.to_computed_value(context)
                     })
                 });
                 eval(device, computed, self.range_or_operator)
-            }
+            },
             Evaluator::Integer(eval) => {
                 eval(device, expect!(Integer).cloned(), self.range_or_operator)
-            }
-            Evaluator::Float(eval) => {
-                eval(device, expect!(Float).cloned(), self.range_or_operator)
-            }
+            },
+            Evaluator::Float(eval) => eval(device, expect!(Float).cloned(), self.range_or_operator),
             Evaluator::IntRatio(eval) => {
                 eval(device, expect!(IntRatio).cloned(), self.range_or_operator)
             },
             Evaluator::Resolution(eval) => {
                 let computed = expect!(Resolution).map(|specified| {
                     computed::Context::for_media_query_evaluation(device, quirks_mode, |context| {
                         specified.to_computed_value(context)
                     })
                 });
                 eval(device, computed, self.range_or_operator)
-            }
+            },
             Evaluator::Enumerated { evaluator, .. } => {
-                evaluator(
-                    device,
-                    expect!(Enumerated).cloned(),
-                    self.range_or_operator,
-                )
-            }
-            Evaluator::Ident(eval) => {
-                eval(device, expect!(Ident).cloned(), self.range_or_operator)
-            }
-            Evaluator::BoolInteger(eval) => {
-                eval(device, expect!(BoolInteger).cloned(), self.range_or_operator)
-            }
+                evaluator(device, expect!(Enumerated).cloned(), self.range_or_operator)
+            },
+            Evaluator::Ident(eval) => eval(device, expect!(Ident).cloned(), self.range_or_operator),
+            Evaluator::BoolInteger(eval) => eval(
+                device,
+                expect!(BoolInteger).cloned(),
+                self.range_or_operator,
+            ),
         }
     }
 }
 
 /// A value found or expected in a media expression.
 ///
 /// FIXME(emilio): How should calc() serialize in the Number / Integer /
 /// BoolInteger / IntRatio case, as computed or as specified value?
@@ -497,84 +475,71 @@ pub enum MediaExpressionValue {
     /// An enumerated value, defined by the variant keyword table in the
     /// feature's `mData` member.
     Enumerated(KeywordDiscriminant),
     /// An identifier.
     Ident(Atom),
 }
 
 impl MediaExpressionValue {
-    fn to_css<W>(
-        &self,
-        dest: &mut CssWriter<W>,
-        for_expr: &MediaFeatureExpression,
-    ) -> fmt::Result
+    fn to_css<W>(&self, dest: &mut CssWriter<W>, for_expr: &MediaFeatureExpression) -> fmt::Result
     where
         W: fmt::Write,
     {
         match *self {
             MediaExpressionValue::Length(ref l) => l.to_css(dest),
             MediaExpressionValue::Integer(v) => v.to_css(dest),
             MediaExpressionValue::Float(v) => v.to_css(dest),
             MediaExpressionValue::BoolInteger(v) => dest.write_str(if v { "1" } else { "0" }),
-            MediaExpressionValue::IntRatio(ratio) => {
-                ratio.to_css(dest)
-            },
+            MediaExpressionValue::IntRatio(ratio) => ratio.to_css(dest),
             MediaExpressionValue::Resolution(ref r) => r.to_css(dest),
             MediaExpressionValue::Ident(ref ident) => serialize_atom_identifier(ident, dest),
-            MediaExpressionValue::Enumerated(value) => {
-                match for_expr.feature.evaluator {
-                    Evaluator::Enumerated { serializer, .. } => {
-                        dest.write_str(&*serializer(value))
-                    }
-                    _ => unreachable!(),
-                }
+            MediaExpressionValue::Enumerated(value) => match for_expr.feature.evaluator {
+                Evaluator::Enumerated { serializer, .. } => dest.write_str(&*serializer(value)),
+                _ => unreachable!(),
             },
         }
     }
 
     fn parse<'i, 't>(
         for_feature: &MediaFeatureDescription,
         context: &ParserContext,
         input: &mut Parser<'i, 't>,
     ) -> Result<MediaExpressionValue, ParseError<'i>> {
         Ok(match for_feature.evaluator {
             Evaluator::Length(..) => {
                 let length = Length::parse_non_negative(context, input)?;
                 MediaExpressionValue::Length(length)
-            }
+            },
             Evaluator::Integer(..) => {
                 let integer = Integer::parse_non_negative(context, input)?;
                 MediaExpressionValue::Integer(integer.value() as u32)
-            }
+            },
             Evaluator::BoolInteger(..) => {
                 let integer = Integer::parse_non_negative(context, input)?;
                 let value = integer.value();
                 if value > 1 {
                     return Err(input.new_custom_error(StyleParseErrorKind::UnspecifiedError));
                 }
                 MediaExpressionValue::BoolInteger(value == 1)
-            }
+            },
             Evaluator::Float(..) => {
                 let number = Number::parse(context, input)?;
                 MediaExpressionValue::Float(number.get())
-            }
+            },
             Evaluator::IntRatio(..) => {
                 let a = Integer::parse_positive(context, input)?;
                 input.expect_delim('/')?;
                 let b = Integer::parse_positive(context, input)?;
-                MediaExpressionValue::IntRatio(AspectRatio(
-                    a.value() as u32,
-                    b.value() as u32
-                ))
-            }
+                MediaExpressionValue::IntRatio(AspectRatio(a.value() as u32, b.value() as u32))
+            },
             Evaluator::Resolution(..) => {
                 MediaExpressionValue::Resolution(Resolution::parse(context, input)?)
-            }
+            },
             Evaluator::Enumerated { parser, .. } => {
                 MediaExpressionValue::Enumerated(parser(context, input)?)
-            }
+            },
             Evaluator::Ident(..) => {
                 MediaExpressionValue::Ident(Atom::from(input.expect_ident()?.as_ref()))
-            }
+            },
         })
     }
 }
--- a/servo/components/style/media_queries/media_list.rs
+++ b/servo/components/style/media_queries/media_list.rs
@@ -25,36 +25,35 @@ pub struct MediaList {
 impl MediaList {
     /// Parse a media query list from CSS.
     ///
     /// Always returns a media query list. If any invalid media query is
     /// found, the media query list is only filled with the equivalent of
     /// "not all", see:
     ///
     /// <https://drafts.csswg.org/mediaqueries/#error-handling>
-    pub fn parse(
-        context: &ParserContext,
-        input: &mut Parser,
-    ) -> Self {
+    pub fn parse(context: &ParserContext, input: &mut Parser) -> Self {
         if input.is_exhausted() {
             return Self::empty();
         }
 
         let mut media_queries = vec![];
         loop {
             let start_position = input.position();
             match input.parse_until_before(Delimiter::Comma, |i| MediaQuery::parse(context, i)) {
                 Ok(mq) => {
                     media_queries.push(mq);
                 },
                 Err(err) => {
                     media_queries.push(MediaQuery::never_matching());
                     let location = err.location;
-                    let error =
-                        ContextualParseError::InvalidMediaRule(input.slice_from(start_position), err);
+                    let error = ContextualParseError::InvalidMediaRule(
+                        input.slice_from(start_position),
+                        err,
+                    );
                     context.log_css_error(location, error);
                 },
             }
 
             match input.next() {
                 Ok(&Token::Comma) => {},
                 Ok(_) => unreachable!(),
                 Err(_) => break,
@@ -74,18 +73,20 @@ impl MediaList {
     /// Evaluate a whole `MediaList` against `Device`.
     pub fn evaluate(&self, device: &Device, quirks_mode: QuirksMode) -> bool {
         // Check if it is an empty media query list or any queries match.
         // https://drafts.csswg.org/mediaqueries-4/#mq-list
         self.media_queries.is_empty() || self.media_queries.iter().any(|mq| {
             let media_match = mq.media_type.matches(device.media_type());
 
             // Check if the media condition match.
-            let query_match = media_match &&
-                mq.condition.as_ref().map_or(true, |c| c.matches(device, quirks_mode));
+            let query_match = media_match && mq
+                .condition
+                .as_ref()
+                .map_or(true, |c| c.matches(device, quirks_mode));
 
             // Apply the logical NOT qualifier to the result
             match mq.qualifier {
                 Some(Qualifier::Not) => !query_match,
                 _ => query_match,
             }
         })
     }
--- a/servo/components/style/media_queries/media_query.rs
+++ b/servo/components/style/media_queries/media_query.rs
@@ -10,17 +10,16 @@ use Atom;
 use cssparser::Parser;
 use parser::ParserContext;
 use std::fmt::{self, Write};
 use str::string_as_ascii_lowercase;
 use style_traits::{CssWriter, ParseError, ToCss};
 use super::media_condition::MediaCondition;
 use values::CustomIdent;
 
-
 /// <https://drafts.csswg.org/mediaqueries/#mq-prefix>
 #[derive(Clone, Copy, Debug, Eq, MallocSizeOf, Parse, PartialEq, ToCss)]
 pub enum Qualifier {
     /// Hide a media query from legacy UAs:
     /// <https://drafts.csswg.org/mediaqueries/#mq-only>
     Only,
     /// Negate a media query:
     /// <https://drafts.csswg.org/mediaqueries/#mq-not>
@@ -120,33 +119,38 @@ impl MediaQuery {
 
     /// Parse a media query given css input.
     ///
     /// Returns an error if any of the expressions is unknown.
     pub fn parse<'i, 't>(
         context: &ParserContext,
         input: &mut Parser<'i, 't>,
     ) -> Result<Self, ParseError<'i>> {
-        let (qualifier, explicit_media_type) = input.try(|input| -> Result<_, ()> {
-            let qualifier = input.try(Qualifier::parse).ok();
-            let ident = input.expect_ident().map_err(|_| ())?;
-            let media_type = MediaQueryType::parse(&ident)?;
-            Ok((qualifier, Some(media_type)))
-        }).unwrap_or_default();
+        let (qualifier, explicit_media_type) = input
+            .try(|input| -> Result<_, ()> {
+                let qualifier = input.try(Qualifier::parse).ok();
+                let ident = input.expect_ident().map_err(|_| ())?;
+                let media_type = MediaQueryType::parse(&ident)?;
+                Ok((qualifier, Some(media_type)))
+            }).unwrap_or_default();
 
         let condition = if explicit_media_type.is_none() {
             Some(MediaCondition::parse(context, input)?)
         } else if input.try(|i| i.expect_ident_matching("and")).is_ok() {
             Some(MediaCondition::parse_disallow_or(context, input)?)
         } else {
             None
         };
 
         let media_type = explicit_media_type.unwrap_or(MediaQueryType::All);
-        Ok(Self { qualifier, media_type, condition })
+        Ok(Self {
+            qualifier,
+            media_type,
+            condition,
+        })
     }
 }
 
 /// <http://dev.w3.org/csswg/mediaqueries-3/#media0>
 #[derive(Clone, Debug, Eq, MallocSizeOf, PartialEq)]
 pub enum MediaQueryType {
     /// A media type that matches every device.
     All,
--- a/servo/components/style/parser.rs
+++ b/servo/components/style/parser.rs
@@ -132,21 +132,17 @@ impl<'a> ParserContext<'a> {
 
     /// Get the rule type, which assumes that one is available.
     pub fn rule_type(&self) -> CssRuleType {
         self.rule_type
             .expect("Rule type expected, but none was found.")
     }
 
     /// Record a CSS parse error with this context’s error reporting.
-    pub fn log_css_error(
-        &self,
-        location: SourceLocation,
-        error: ContextualParseError,
-    ) {
+    pub fn log_css_error(&self, location: SourceLocation, error: ContextualParseError) {
         let error_reporter = match self.error_reporter {
             Some(r) => r,
             None => return,
         };
 
         error_reporter.report_error(self.url_data, location, error)
     }
 
--- a/servo/components/style/rule_tree/mod.rs
+++ b/servo/components/style/rule_tree/mod.rs
@@ -483,17 +483,18 @@ impl RuleTree {
 
     /// Returns new rule node without rules from declarative animations.
     pub fn remove_animation_rules(&self, path: &StrongRuleNode) -> StrongRuleNode {
         // Return a clone if there are no animation rules.
         if !path.has_animation_or_transition_rules() {
             return path.clone();
         }
 
-        let iter = path.self_and_ancestors()
+        let iter = path
+            .self_and_ancestors()
             .take_while(|node| node.cascade_level() >= CascadeLevel::SMILOverride);
         let mut last = path;
         let mut children = SmallVec::<[_; 10]>::new();
         for node in iter {
             if !node.cascade_level().is_animation() {
                 children.push((
                     node.get().source.as_ref().unwrap().clone(),
                     node.cascade_level(),
@@ -1447,17 +1448,18 @@ impl StrongRuleNode {
         // We want to iterate over cascade levels that override the animations
         // level, i.e.  !important levels and the transitions level.
         //
         // However, we actually want to skip the transitions level because
         // although it is higher in the cascade than animations, when both
         // transitions and animations are present for a given element and
         // property, transitions are suppressed so that they don't actually
         // override animations.
-        let iter = self.self_and_ancestors()
+        let iter = self
+            .self_and_ancestors()
             .skip_while(|node| node.cascade_level() == CascadeLevel::Transitions)
             .take_while(|node| node.cascade_level() > CascadeLevel::Animations);
         let mut result = (LonghandIdSet::new(), false);
         for node in iter {
             let style = node.style_source().unwrap();
             for (decl, important) in style
                 .read(node.cascade_level().guard(guards))
                 .declaration_importance_iter()
--- a/servo/components/style/selector_map.rs
+++ b/servo/components/style/selector_map.rs
@@ -282,17 +282,19 @@ impl SelectorMap<Rule> {
             if matches_selector(
                 &rule.selector,
                 0,
                 Some(&rule.hashes),
                 &element,
                 context,
                 flags_setter,
             ) {
-                matching_rules.push(rule.to_applicable_declaration_block(cascade_level, shadow_cascade_order));
+                matching_rules.push(
+                    rule.to_applicable_declaration_block(cascade_level, shadow_cascade_order),
+                );
             }
         }
     }
 }
 
 impl<T: SelectorMapEntry> SelectorMap<T> {
     /// Inserts into the correct hash, trying id, class, localname and
     /// namespace.
@@ -300,20 +302,22 @@ impl<T: SelectorMapEntry> SelectorMap<T>
         &mut self,
         entry: T,
         quirks_mode: QuirksMode,
     ) -> Result<(), FailedAllocationError> {
         self.count += 1;
 
         let vector = match find_bucket(entry.selector()) {
             Bucket::Root => &mut self.root,
-            Bucket::ID(id) => self.id_hash
+            Bucket::ID(id) => self
+                .id_hash
                 .try_entry(id.clone(), quirks_mode)?
                 .or_insert_with(SmallVec::new),
-            Bucket::Class(class) => self.class_hash
+            Bucket::Class(class) => self
+                .class_hash
                 .try_entry(class.clone(), quirks_mode)?
                 .or_insert_with(SmallVec::new),
             Bucket::LocalName { name, lower_name } => {
                 // If the local name in the selector isn't lowercase, insert it
                 // into the rule hash twice. This means that, during lookup, we
                 // can always find the rules based on the local name of the
                 // element, regardless of whether it's an html element in an
                 // html document (in which case we match against lower_name) or
@@ -328,17 +332,18 @@ impl<T: SelectorMapEntry> SelectorMap<T>
                         .try_entry(lower_name.clone())?
                         .or_insert_with(SmallVec::new)
                         .try_push(entry.clone())?;
                 }
                 self.local_name_hash
                     .try_entry(name.clone())?
                     .or_insert_with(SmallVec::new)
             },
-            Bucket::Namespace(url) => self.namespace_hash
+            Bucket::Namespace(url) => self
+                .namespace_hash
                 .try_entry(url.clone())?
                 .or_insert_with(SmallVec::new),
             Bucket::Universal => &mut self.other,
         };
 
         vector.try_push(entry)
     }
 
@@ -485,18 +490,19 @@ fn specific_bucket_for<'a>(component: &'
     match *component {
         Component::Root => Bucket::Root,
         Component::ID(ref id) => Bucket::ID(id),
         Component::Class(ref class) => Bucket::Class(class),
         Component::LocalName(ref selector) => Bucket::LocalName {
             name: &selector.name,
             lower_name: &selector.lower_name,
         },
-        Component::Namespace(_, ref url) |
-        Component::DefaultNamespace(ref url) => Bucket::Namespace(url),
+        Component::Namespace(_, ref url) | Component::DefaultNamespace(ref url) => {
+            Bucket::Namespace(url)
+        },
         // ::slotted(..) isn't a normal pseudo-element, so we can insert it on
         // the rule hash normally without much problem. For example, in a
         // selector like:
         //
         //   div::slotted(span)::before
         //
         // It looks like:
         //
@@ -529,32 +535,32 @@ fn find_bucket<'a>(mut iter: SelectorIte
         //   root > id > class > local name > namespace > universal.
         //
         for ss in &mut iter {
             let new_bucket = specific_bucket_for(ss);
             match new_bucket {
                 Bucket::Root => return new_bucket,
                 Bucket::ID(..) => {
                     current_bucket = new_bucket;
-                }
+                },
                 Bucket::Class(..) => {
                     if !matches!(current_bucket, Bucket::ID(..)) {
                         current_bucket = new_bucket;
                     }
                 },
                 Bucket::LocalName { .. } => {
                     if matches!(current_bucket, Bucket::Universal | Bucket::Namespace(..)) {
                         current_bucket = new_bucket;
                     }
                 },
                 Bucket::Namespace(..) => {
                     if matches!(current_bucket, Bucket::Universal) {
                         current_bucket = new_bucket;
                     }
-                }
+                },
                 Bucket::Universal => {},
             }
         }
 
         // Effectively, pseudo-elements are ignored, given only state
         // pseudo-classes may appear before them.
         if iter.next_sequence() != Some(Combinator::PseudoElement) {
             break;
--- a/servo/components/style/servo/restyle_damage.rs
+++ b/servo/components/style/servo/restyle_damage.rs
@@ -75,37 +75,42 @@ impl ServoRestyleDamage {
     }
 
     /// Returns a bitmask that represents a flow that needs to be rebuilt and
     /// reflowed.
     ///
     /// FIXME(bholley): Do we ever actually need this? Shouldn't
     /// RECONSTRUCT_FLOW imply everything else?
     pub fn rebuild_and_reflow() -> ServoRestyleDamage {
-        ServoRestyleDamage::REPAINT | ServoRestyleDamage::REPOSITION |
-            ServoRestyleDamage::STORE_OVERFLOW | ServoRestyleDamage::BUBBLE_ISIZES |
-            ServoRestyleDamage::REFLOW_OUT_OF_FLOW | ServoRestyleDamage::REFLOW |
+        ServoRestyleDamage::REPAINT |
+            ServoRestyleDamage::REPOSITION |
+            ServoRestyleDamage::STORE_OVERFLOW |
+            ServoRestyleDamage::BUBBLE_ISIZES |
+            ServoRestyleDamage::REFLOW_OUT_OF_FLOW |
+            ServoRestyleDamage::REFLOW |
             ServoRestyleDamage::RECONSTRUCT_FLOW
     }
 
     /// Returns a bitmask indicating that the frame needs to be reconstructed.
     pub fn reconstruct() -> ServoRestyleDamage {
         ServoRestyleDamage::RECONSTRUCT_FLOW
     }
 
     /// Supposing a flow has the given `position` property and this damage,
     /// returns the damage that we should add to the *parent* of this flow.
     pub fn damage_for_parent(self, child_is_absolutely_positioned: bool) -> ServoRestyleDamage {
         if child_is_absolutely_positioned {
-            self & (ServoRestyleDamage::REPAINT | ServoRestyleDamage::REPOSITION |
+            self & (ServoRestyleDamage::REPAINT |
+                ServoRestyleDamage::REPOSITION |
                 ServoRestyleDamage::STORE_OVERFLOW |
                 ServoRestyleDamage::REFLOW_OUT_OF_FLOW |
                 ServoRestyleDamage::RESOLVE_GENERATED_CONTENT)
         } else {
-            self & (ServoRestyleDamage::REPAINT | ServoRestyleDamage::REPOSITION |
+            self & (ServoRestyleDamage::REPAINT |
+                ServoRestyleDamage::REPOSITION |
                 ServoRestyleDamage::STORE_OVERFLOW |
                 ServoRestyleDamage::REFLOW |
                 ServoRestyleDamage::REFLOW_OUT_OF_FLOW |
                 ServoRestyleDamage::RESOLVE_GENERATED_CONTENT)
         }
     }
 
     /// Supposing the *parent* of a flow with the given `position` property has
@@ -131,17 +136,18 @@ impl ServoRestyleDamage {
                 if self.contains(ServoRestyleDamage::REFLOW_OUT_OF_FLOW) {
                     self | ServoRestyleDamage::REFLOW
                 } else {
                     self
                 }
             },
             _ => {
                 // TODO(pcwalton): Take floatedness into account.
-                self & (ServoRestyleDamage::REPAINT | ServoRestyleDamage::REPOSITION |
+                self & (ServoRestyleDamage::REPAINT |
+                    ServoRestyleDamage::REPOSITION |
                     ServoRestyleDamage::REFLOW)
             },
         }
     }
 }
 
 impl Default for ServoRestyleDamage {
     fn default() -> Self {
@@ -200,32 +206,31 @@ fn compute_damage(old: &ComputedValues, 
             ServoRestyleDamage::REPAINT,
             ServoRestyleDamage::REPOSITION,
             ServoRestyleDamage::STORE_OVERFLOW,
             ServoRestyleDamage::BUBBLE_ISIZES,
             ServoRestyleDamage::REFLOW_OUT_OF_FLOW,
             ServoRestyleDamage::REFLOW,
             ServoRestyleDamage::RECONSTRUCT_FLOW
         ]
-    ) ||
-        (new.get_box().display == Display::Inline &&
-            restyle_damage_rebuild_and_reflow_inline!(
-                old,
-                new,
-                damage,
-                [
-                    ServoRestyleDamage::REPAINT,
-                    ServoRestyleDamage::REPOSITION,
-                    ServoRestyleDamage::STORE_OVERFLOW,
-                    ServoRestyleDamage::BUBBLE_ISIZES,
-                    ServoRestyleDamage::REFLOW_OUT_OF_FLOW,
-                    ServoRestyleDamage::REFLOW,
-                    ServoRestyleDamage::RECONSTRUCT_FLOW
-                ]
-            )) ||
+    ) || (new.get_box().display == Display::Inline &&
+        restyle_damage_rebuild_and_reflow_inline!(
+            old,
+            new,
+            damage,
+            [
+                ServoRestyleDamage::REPAINT,
+                ServoRestyleDamage::REPOSITION,
+                ServoRestyleDamage::STORE_OVERFLOW,
+                ServoRestyleDamage::BUBBLE_ISIZES,
+                ServoRestyleDamage::REFLOW_OUT_OF_FLOW,
+                ServoRestyleDamage::REFLOW,
+                ServoRestyleDamage::RECONSTRUCT_FLOW
+            ]
+        )) ||
         restyle_damage_reflow!(
             old,
             new,
             damage,
             [
                 ServoRestyleDamage::REPAINT,
                 ServoRestyleDamage::REPOSITION,
                 ServoRestyleDamage::STORE_OVERFLOW,
@@ -239,17 +244,18 @@ fn compute_damage(old: &ComputedValues, 
             new,
             damage,
             [
                 ServoRestyleDamage::REPAINT,
                 ServoRestyleDamage::REPOSITION,
                 ServoRestyleDamage::STORE_OVERFLOW,
                 ServoRestyleDamage::REFLOW_OUT_OF_FLOW
             ]
-        ) || restyle_damage_repaint!(old, new, damage, [ServoRestyleDamage::REPAINT]);
+        ) ||
+        restyle_damage_repaint!(old, new, damage, [ServoRestyleDamage::REPAINT]);
 
     // Paint worklets may depend on custom properties,
     // so if they have changed we should repaint.
     if old.custom_properties() != new.custom_properties() {
         damage.insert(ServoRestyleDamage::REPAINT);
     }
 
     // If the layer requirements of this flow have changed due to the value
--- a/servo/components/style/servo/selector_parser.rs
+++ b/servo/components/style/servo/selector_parser.rs
@@ -132,17 +132,19 @@ impl PseudoElement {
     /// Whether the current pseudo element is ::before or ::after.
     #[inline]
     pub fn is_before_or_after(&self) -> bool {
         self.is_before() || self.is_after()
     }
 
     /// Whether this is an unknown ::-webkit- pseudo-element.
     #[inline]
-    pub fn is_unknown_webkit_pseudo_element(&self) -> bool { false }
+    pub fn is_unknown_webkit_pseudo_element(&self) -> bool {
+        false
+    }
 
     /// Whether this pseudo-element is the ::before pseudo.
     #[inline]
     pub fn is_before(&self) -> bool {
         *self == PseudoElement::Before
     }
 
     /// Whether this pseudo-element is the ::after pseudo.
@@ -761,17 +763,18 @@ impl ServoElementSnapshot {
     /// selectors::Element::attr_matches
     pub fn attr_matches(
         &self,
         ns: &NamespaceConstraint<&Namespace>,
         local_name: &LocalName,
         operation: &AttrSelectorOperation<&String>,
     ) -> bool {
         match *ns {
-            NamespaceConstraint::Specific(ref ns) => self.get_attr(ns, local_name)
+            NamespaceConstraint::Specific(ref ns) => self
+                .get_attr(ns, local_name)
                 .map_or(false, |value| value.eval_selector(operation)),
             NamespaceConstraint::Any => {
                 self.any_attr_ignore_ns(local_name, |value| value.eval_selector(operation))
             },
         }
     }
 }
 
--- a/servo/components/style/sharing/mod.rs
+++ b/servo/components/style/sharing/mod.rs
@@ -192,18 +192,17 @@ impl ValidationData {
         E: TElement,
     {
         self.parent_style_identity
             .get_or_insert_with(|| {
                 let parent = el.inheritance_parent().unwrap();
                 let values =
                     OpaqueComputedValues::from(parent.borrow_data().unwrap().styles.primary());
                 values
-            })
-            .clone()
+            }).clone()
     }
 
     /// Computes the revalidation results if needed, and returns it.
     /// Inline so we know at compile time what bloom_known_valid is.
     #[inline]
     fn revalidation_match_results<E, F>(
         &mut self,
         element: E,
--- a/servo/components/style/style_adjuster.rs
+++ b/servo/components/style/style_adjuster.rs
@@ -59,49 +59,68 @@ fn is_effective_display_none_for_display
 where
     E: TElement,
 {
     use Atom;
 
     // FIXME(emilio): This should be an actual static.
     lazy_static! {
         static ref SPECIAL_HTML_ELEMENTS: [Atom; 16] = [
-            atom!("br"), atom!("wbr"), atom!("meter"), atom!("progress"),
-            atom!("canvas"), atom!("embed"), atom!("object"), atom!("audio"),
-            atom!("iframe"), atom!("img"), atom!("video"), atom!("frame"),
-            atom!("frameset"), atom!("input"), atom!("textarea"),
+            atom!("br"),
+            atom!("wbr"),
+            atom!("meter"),
+            atom!("progress"),
+            atom!("canvas"),
+            atom!("embed"),
+            atom!("object"),
+            atom!("audio"),
+            atom!("iframe"),
+            atom!("img"),
+            atom!("video"),
+            atom!("frame"),
+            atom!("frameset"),
+            atom!("input"),
+            atom!("textarea"),
             atom!("select"),
         ];
     }
 
     // https://drafts.csswg.org/css-display/#unbox-svg
     //
     // There's a note about "Unknown elements", but there's not a good way to
     // know what that means, or to get that information from here, and no other
     // UA implements this either.
     lazy_static! {
         static ref SPECIAL_SVG_ELEMENTS: [Atom; 6] = [
-            atom!("svg"), atom!("a"), atom!("g"), atom!("use"),
-            atom!("tspan"), atom!("textPath"),
+            atom!("svg"),
+            atom!("a"),
+            atom!("g"),
+            atom!("use"),
+            atom!("tspan"),
+            atom!("textPath"),
         ];
     }
 
     // https://drafts.csswg.org/css-display/#unbox-html
     if element.is_html_element() {
         let local_name = element.local_name();
-        return SPECIAL_HTML_ELEMENTS.iter().any(|name| &**name == local_name);
+        return SPECIAL_HTML_ELEMENTS
+            .iter()
+            .any(|name| &**name == local_name);
     }
 
     // https://drafts.csswg.org/css-display/#unbox-svg
     if element.is_svg_element() {
         if is_topmost_svg_svg_element(element) {
             return true;
         }
         let local_name = element.local_name();
-        return !SPECIAL_SVG_ELEMENTS.iter().any(|name| &**name == local_name);
+        return !SPECIAL_SVG_ELEMENTS
+            .iter()
+            .any(|name| &**name == local_name);
     }
 
     // https://drafts.csswg.org/css-display/#unbox-mathml
     //
     // We always treat XUL as display: none. We don't use display:
     // contents in XUL anyway, so should be fine to be consistent with
     // MathML unless there's a use case for it.
     if element.is_mathml_element() || element.is_xul_element() {
@@ -196,21 +215,21 @@ impl<'a, 'b: 'a> StyleAdjuster<'a, 'b> {
                 .set_adjusted_display(blockified_display, is_item_or_root);
         }
     }
 
     /// Compute a few common flags for both text and element's style.
     pub fn set_bits(&mut self) {
         let display = self.style.get_box().clone_display();
 
-        if !display.is_contents() &&
-            !self.style
-                .get_text()
-                .clone_text_decoration_line()
-                .is_empty()
+        if !display.is_contents() && !self
+            .style
+            .get_text()
+            .clone_text_decoration_line()
+            .is_empty()
         {
             self.style
                 .flags
                 .insert(ComputedValueFlags::HAS_TEXT_DECORATION_LINES);
         }
 
         if self.style.is_pseudo_element() {
             self.style
@@ -275,20 +294,20 @@ impl<'a, 'b: 'a> StyleAdjuster<'a, 'b> {
     /// additionally it applies it if it is in any ruby box.
     ///
     /// This is necessary because its parent may not itself have the flag set
     /// (e.g. ruby or ruby containers), thus we may not inherit the flag from
     /// them.
     #[cfg(feature = "gecko")]
     fn adjust_for_text_in_ruby(&mut self) {
         let parent_display = self.style.get_parent_box().clone_display();
-        if parent_display.is_ruby_type() ||
-            self.style
-                .get_parent_flags()
-                .contains(ComputedValueFlags::SHOULD_SUPPRESS_LINEBREAK)
+        if parent_display.is_ruby_type() || self
+            .style
+            .get_parent_flags()
+            .contains(ComputedValueFlags::SHOULD_SUPPRESS_LINEBREAK)
         {
             self.style
                 .flags
                 .insert(ComputedValueFlags::SHOULD_SUPPRESS_LINEBREAK);
         }
     }
 
     /// <https://drafts.csswg.org/css-writing-modes-3/#block-flow:>
@@ -365,20 +384,22 @@ impl<'a, 'b: 'a> StyleAdjuster<'a, 'b> {
     ///
     /// This is moved to properties.rs for convenience.
     fn adjust_for_border_width(&mut self) {
         properties::adjust_border_width(self.style);
     }
 
     /// The initial value of outline-width may be changed at computed value time.
     fn adjust_for_outline(&mut self) {
-        if self.style
+        if self
+            .style
             .get_outline()
             .clone_outline_style()
-            .none_or_hidden() && self.style.get_outline().outline_has_nonzero_width()
+            .none_or_hidden() &&
+            self.style.get_outline().outline_has_nonzero_width()
         {
             self.style.mutate_outline().set_outline_width(Au(0).into());
         }
     }
 
     /// CSS3 overflow-x and overflow-y require some fixup as well in some
     /// cases.
     ///
@@ -512,17 +533,19 @@ impl<'a, 'b: 'a> StyleAdjuster<'a, 'b> {
     /// style, since otherwise we're going to have the same subtle bugs WebKit
     /// and Blink have with this very same thing.
     #[cfg(feature = "servo")]
     fn adjust_for_text_decorations_in_effect(&mut self) {
         use values::computed::text::TextDecorationsInEffect;
 
         let decorations_in_effect = TextDecorationsInEffect::from_style(&self.style);
         if self.style.get_inherited_text().text_decorations_in_effect != decorations_in_effect {
-            self.style.mutate_inherited_text().text_decorations_in_effect = decorations_in_effect;
+            self.style
+                .mutate_inherited_text()
+                .text_decorations_in_effect = decorations_in_effect;
         }
     }
 
     #[cfg(feature = "gecko")]
     fn should_suppress_linebreak(&self, layout_parent_style: &ComputedValues) -> bool {
         // Line break suppression should only be propagated to in-flow children.
         if self.style.floated() || self.style.out_of_flow_positioned() {
             return false;
@@ -672,21 +695,18 @@ impl<'a, 'b: 'a> StyleAdjuster<'a, 'b> {
     }
 
     /// Adjusts the style to account for various fixups that don't fit naturally
     /// into the cascade.
     ///
     /// When comparing to Gecko, this is similar to the work done by
     /// `ComputedStyle::ApplyStyleFixups`, plus some parts of
     /// `nsStyleSet::GetContext`.
-    pub fn adjust<E>(
-        &mut self,
-        layout_parent_style: &ComputedValues,
-        element: Option<E>,
-    ) where
+    pub fn adjust<E>(&mut self, layout_parent_style: &ComputedValues, element: Option<E>)
+    where
         E: TElement,
     {
         if cfg!(debug_assertions) {
             if element
                 .and_then(|e| e.implemented_pseudo_element())
                 .is_some()
             {
                 // It'd be nice to assert `self.style.pseudo == Some(&pseudo)`,
--- a/servo/components/style/style_resolver.rs
+++ b/servo/components/style/style_resolver.rs
@@ -185,18 +185,17 @@ where
     fn cascade_primary_style(
         &mut self,
         inputs: CascadeInputs,
         parent_style: Option<&ComputedValues>,
         layout_parent_style: Option<&ComputedValues>,
     ) -> PrimaryStyle {
         // Before doing the cascade, check the sharing cache and see if we can
         // reuse the style via rule node identity.
-        let may_reuse =
-            !self.element.is_in_native_anonymous_subtree() &&
+        let may_reuse = !self.element.is_in_native_anonymous_subtree() &&
             parent_style.is_some() &&
             inputs.rules.is_some();
 
         if may_reuse {
             let cached = self.context.thread_local.sharing_cache.lookup_by_rules(
                 self.context.shared,
                 parent_style.unwrap(),
                 inputs.rules.as_ref().unwrap(),
@@ -480,17 +479,18 @@ where
             self.element.implemented_pseudo_element().is_none(),
             "Element pseudos can't have any other pseudo."
         );
 
         let mut applicable_declarations = ApplicableDeclarationList::new();
 
         let stylist = &self.context.shared.stylist;
 
-        if !self.element
+        if !self
+            .element
             .may_generate_pseudo(pseudo_element, originating_element_style)
         {
             return None;
         }
 
         let bloom_filter = self.context.thread_local.bloom_filter.filter();
         let nth_index_cache = &mut self.context.thread_local.nth_index_cache;
 
--- a/servo/components/style/stylesheet_set.rs
+++ b/servo/components/style/stylesheet_set.rs
@@ -319,17 +319,18 @@ where
         // But we need to be marked as dirty, otherwise we'll never add the new
         // sheet!
         self.dirty = true;
     }
 
     fn insert_before(&mut self, sheet: S, before_sheet: &S) {
         debug_assert!(!self.contains(&sheet));
 
-        let index = self.entries
+        let index = self
+            .entries
             .iter()
             .position(|entry| entry.sheet == *before_sheet)
             .expect("`before_sheet` stylesheet not found");
 
         // Inserting stylesheets somewhere but at the end changes the validity
         // of the cascade data, but not the invalidation data.
         self.set_data_validity_at_least(DataValidity::CascadeInvalid);
         self.entries.insert(index, StylesheetSetEntry::new(sheet));
--- a/servo/components/style/stylesheets/document_rule.rs
+++ b/servo/components/style/stylesheets/document_rule.rs
@@ -104,44 +104,43 @@ pub enum DocumentMatchingFunction {
     Domain(String),
     /// Regular expression matching function. It evaluates to true
     /// whenever the regular expression matches the entirety of the URL
     /// of the document being styled.
     #[css(function)]
     Regexp(String),
     /// Matching function for a media document.
     #[css(function)]
-    MediaDocument(MediaDocumentKind)
+    MediaDocument(MediaDocumentKind),
 }
 
 macro_rules! parse_quoted_or_unquoted_string {
     ($input:ident, $url_matching_function:expr) => {
         $input.parse_nested_block(|input| {
             let start = input.position();
             input
                 .parse_entirely(|input| {
                     let string = input.expect_string()?;
                     Ok($url_matching_function(string.as_ref().to_owned()))
-                })
-                .or_else(|_: ParseError| {
+                }).or_else(|_: ParseError| {
                     while let Ok(_) = input.next() {}
                     Ok($url_matching_function(input.slice_from(start).to_string()))
                 })
         })
     };
 }
 
 impl DocumentMatchingFunction {
     /// Parse a URL matching function for a`@document` rule's condition.
     pub fn parse<'i, 't>(
         context: &ParserContext,
         input: &mut Parser<'i, 't>,
     ) -> Result<Self, ParseError<'i>> {
         if let Ok(url) = input.try(|input| CssUrl::parse(context, input)) {
-            return Ok(DocumentMatchingFunction::Url(url))
+            return Ok(DocumentMatchingFunction::Url(url));
         }
 
         let location = input.current_source_location();
         let function = input.expect_function()?.clone();
         match_ignore_ascii_case! { &function,
             "url-prefix" => {
                 parse_quoted_or_unquoted_string!(input, DocumentMatchingFunction::UrlPrefix)
             }
@@ -176,32 +175,32 @@ impl DocumentMatchingFunction {
         use gecko_bindings::structs::DocumentMatchingFunction as GeckoDocumentMatchingFunction;
         use nsstring::nsCStr;
 
         let func = match *self {
             DocumentMatchingFunction::Url(_) => GeckoDocumentMatchingFunction::URL,
             DocumentMatchingFunction::UrlPrefix(_) => GeckoDocumentMatchingFunction::URLPrefix,
             DocumentMatchingFunction::Domain(_) => GeckoDocumentMatchingFunction::Domain,
             DocumentMatchingFunction::Regexp(_) => GeckoDocumentMatchingFunction::RegExp,
-            DocumentMatchingFunction::MediaDocument(_) => GeckoDocumentMatchingFunction::MediaDocument,
+            DocumentMatchingFunction::MediaDocument(_) => {
+                GeckoDocumentMatchingFunction::MediaDocument
+            },
         };
 
         let pattern = nsCStr::from(match *self {
             DocumentMatchingFunction::Url(ref url) => url.as_str(),
             DocumentMatchingFunction::UrlPrefix(ref pat) |
             DocumentMatchingFunction::Domain(ref pat) |
             DocumentMatchingFunction::Regexp(ref pat) => pat,
-            DocumentMatchingFunction::MediaDocument(kind) => {
-                match kind {
-                    MediaDocumentKind::All => "all",
-                    MediaDocumentKind::Image => "image",
-                    MediaDocumentKind::Plugin => "plugin",
-                    MediaDocumentKind::Video => "video",
-                }
-            }
+            DocumentMatchingFunction::MediaDocument(kind) => match kind {
+                MediaDocumentKind::All => "all",
+                MediaDocumentKind::Image => "image",
+                MediaDocumentKind::Plugin => "plugin",
+                MediaDocumentKind::Video => "video",
+            },
         });
         unsafe { Gecko_DocumentRule_UseForPresentation(device.pres_context(), &*pattern, func) }
     }
 
     #[cfg(not(feature = "gecko"))]
     /// Evaluate a URL matching function.
     pub fn evaluate(&self, _: &Device) -> bool {
         false
--- a/servo/components/style/stylesheets/font_feature_values_rule.rs
+++ b/servo/components/style/stylesheets/font_feature_values_rule.rs
@@ -65,17 +65,18 @@ impl Parse for SingleValue {
     fn parse<'i, 't>(
         _context: &ParserContext,
         input: &mut Parser<'i, 't>,
     ) -> Result<SingleValue, ParseError<'i>> {
         let location = input.current_source_location();
         match *input.next()? {
             Token::Number {
                 int_value: Some(v), ..
-            } if v >= 0 =>
+            }
+                if v >= 0 =>
             {
                 Ok(SingleValue(v as u32))
             },
             ref t => Err(location.new_unexpected_token_error(t.clone())),
         }
     }
 }
 
@@ -97,27 +98,29 @@ impl Parse for PairValues {
     fn parse<'i, 't>(
         _context: &ParserContext,
         input: &mut Parser<'i, 't>,
     ) -> Result<PairValues, ParseError<'i>> {
         let location = input.current_source_location();
         let first = match *input.next()? {
             Token::Number {
                 int_value: Some(a), ..
-            } if a >= 0 =>
+            }
+                if a >= 0 =>
             {
                 a as u32
             },
             ref t => return Err(location.new_unexpected_token_error(t.clone())),
         };
         let location = input.current_source_location();
         match input.next() {
             Ok(&Token::Number {
                 int_value: Some(b), ..
-            }) if b >= 0 =>
+            })
+                if b >= 0 =>
             {
                 Ok(PairValues(first, Some(b as u32)))
             },
             // It can't be anything other than number.
             Ok(t) => Err(location.new_unexpected_token_error(t.clone())),
             // It can be just one value.
             Err(_) => Ok(PairValues(first, None)),
         }
@@ -149,17 +152,18 @@ impl Parse for VectorValues {
         input: &mut Parser<'i, 't>,
     ) -> Result<VectorValues, ParseError<'i>> {
         let mut vec = vec![];
         loop {
             let location = input.current_source_location();
             match input.next() {
                 Ok(&Token::Number {
                     int_value: Some(a), ..
-                }) if a >= 0 =>
+                })
+                    if a >= 0 =>
                 {
                     vec.push(a as u32);
                 }
                 // It can't be anything other than number.
                 Ok(t) => return Err(location.new_unexpected_token_error(t.clone())),
                 Err(_) => break,
             }
         }
--- a/servo/components/style/stylesheets/keyframes_rule.rs
+++ b/servo/components/style/stylesheets/keyframes_rule.rs
@@ -77,26 +77,24 @@ impl DeepCloneWithLock for KeyframesRule
     fn deep_clone_with_lock(
         &self,
         lock: &SharedRwLock,
         guard: &SharedRwLockReadGuard,
         params: &DeepCloneParams,
     ) -> Self {
         KeyframesRule {
             name: self.name.clone(),
-            keyframes: self.keyframes
+            keyframes: self
+                .keyframes
                 .iter()
                 .map(|x| {
-                    Arc::new(lock.wrap(x.read_with(guard).deep_clone_with_lock(
-                        lock,
-                        guard,
-                        params,
-                    )))
-                })
-                .collect(),
+                    Arc::new(
+                        lock.wrap(x.read_with(guard).deep_clone_with_lock(lock, guard, params)),
+                    )
+                }).collect(),
             vendor_prefix: self.vendor_prefix.clone(),
             source_location: self.source_location.clone(),
         }
     }
 }
 
 /// A number from 0 to 1, indicating the percentage of the animation when this
 /// keyframe should run.
@@ -137,17 +135,18 @@ impl KeyframePercentage {
                 Ok(KeyframePercentage::new(0.))
             },
             Token::Ident(ref identifier) if identifier.as_ref().eq_ignore_ascii_case("to") => {
                 Ok(KeyframePercentage::new(1.))
             },
             Token::Percentage {
                 unit_value: percentage,
                 ..
-            } if percentage >= 0. && percentage <= 1. =>
+            }
+                if percentage >= 0. && percentage <= 1. =>
             {
                 Ok(KeyframePercentage::new(percentage))
             },
             _ => Err(input.new_unexpected_token_error(token)),
         }
     }
 }
 
@@ -256,18 +255,20 @@ impl DeepCloneWithLock for Keyframe {
 /// declarations to apply.
 ///
 /// TODO: Find a better name for this?
 #[derive(Clone, Debug, MallocSizeOf)]
 pub enum KeyframesStepValue {
     /// A step formed by a declaration block specified by the CSS.
     Declarations {
         /// The declaration block per se.
-        #[cfg_attr(feature = "gecko",
-                   ignore_malloc_size_of = "XXX: Primary ref, measure if DMD says it's worthwhile")]
+        #[cfg_attr(
+            feature = "gecko",
+            ignore_malloc_size_of = "XXX: Primary ref, measure if DMD says it's worthwhile"
+        )]
         #[cfg_attr(feature = "servo", ignore_malloc_size_of = "Arc")]
         block: Arc<Locked<PropertyDeclarationBlock>>,
     },
     /// A synthetic step computed from the current computed values at the time
     /// of the animation.
     ComputedValues,
 }
 
@@ -321,18 +322,17 @@ impl KeyframesStep {
             return None;
         }
         match self.value {
             KeyframesStepValue::Declarations { ref block } => {
                 let guard = block.read_with(guard);
                 let (declaration, _) = guard
                     .get(PropertyDeclarationId::Longhand(
                         LonghandId::AnimationTimingFunction,
-                    ))
-                    .unwrap();
+                    )).unwrap();
                 match *declaration {
                     PropertyDeclaration::AnimationTimingFunction(ref value) => {
                         // Use the first value.
                         Some(value.0[0])
                     },
                     PropertyDeclaration::CSSWideKeyword(..) => None,
                     PropertyDeclaration::WithVariables(..) => None,
                     _ => panic!(),
@@ -495,17 +495,17 @@ pub fn parse_keyframe_list(
     RuleListParser::new_for_nested_rule(
         input,
         KeyframeListParser {
             context: context,
             shared_lock: shared_lock,
             declarations: &mut declarations,
         },
     ).filter_map(Result::ok)
-        .collect()
+    .collect()
 }
 
 impl<'a, 'i> AtRuleParser<'i> for KeyframeListParser<'a> {
     type PreludeNoBlock = ();
     type PreludeBlock = ();
     type AtRule = Arc<Locked<Keyframe>>;
     type Error = StyleParseErrorKind<'i>;
 }
@@ -520,17 +520,17 @@ impl<'a, 'i> QualifiedRuleParser<'i> for
         input: &mut Parser<'i, 't>,
     ) -> Result<Self::Prelude, ParseError<'i>> {
         let start_position = input.position();
         KeyframeSelector::parse(input).map_err(|e| {
             let location = e.location;
             let error = ContextualParseError::InvalidKeyframeRule(
                 input.slice_from(start_position),
                 e.clone(),
-                );
+            );
             self.context.log_css_error(location, error);
             e
         })
     }
 
     fn parse_block<'t>(
         &mut self,
         selector: Self::Prelude,
@@ -547,20 +547,17 @@ impl<'a, 'i> QualifiedRuleParser<'i> for
             context: &context,
             declarations: self.declarations,
         };
         let mut iter = DeclarationListParser::new(input, parser);
         let mut block = PropertyDeclarationBlock::new();
         while let Some(declaration) = iter.next() {
             match declaration {
                 Ok(()) => {
-                    block.extend(
-                        iter.parser.declarations.drain(),
-                        Importance::Normal,
-                    );
+                    block.extend(iter.parser.declarations.drain(), Importance::Normal);
                 },
                 Err((error, slice)) => {
                     iter.parser.declarations.clear();
                     let location = error.location;
                     let error =
                         ContextualParseError::UnsupportedKeyframePropertyDeclaration(slice, error);
                     context.log_css_error(location, error);
                 },
@@ -594,19 +591,19 @@ impl<'a, 'b, 'i> DeclarationParser<'i> f
 
     fn parse_value<'t>(
         &mut self,
         name: CowRcStr<'i>,
         input: &mut Parser<'i, 't>,
     ) -> Result<(), ParseError<'i>> {
         let id = match PropertyId::parse(&name, self.context) {
             Ok(id) => id,
-            Err(()) => return Err(input.new_custom_error(
-                StyleParseErrorKind::UnknownProperty(name)
-            )),
+            Err(()) => {
+                return Err(input.new_custom_error(StyleParseErrorKind::UnknownProperty(name)))
+            },
         };
 
         // TODO(emilio): Shouldn't this use parse_entirely?
         PropertyDeclaration::parse_into(self.declarations, id, self.context, input)?;
 
         // In case there is still unparsed text in the declaration, we should
         // roll back.
         input.expect_exhausted()?;
--- a/servo/components/style/stylesheets/mod.rs
+++ b/servo/components/style/stylesheets/mod.rs
@@ -58,17 +58,17 @@ pub use self::viewport_rule::ViewportRul
 /// Extra data that the backend may need to resolve url values.
 #[cfg(not(feature = "gecko"))]
 pub type UrlExtraData = ::servo_url::ServoUrl;
 
 /// Extra data that the backend may need to resolve url values.
 #[cfg(feature = "gecko")]
 #[derive(Clone, PartialEq)]
 pub struct UrlExtraData(
-    pub ::gecko_bindings::sugar::refptr::RefPtr<::gecko_bindings::structs::URLExtraData>
+    pub ::gecko_bindings::sugar::refptr::RefPtr<::gecko_bindings::structs::URLExtraData>,
 );
 
 #[cfg(feature = "gecko")]
 impl UrlExtraData {
     /// True if this URL scheme is chrome.
     #[inline]
     pub fn is_chrome(&self) -> bool {
         self.0.mIsChrome
@@ -97,21 +97,24 @@ impl fmt::Debug for UrlExtraData {
                 let mut spec = nsCString::new();
                 unsafe {
                     bindings::Gecko_nsIURI_Debug(self.0, &mut spec);
                 }
                 spec.fmt(formatter)
             }
         }
 
-        formatter.debug_struct("URLExtraData")
+        formatter
+            .debug_struct("URLExtraData")
             .field("is_chrome", &self.is_chrome())
             .field("base", &DebugURI(self.0.mBaseURI.raw::<structs::nsIURI>()))
-            .field("referrer", &DebugURI(self.0.mReferrer.raw::<structs::nsIURI>()))
-            .finish()
+            .field(
+                "referrer",
+                &DebugURI(self.0.mReferrer.raw::<structs::nsIURI>()),
+            ).finish()
     }
 }
 
 // XXX We probably need to figure out whether we should mark Eq here.
 // It is currently marked so because properties::UnparsedValue wants Eq.
 #[cfg(feature = "gecko")]
 impl Eq for UrlExtraData {}
 
@@ -280,19 +283,17 @@ impl CssRule {
             loader,
             state,
             dom_error: None,
             namespaces: &mut *guard,
             insert_rule_context: Some(insert_rule_context),
         };
 
         parse_one_rule(&mut input, &mut rule_parser)
-            .map_err(|_| {
-                rule_parser.dom_error.unwrap_or(RulesMutateError::Syntax)
-            })
+            .map_err(|_| rule_parser.dom_error.unwrap_or(RulesMutateError::Syntax))
     }
 }
 
 impl DeepCloneWithLock for CssRule {
     /// Deep clones this CssRule.
     fn deep_clone_with_lock(
         &self,
         lock: &SharedRwLock,
@@ -300,35 +301,32 @@ impl DeepCloneWithLock for CssRule {
         params: &DeepCloneParams,
     ) -> CssRule {
         match *self {
             CssRule::Namespace(ref arc) => {
                 let rule = arc.read_with(guard);
                 CssRule::Namespace(Arc::new(lock.wrap(rule.clone())))
             },
             CssRule::Import(ref arc) => {
-                let rule = arc.read_with(guard)
+                let rule = arc
+                    .read_with(guard)
                     .deep_clone_with_lock(lock, guard, params);
                 CssRule::Import(Arc::new(lock.wrap(rule)))
             },
             CssRule::Style(ref arc) => {
                 let rule = arc.read_with(guard);
-                CssRule::Style(Arc::new(lock.wrap(rule.deep_clone_with_lock(
-                    lock,
-                    guard,
-                    params,
-                ))))
+                CssRule::Style(Arc::new(
+                    lock.wrap(rule.deep_clone_with_lock(lock, guard, params)),
+                ))
             },
             CssRule::Media(ref arc) => {
                 let rule = arc.read_with(guard);
-                CssRule::Media(Arc::new(lock.wrap(rule.deep_clone_with_lock(
-                    lock,
-                    guard,
-                    params,
-                ))))
+                CssRule::Media(Arc::new(
+                    lock.wrap(rule.deep_clone_with_lock(lock, guard, params)),
+                ))
             },
             CssRule::FontFace(ref arc) => {
                 let rule = arc.read_with(guard);
                 CssRule::FontFace(Arc::new(lock.wrap(rule.clone())))
             },
             CssRule::FontFeatureValues(ref arc) => {
                 let rule = arc.read_with(guard);
                 CssRule::FontFeatureValues(Arc::new(lock.wrap(rule.clone())))
@@ -338,45 +336,37 @@ impl DeepCloneWithLock for CssRule {
                 CssRule::CounterStyle(Arc::new(lock.wrap(rule.clone())))
             },
             CssRule::Viewport(ref arc) => {
                 let rule = arc.read_with(guard);
                 CssRule::Viewport(Arc::new(lock.wrap(rule.clone())))
             },
             CssRule::Keyframes(ref arc) => {
                 let rule = arc.read_with(guard);
-                CssRule::Keyframes(Arc::new(lock.wrap(rule.deep_clone_with_lock(
-                    lock,
-                    guard,
-                    params,
-                ))))
+                CssRule::Keyframes(Arc::new(
+                    lock.wrap(rule.deep_clone_with_lock(lock, guard, params)),
+                ))
             },
             CssRule::Supports(ref arc) => {
                 let rule = arc.read_with(guard);
-                CssRule::Supports(Arc::new(lock.wrap(rule.deep_clone_with_lock(
-                    lock,
-                    guard,
-                    params,
-                ))))
+                CssRule::Supports(Arc::new(
+                    lock.wrap(rule.deep_clone_with_lock(lock, guard, params)),
+                ))
             },
             CssRule::Page(ref arc) => {
                 let rule = arc.read_with(guard);
-                CssRule::Page(Arc::new(lock.wrap(rule.deep_clone_with_lock(
-                    lock,
-                    guard,
-                    params,
-                ))))
+                CssRule::Page(Arc::new(
+                    lock.wrap(rule.deep_clone_with_lock(lock, guard, params)),
+                ))
             },
             CssRule::Document(ref arc) => {
                 let rule = arc.read_with(guard);
-                CssRule::Document(Arc::new(lock.wrap(rule.deep_clone_with_lock(
-                    lock,
-                    guard,
-                    params,
-                ))))
+                CssRule::Document(Arc::new(
+                    lock.wrap(rule.deep_clone_with_lock(lock, guard, params)),
+                ))
             },
         }
     }
 }
 
 impl ToCssWithGuard for CssRule {
     // https://drafts.csswg.org/cssom/#serialize-a-css-rule
     fn to_css(&self, guard: &SharedRwLockReadGuard, dest: &mut CssStringWriter) -> fmt::Result {
--- a/servo/components/style/stylesheets/rule_list.rs
+++ b/servo/components/style/stylesheets/rule_list.rs
@@ -151,17 +151,21 @@ impl CssRulesHelpers for RawOffsetArc<Lo
             }
 
             // Computes the parser state at the given index
             let state = if nested {
                 State::Body
             } else if index == 0 {
                 State::Start
             } else {
-                rules.0.get(index - 1).map(CssRule::rule_state).unwrap_or(State::Body)
+                rules
+                    .0
+                    .get(index - 1)
+                    .map(CssRule::rule_state)
+                    .unwrap_or(State::Body)
             };
 
             let insert_rule_context = InsertRuleContext {
                 rule_list: &rules.0,
                 index,
             };
 
             // Steps 3, 4, 5, 6
--- a/servo/components/style/stylesheets/rule_parser.rs
+++ b/servo/components/style/stylesheets/rule_parser.rs
@@ -105,18 +105,19 @@ impl<'b> TopLevelRuleParser<'b> {
         if new_state > next_rule_state {
             self.dom_error = Some(RulesMutateError::HierarchyRequest);
             return false;
         }
 
         // If there's anything that isn't a namespace rule (or import rule, but
         // we checked that already at the beginning), reject with a
         // StateError.
-        if new_state == State::Namespaces &&
-            ctx.rule_list[ctx.index..].iter().any(|r| !matches!(*r, CssRule::Namespace(..)))
+        if new_state == State::Namespaces && ctx.rule_list[ctx.index..]
+            .iter()
+            .any(|r| !matches!(*r, CssRule::Namespace(..)))
         {
             self.dom_error = Some(RulesMutateError::InvalidState);
             return false;
         }
 
         true
     }
 }
@@ -222,17 +223,17 @@ impl<'a, 'i> AtRuleParser<'i> for TopLev
             "charset" => {
                 self.dom_error = Some(RulesMutateError::HierarchyRequest);
                 return Err(input.new_custom_error(StyleParseErrorKind::UnexpectedCharsetRule))
             }
             _ => {}
         }
 
         if !self.check_state(State::Body) {
-            return Err(input.new_custom_error(StyleParseErrorKind::UnspecifiedError))
+            return Err(input.new_custom_error(StyleParseErrorKind::UnspecifiedError));
         }
 
         AtRuleParser::parse_prelude(&mut self.nested(), name, input)
     }
 
     #[inline]
     fn parse_block<'t>(
         &mut self,
@@ -249,17 +250,18 @@ impl<'a, 'i> AtRuleParser<'i> for TopLev
     #[inline]
     fn rule_without_block(
         &mut self,
         prelude: AtRuleNonBlockPrelude,
         source_location: SourceLocation,
     ) -> CssRule {
         match prelude {
             AtRuleNonBlockPrelude::Import(url, media) => {
-                let loader = self.loader
+                let loader = self
+                    .loader
                     .expect("Expected a stylesheet loader for @import");
 
                 let import_rule = loader.request_stylesheet(
                     url,
                     source_location,
                     &self.context,
                     &self.shared_lock,
                     media,
@@ -294,38 +296,35 @@ impl<'a, 'i> QualifiedRuleParser<'i> for
     type Error = StyleParseErrorKind<'i>;
 
     #[inline]
     fn parse_prelude<'t>(
         &mut self,
         input: &mut Parser<'i, 't>,
     ) -> Result<Self::Prelude, ParseError<'i>> {
         if !self.check_state(State::Body) {
-            return Err(input.new_custom_error(StyleParseErrorKind::UnspecifiedError))
+            return Err(input.new_custom_error(StyleParseErrorKind::UnspecifiedError));
         }
 
         QualifiedRuleParser::parse_prelude(&mut self.nested(), input)
     }
 
     #[inline]
     fn parse_block<'t>(
         &mut self,
         prelude: Self::Prelude,
         location: SourceLocation,
         input: &mut Parser<'i, 't>,
     ) -> Result<CssRule, ParseError<'i>> {
-        QualifiedRuleParser::parse_block(
-            &mut self.nested(),
-            prelude,
-            location,
-            input,
-        ).map(|result| {
-            self.state = State::Body;
-            result
-        })
+        QualifiedRuleParser::parse_block(&mut self.nested(), prelude, location, input).map(
+            |result| {
+                self.state = State::Body;
+                result
+            },
+        )
     }
 }
 
 #[derive(Clone)] // shallow, relatively cheap .clone
 struct NestedRuleParser<'a, 'b: 'a> {
     stylesheet_origin: Origin,
     shared_lock: &'a SharedRwLock,
     context: &'a ParserContext<'b>,
@@ -333,21 +332,17 @@ struct NestedRuleParser<'a, 'b: 'a> {
 }
 
 impl<'a, 'b> NestedRuleParser<'a, 'b> {
     fn parse_nested_rules(
         &mut self,
         input: &mut Parser,
         rule_type: CssRuleType,
     ) -> Arc<Locked<CssRules>> {
-        let context = ParserContext::new_with_rule_type(
-            self.context,
-            rule_type,
-            self.namespaces,
-        );
+        let context = ParserContext::new_with_rule_type(self.context, rule_type, self.namespaces);
 
         let nested_parser = NestedRuleParser {
             stylesheet_origin: self.stylesheet_origin,
             shared_lock: self.shared_lock,
             context: &context,
             namespaces: self.namespaces,
         };
 
@@ -473,41 +468,29 @@ impl<'a, 'b, 'i> AtRuleParser<'i> for Ne
             AtRuleBlockPrelude::FontFeatureValues(family_names) => {
                 let context = ParserContext::new_with_rule_type(
                     self.context,
                     CssRuleType::FontFeatureValues,
                     self.namespaces,
                 );
 
                 Ok(CssRule::FontFeatureValues(Arc::new(self.shared_lock.wrap(
-                    FontFeatureValuesRule::parse(
-                        &context,
-                        input,
-                        family_names,
-                        source_location,
-                    ),
+                    FontFeatureValuesRule::parse(&context, input, family_names, source_location),
                 ))))
             },
             AtRuleBlockPrelude::CounterStyle(name) => {
                 let context = ParserContext::new_with_rule_type(
                     self.context,
                     CssRuleType::CounterStyle,
                     self.namespaces,
                 );
 
-                Ok(CssRule::CounterStyle(Arc::new(
-                    self.shared_lock.wrap(
-                        parse_counter_style_body(
-                            name,
-                            &context,
-                            input,
-                            source_location,
-                        )?.into(),
-                    ),
-                )))
+                Ok(CssRule::CounterStyle(Arc::new(self.shared_lock.wrap(
+                    parse_counter_style_body(name, &context, input, source_location)?.into(),
+                ))))
             },
             AtRuleBlockPrelude::Media(media_queries) => {
                 Ok(CssRule::Media(Arc::new(self.shared_lock.wrap(MediaRule {
                     media_queries,
                     rules: self.parse_nested_rules(input, CssRuleType::Media),
                     source_location,
                 }))))
             },
@@ -530,49 +513,44 @@ impl<'a, 'b, 'i> AtRuleParser<'i> for Ne
             },
             AtRuleBlockPrelude::Viewport => {
                 let context = ParserContext::new_with_rule_type(
                     self.context,
                     CssRuleType::Viewport,
                     self.namespaces,
                 );
 
-                Ok(CssRule::Viewport(Arc::new(self.shared_lock.wrap(
-                    ViewportRule::parse(&context, input)?,
-                ))))
+                Ok(CssRule::Viewport(Arc::new(
+                    self.shared_lock.wrap(ViewportRule::parse(&context, input)?),
+                )))
             },
             AtRuleBlockPrelude::Keyframes(name, vendor_prefix) => {
                 let context = ParserContext::new_with_rule_type(
                     self.context,
                     CssRuleType::Keyframes,
                     self.namespaces,
                 );
 
                 Ok(CssRule::Keyframes(Arc::new(self.shared_lock.wrap(
                     KeyframesRule {
                         name,
-                        keyframes: parse_keyframe_list(
-                            &context,
-                            input,
-                            self.shared_lock,
-                        ),
+                        keyframes: parse_keyframe_list(&context, input, self.shared_lock),
                         vendor_prefix,
                         source_location,
                     },
                 ))))
             },
             AtRuleBlockPrelude::Page => {
                 let context = ParserContext::new_with_rule_type(
                     self.context,
                     CssRuleType::Page,
                     self.namespaces,
                 );
 
-                let declarations =
-                    parse_property_declaration_list(&context, input);
+                let declarations = parse_property_declaration_list(&context, input);
                 Ok(CssRule::Page(Arc::new(self.shared_lock.wrap(PageRule {
                     block: Arc::new(self.shared_lock.wrap(declarations)),
                     source_location,
                 }))))
             },
             AtRuleBlockPrelude::Document(condition) => {
                 if !cfg!(feature = "gecko") {
                     unreachable!()
--- a/servo/components/style/stylesheets/rules_iterator.rs
+++ b/servo/components/style/stylesheets/rules_iterator.rs
@@ -95,20 +95,17 @@ where
                         if !C::process_import(
                             self.guard,
                             self.device,
                             self.quirks_mode,
                             import_rule,
                         ) {
                             continue;
                         }
-                        import_rule
-                            .stylesheet
-                            .rules(self.guard)
-                            .iter()
+                        import_rule.stylesheet.rules(self.guard).iter()
                     },
                     CssRule::Document(ref doc_rule) => {
                         let doc_rule = doc_rule.read_with(self.guard);
                         if !C::process_document(self.guard, self.device, self.quirks_mode, doc_rule)
                         {
                             continue;
                         }
                         doc_rule.rules.read_with(self.guard).0.iter()
--- a/servo/components/style/stylesheets/stylesheet.rs
+++ b/servo/components/style/stylesheets/stylesheet.rs
@@ -124,17 +124,18 @@ impl StylesheetContents {
 impl DeepCloneWithLock for StylesheetContents {
     fn deep_clone_with_lock(
         &self,
         lock: &SharedRwLock,
         guard: &SharedRwLockReadGuard,
         params: &DeepCloneParams,
     ) -> Self {
         // Make a deep clone of the rules, using the new lock.
-        let rules = self.rules
+        let rules = self
+            .rules
             .read_with(guard)
             .deep_clone_with_lock(lock, guard, params);
 
         Self {
             rules: Arc::new(lock.wrap(rules)),
             quirks_mode: self.quirks_mode,
             origin: self.origin,
             url_data: RwLock::new((*self.url_data.read()).clone()),
@@ -174,17 +175,17 @@ macro_rules! rule_filter {
                     }
                 }
             }
         )+
     }
 }
 
 /// A trait to represent a given stylesheet in a document.
-pub trait StylesheetInDocument : ::std::fmt::Debug {
+pub trait StylesheetInDocument: ::std::fmt::Debug {
     /// Get the stylesheet origin.
     fn origin(&self, guard: &SharedRwLockReadGuard) -> Origin;
 
     /// Get the stylesheet quirks mode.
     fn quirks_mode(&self, guard: &SharedRwLockReadGuard) -> QuirksMode;
 
     /// Get whether this stylesheet is enabled.
     fn enabled(&self) -> bool;
@@ -394,20 +395,17 @@ impl Stylesheet {
                         // be shown incorrectly, but it's better than OOMing.
                         if rules.try_push(rule).is_err() {
                             break;
                         }
                     },
                     Err((error, slice)) => {
                         let location = error.location;
                         let error = ContextualParseError::InvalidRule(slice, error);
-                        iter.parser.context.log_css_error(
-                            location,
-                            error,
-                        );
+                        iter.parser.context.log_css_error(location, error);
                     },
                 }
             }
         }
 
         let source_map_url = input.current_source_map_url().map(String::from);
         let source_url = input.current_source_url().map(String::from);
         (rules, source_map_url, source_url)
@@ -473,17 +471,18 @@ impl Clone for Stylesheet {
     fn clone(&self) -> Self {
         // Create a new lock for our clone.
         let lock = self.shared_lock.clone();
         let guard = self.shared_lock.read();
 
         // Make a deep clone of the media, using the new lock.
         let media = self.media.read_with(&guard).clone();
         let media = Arc::new(lock.wrap(media));
-        let contents = self.contents
+        let contents = self
+            .contents
             .deep_clone_with_lock(&lock, &guard, &DeepCloneParams);
 
         Stylesheet {
             contents,
             media: media,
             shared_lock: lock,
             disabled: AtomicBool::new(self.disabled.load(Ordering::SeqCst)),
         }
--- a/servo/components/style/stylesheets/supports_rule.rs
+++ b/servo/components/style/stylesheets/supports_rule.rs
@@ -163,19 +163,17 @@ impl SupportsCondition {
                 // syntax, and evaluate it to false when not in chrome / ua sheet.
                 // See https://drafts.csswg.org/css-conditional-3/#general_enclosed
                 if ident.eq_ignore_ascii_case("-moz-bool-pref") {
                     if let Ok(name) = input.try(|i| {
                         i.parse_nested_block(|i| {
                             i.expect_string()
                                 .map(|s| s.to_string())
                                 .map_err(CssParseError::<()>::from)
-                        }).and_then(|s| {
-                                CString::new(s).map_err(|_| location.new_custom_error(()))
-                            })
+                        }).and_then(|s| CString::new(s).map_err(|_| location.new_custom_error(())))
                     }) {
                         return Ok(SupportsCondition::MozBoolPref(name));
                     }
                 }
             },
             t => return Err(location.new_unexpected_token_error(t)),
         }
         input.parse_nested_block(|i| consume_any_value(i))?;
@@ -310,29 +308,26 @@ impl Declaration {
     /// Determine if a declaration parses
     ///
     /// <https://drafts.csswg.org/css-conditional-3/#support-definition>
     pub fn eval(&self, context: &ParserContext) -> bool {
         debug_assert_eq!(context.rule_type(), CssRuleType::Style);
 
         let mut input = ParserInput::new(&self.0);
         let mut input = Parser::new(&mut input);
-        input.parse_entirely(|input| -> Result<(), CssParseError<()>> {
-            let prop = input.expect_ident_cloned().unwrap();
-            input.expect_colon().unwrap();
+        input
+            .parse_entirely(|input| -> Result<(), CssParseError<()>> {
+                let prop = input.expect_ident_cloned().unwrap();
+                input.expect_colon().unwrap();
 
-            let id = PropertyId::parse(&prop, context)
-                .map_err(|_| input.new_custom_error(()))?;
+                let id =
+                    PropertyId::parse(&prop, context).map_err(|_| input.new_custom_error(()))?;
 
-            let mut declarations = SourcePropertyDeclaration::new();
-            input.parse_until_before(Delimiter::Bang, |input| {
-                PropertyDeclaration::parse_into(
-                    &mut declarations,
-                    id,
-                    &context,
-                    input,
-                ).map_err(|_| input.new_custom_error(()))
-            })?;
-            let _ = input.try(parse_important);
-            Ok(())
-        }).is_ok()
+                let mut declarations = SourcePropertyDeclaration::new();
+                input.parse_until_before(Delimiter::Bang, |input| {
+                    PropertyDeclaration::parse_into(&mut declarations, id, &context, input)
+                        .map_err(|_| input.new_custom_error(()))
+                })?;
+                let _ = input.try(parse_important);
+                Ok(())
+            }).is_ok()
     }
 }
--- a/servo/components/style/stylesheets/viewport_rule.rs
+++ b/servo/components/style/stylesheets/viewport_rule.rs
@@ -370,18 +370,17 @@ impl ViewportRule {
                 Ok(declarations) => {
                     for declarations in declarations {
                         cascade.add(Cow::Owned(declarations))
                     }
                 },
                 Err((error, slice)) => {
                     let location = error.location;
                     let error = ContextualParseError::UnsupportedViewportDescriptorDeclaration(
-                        slice,
-                        error,
+                        slice, error,
                     );
                     context.log_css_error(location, error);
                 },
             }
         }
         Ok(ViewportRule {
             declarations: cascade.finish(),
         })
@@ -755,19 +754,19 @@ impl MaybeNew for ViewportConstraints {
                         ViewportLength::Specified(ref length) => match *length {
                             LengthOrPercentageOrAuto::Length(ref value) => {
                                 Some(Au::from(value.to_computed_value(&context)))
                             },
                             LengthOrPercentageOrAuto::Percentage(value) => {
                                 Some(initial_viewport.$dimension.scale_by(value.0))
                             },
                             LengthOrPercentageOrAuto::Auto => None,
-                            LengthOrPercentageOrAuto::Calc(ref calc) => calc.to_computed_value(
-                                &context,
-                            ).to_used_value(Some(initial_viewport.$dimension)),
+                            LengthOrPercentageOrAuto::Calc(ref calc) => calc
+                                .to_computed_value(&context)
+                                .to_used_value(Some(initial_viewport.$dimension)),
                         },
                         ViewportLength::ExtendToZoom => {
                             // $extend_to will be 'None' if 'extend-to-zoom' is 'auto'
                             match ($extend_to, $auto_extend_to) {
                                 (None, None) => None,
                                 (a, None) => a,
                                 (None, b) => b,
                                 (a, b) => cmp::max(a, b),
--- a/servo/components/style/stylist.rs
+++ b/servo/components/style/stylist.rs
@@ -179,18 +179,20 @@ impl UserAgentCascadeData {
         sizes.mPrecomputedPseudos += self.precomputed_pseudo_element_decls.size_of(ops);
     }
 }
 
 /// All the computed information for a stylesheet.
 #[derive(Default)]
 #[cfg_attr(feature = "servo", derive(MallocSizeOf))]
 struct DocumentCascadeData {
-    #[cfg_attr(feature = "servo",
-               ignore_malloc_size_of = "Arc, owned by UserAgentCascadeDataCache")]
+    #[cfg_attr(
+        feature = "servo",
+        ignore_malloc_size_of = "Arc, owned by UserAgentCascadeDataCache"
+    )]
     user_agent: Arc<UserAgentCascadeData>,
     user: CascadeData,
     author: CascadeData,
     per_origin: PerOrigin<()>,
 }
 
 /// An iterator over the cascade data of a given document.
 pub struct DocumentCascadeDataIter<'a> {
@@ -345,17 +347,20 @@ pub struct Stylist {
 
     /// Viewport constraints based on the current device.
     viewport_constraints: Option<ViewportConstraints>,
 
     /// The list of stylesheets.
     stylesheets: StylistStylesheetSet,
 
     /// If true, the quirks-mode stylesheet is applied.
-    #[cfg_attr(feature = "servo", ignore_malloc_size_of = "defined in selectors")]
+    #[cfg_attr(
+        feature = "servo",
+        ignore_malloc_size_of = "defined in selectors"
+    )]
     quirks_mode: QuirksMode,
 
     /// Selector maps for all of the style sheets in the stylist, after
     /// evalutaing media rules against the current device, split out per
     /// cascade level.
     cascade_data: DocumentCascadeData,
 
     /// Whether author styles are enabled.
@@ -676,17 +681,18 @@ impl Stylist {
     /// argument. This is useful for providing extra @page rules.
     pub fn rule_node_for_precomputed_pseudo(
         &self,
         guards: &StylesheetGuards,
         pseudo: &PseudoElement,
         extra_declarations: Option<Vec<ApplicableDeclarationBlock>>,
     ) -> StrongRuleNode {
         let mut decl;
-        let declarations = match self.cascade_data
+        let declarations = match self
+            .cascade_data
             .user_agent
             .precomputed_pseudo_element_decls
             .get(pseudo)
         {
             Some(declarations) => match extra_declarations {
                 Some(mut extra_decls) => {
                     decl = declarations.clone();
                     decl.append(&mut extra_decls);
@@ -847,17 +853,17 @@ impl Stylist {
         let visited_rules = match inputs.visited_rules.as_ref() {
             Some(rules) => Some(rules),
             None => {
                 if parent_style.and_then(|s| s.visited_style()).is_some() {
                     Some(inputs.rules.as_ref().unwrap_or(self.rule_tree.root()))
                 } else {
                     None
                 }
-            }
+            },
         };
 
         // Read the comment on `precomputed_values_for_pseudo` to see why it's
         // difficult to assert that display: contents nodes never arrive here
         // (tl;dr: It doesn't apply for replaced elements and such, but the
         // computed value is still "contents").
         //
         // FIXME(emilio): We should assert that it holds if pseudo.is_none()!
@@ -1126,17 +1132,18 @@ impl Stylist {
         );
         debug_assert!(pseudo_element.map_or(true, |p| !p.is_precomputed()));
 
         let rule_hash_target = element.rule_hash_target();
 
         let matches_user_rules = rule_hash_target.matches_user_and_author_rules();
 
         // Normal user-agent rules.
-        if let Some(map) = self.cascade_data
+        if let Some(map) = self
+            .cascade_data
             .user_agent
             .cascade_data
             .normal_rules(pseudo_element)
         {
             map.get_all_matching_rules(
                 element,
                 rule_hash_target,
                 applicable_declarations,
@@ -1202,17 +1209,20 @@ impl Stylist {
 
         // XBL / Shadow DOM rules, which are author rules too.
         //
         // TODO(emilio): Cascade order here is wrong for Shadow DOM. In
         // particular, normally document rules override ::slotted() rules, but
         // for !important it should be the other way around. So probably we need
         // to add some sort of AuthorScoped cascade level or something.
         if let Some(shadow) = rule_hash_target.shadow_root() {
-            if let Some(map) = shadow.style_data().and_then(|data| data.host_rules(pseudo_element)) {
+            if let Some(map) = shadow
+                .style_data()
+                .and_then(|data| data.host_rules(pseudo_element))
+            {
                 context.with_shadow_host(Some(rule_hash_target), |context| {
                     map.get_all_matching_rules(
                         element,
                         rule_hash_target,
                         applicable_declarations,
                         context,
                         flags_setter,
                         CascadeLevel::InnerShadowNormal,
@@ -1229,17 +1239,20 @@ impl Stylist {
         let mut current = rule_hash_target.assigned_slot();
         while let Some(slot) = current {
             slots.push(slot);
             current = slot.assigned_slot();
         }
 
         for slot in slots.iter().rev() {
             let shadow = slot.containing_shadow().unwrap();
-            if let Some(map) = shadow.style_data().and_then(|data| data.slotted_rules(pseudo_element)) {
+            if let Some(map) = shadow
+                .style_data()
+                .and_then(|data| data.slotted_rules(pseudo_element))
+            {
                 context.with_shadow_host(Some(shadow.host()), |context| {
                     map.get_all_matching_rules(
                         element,
                         rule_hash_target,
                         applicable_declarations,
                         context,
                         flags_setter,
                         CascadeLevel::InnerShadowNormal,
@@ -1265,18 +1278,17 @@ impl Stylist {
                         CascadeLevel::SameTreeAuthorNormal,
                         shadow_cascade_order,
                     );
                 });
                 shadow_cascade_order += 1;
             }
 
             let host_is_svg_use_element =
-                host.is_svg_element() &&
-                host.local_name() == &*local_name!("use");
+                host.is_svg_element() && host.local_name() == &*local_name!("use");
 
             if !host_is_svg_use_element {
                 match_document_author_rules = false;
                 break;
             }
 
             debug_assert!(
                 cascade_data.is_none(),
@@ -1401,30 +1413,26 @@ impl Stylist {
             CaseSensitivity::CaseSensitive => {},
         }
 
         self.any_applicable_rule_data(element, |data| data.mapped_ids.contains(id))
     }
 
     /// Returns the registered `@keyframes` animation for the specified name.
     #[inline]
-    pub fn get_animation<'a, E>(
-        &'a self,
-        name: &Atom,
-        element: E,
-    ) -> Option<&'a KeyframesAnimation>
+    pub fn get_animation<'a, E>(&'a self, name: &Atom, element: E) -> Option<&'a KeyframesAnimation>
     where
         E: TElement + 'a,
     {
         macro_rules! try_find_in {
             ($data:expr) => {
                 if let Some(animation) = $data.animations.get(name) {
                     return Some(animation);
                 }
-            }
+            };
         }
 
         // NOTE(emilio): We implement basically what Blink does for this case,
         // which is [1] as of this writing.
         //
         // See [2] for the spec discussion about what to do about this. WebKit's
         // behavior makes a bit more sense off-hand, but it's way more complex
         // to implement, and it makes value computation having to thread around
@@ -1542,37 +1550,41 @@ impl Stylist {
     ) -> Arc<ComputedValues>
     where
         E: TElement,
     {
         use font_metrics::get_metrics_provider_for_product;
 
         let block = declarations.read_with(guards.author);
         let iter_declarations = || {
-            block.declaration_importance_iter().map(|(declaration, importance)| {
-                debug_assert!(!importance.important());
-                (declaration, CascadeLevel::StyleAttributeNormal)
-            })
+            block
+                .declaration_importance_iter()
+                .map(|(declaration, importance)| {
+                    debug_assert!(!importance.important());
+                    (declaration, CascadeLevel::StyleAttributeNormal)
+                })
         };
 
         let metrics = get_metrics_provider_for_product();
 
         // We don't bother inserting these declarations in the rule tree, since
         // it'd be quite useless and slow.
         properties::apply_declarations::<E, _, _>(
             &self.device,
             /* pseudo = */ None,
             self.rule_tree.root(),
             guards,
             iter_declarations,
             Some(parent_style),
             Some(parent_style),
             Some(parent_style),
             &metrics,
-            CascadeMode::Unvisited { visited_rules: None },
+            CascadeMode::Unvisited {
+                visited_rules: None,
+            },
             self.quirks_mode,
             /* rule_cache = */ None,
             &mut Default::default(),
             /* element = */ None,
         )
     }
 
     /// Accessor for a shared reference to the device.
@@ -1698,18 +1710,20 @@ impl MallocSizeOf for ExtraStyleData {
         n
     }
 }
 
 /// SelectorMapEntry implementation for use in our revalidation selector map.
 #[cfg_attr(feature = "gecko", derive(MallocSizeOf))]
 #[derive(Clone, Debug)]
 struct RevalidationSelectorAndHashes {
-    #[cfg_attr(feature = "gecko",
-               ignore_malloc_size_of = "CssRules have primary refs, we measure there")]
+    #[cfg_attr(
+        feature = "gecko",
+        ignore_malloc_size_of = "CssRules have primary refs, we measure there"
+    )]
     selector: Selector<SelectorImpl>,
     selector_offset: usize,
     hashes: AncestorHashes,
 }
 
 impl RevalidationSelectorAndHashes {
     fn new(selector: Selector<SelectorImpl>, hashes: AncestorHashes) -> Self {
         let selector_offset = {
@@ -1807,36 +1821,38 @@ impl<'a> SelectorVisitor for StylistSele
 
         // NOTE(emilio): This works properly right now because we can't store
         // complex selectors in nested selectors, otherwise we may need to
         // rethink this.
         //
         // Also, note that this call happens before we visit any of the simple
         // selectors in the next ComplexSelector, so we can use this to skip
         // looking at them.
-        self.passed_rightmost_selector = self.passed_rightmost_selector ||
-            !matches!(combinator, None | Some(Combinator::PseudoElement));
+        self.passed_rightmost_selector =
+            self.passed_rightmost_selector ||
+                !matches!(combinator, None | Some(Combinator::PseudoElement));
 
         true
     }
 
     fn visit_attribute_selector(
         &mut self,
         _ns: &NamespaceConstraint<&Namespace>,
         name: &LocalName,
         lower_name: &LocalName,
     ) -> bool {
         self.attribute_dependencies.insert(name.clone());
         self.attribute_dependencies.insert(lower_name.clone());
         true
     }
 
     fn visit_simple_selector(&mut self, s: &Component<SelectorImpl>) -> bool {
-        self.needs_revalidation = self.needs_revalidation ||
-            component_needs_revalidation(s, self.passed_rightmost_selector);
+        self.needs_revalidation =
+            self.needs_revalidation ||
+                component_needs_revalidation(s, self.passed_rightmost_selector);
 
         match *s {
             Component::NonTSPseudoClass(ref p) => {
                 self.state_dependencies.insert(p.state_flag());
                 self.document_state_dependencies
                     .insert(p.document_state_flag());
             },
             Component::ID(ref id) if !self.passed_rightmost_selector => {
@@ -1878,23 +1894,25 @@ struct ElementAndPseudoRules {
 impl ElementAndPseudoRules {
     #[inline(always)]
     fn insert(
         &mut self,
         rule: Rule,
         pseudo_element: Option<&PseudoElement>,
         quirks_mode: QuirksMode,
     ) -> Result<(), FailedAllocationError> {
-        debug_assert!(pseudo_element.map_or(true, |pseudo| {
-            !pseudo.is_precomputed() && !pseudo.is_unknown_webkit_pseudo_element()
-        }));
+        debug_assert!(
+            pseudo_element.map_or(true, |pseudo| !pseudo.is_precomputed() &&
+                !pseudo.is_unknown_webkit_pseudo_element())
+        );
 
         let map = match pseudo_element {
             None => &mut self.element_map,
-            Some(pseudo) => self.pseudos_map
+            Some(pseudo) => self
+                .pseudos_map
                 .get_or_insert_with(pseudo, || Box::new(SelectorMap::new())),
         };
 
         map.insert(rule, quirks_mode)
     }
 
     fn clear(&mut self) {
         self.element_map.clear();
@@ -2254,20 +2272,20 @@ impl CascadeData {
                         self.effective_media_query_results.saw_effective(media_rule);
                     }
                 },
                 CssRule::Keyframes(ref keyframes_rule) => {
                     let keyframes_rule = keyframes_rule.read_with(guard);
                     debug!("Found valid keyframes rule: {:?}", *keyframes_rule);
 
                     // Don't let a prefixed keyframes animation override a non-prefixed one.
-                    let needs_insertion = keyframes_rule.vendor_prefix.is_none() ||
-                        self.animations
-                            .get(keyframes_rule.name.as_atom())
-                            .map_or(true, |rule| rule.vendor_prefix.is_some());
+                    let needs_insertion = keyframes_rule.vendor_prefix.is_none() || self
+                        .animations
+                        .get(keyframes_rule.name.as_atom())
+                        .map_or(true, |rule| rule.vendor_prefix.is_some());
                     if needs_insertion {
                         let animation = KeyframesAnimation::from_keyframes(
                             &keyframes_rule.keyframes,
                             keyframes_rule.vendor_prefix.clone(),
                             guard,
                         );
                         debug!("Found valid keyframe animation: {:?}", animation);
                         self.animations
@@ -2347,17 +2365,18 @@ impl CascadeData {
                     // Not affected by device changes.
                     continue;
                 },
                 CssRule::Import(ref lock) => {
                     let import_rule = lock.read_with(guard);
                     let effective_now = import_rule
                         .stylesheet
                         .is_effective_for_device(&device, guard);
-                    let effective_then = self.effective_media_query_results
+                    let effective_then = self
+                        .effective_media_query_results
                         .was_effective(import_rule);
                     if effective_now != effective_then {
                         debug!(
                             " > @import rule {:?} changed {} -> {}",
                             import_rule.stylesheet.media(guard),
                             effective_then,
                             effective_now
                         );
@@ -2373,19 +2392,17 @@ impl CascadeData {
                     let mq = media_rule.media_queries.read_with(guard);
                     let effective_now = mq.evaluate(device, quirks_mode);
                     let effective_then =
                         self.effective_media_query_results.was_effective(media_rule);
 
                     if effective_now != effective_then {
                         debug!(
                             " > @media rule {:?} changed {} -> {}",
-                            mq,
-                            effective_then,
-                            effective_now
+                            mq, effective_then, effective_now
                         );
                         return false;
                     }
 
                     if !effective_now {
                         iter.skip_children();
                     }
                 },
@@ -2455,18 +2472,20 @@ pub struct Rule {
     pub hashes: AncestorHashes,
 
     /// The source order this style rule appears in. Note that we only use
     /// three bytes to store this value in ApplicableDeclarationsBlock, so
     /// we could repurpose that storage here if we needed to.
     pub source_order: u32,
 
     /// The actual style rule.
-    #[cfg_attr(feature = "gecko",
-               ignore_malloc_size_of = "Secondary ref. Primary ref is in StyleRule under Stylesheet.")]
+    #[cfg_attr(
+        feature = "gecko",
+        ignore_malloc_size_of = "Secondary ref. Primary ref is in StyleRule under Stylesheet."
+    )]
     #[cfg_attr(feature = "servo", ignore_malloc_size_of = "Arc")]
     pub style_rule: Arc<Locked<StyleRule>>,
 }
 
 impl SelectorMapEntry for Rule {
     fn selector(&self) -> SelectorIter<SelectorImpl> {
         self.selector.iter()
     }
@@ -2481,17 +2500,23 @@ impl Rule {
     /// Turns this rule into an `ApplicableDeclarationBlock` for the given
     /// cascade level.
     pub fn to_applicable_declaration_block(
         &self,
         level: CascadeLevel,
         shadow_cascade_order: ShadowCascadeOrder,
     ) -> ApplicableDeclarationBlock {
         let source = StyleSource::from_rule(self.style_rule.clone());
-        ApplicableDeclarationBlock::new(source, self.source_order, level, self.specificity(), shadow_cascade_order)
+        ApplicableDeclarationBlock::new(
+            source,
+            self.source_order,
+            level,
+            self.specificity(),
+            shadow_cascade_order,
+        )
     }
 
     /// Creates a new Rule.
     pub fn new(
         selector: Selector<SelectorImpl>,
         hashes: AncestorHashes,
         style_rule: Arc<Locked<StyleRule>>,
         source_order: u32,
--- a/servo/components/style/traversal.rs
+++ b/servo/components/style/traversal.rs
@@ -203,21 +203,21 @@ pub trait DomTraversal<E: TElement>: Syn
             el, traversal_flags, data
         );
 
         // In case of animation-only traversal we need to traverse the element
         // if the element has animation only dirty descendants bit,
         // animation-only restyle hint or recascade.
         if traversal_flags.for_animation_only() {
             return data.map_or(false, |d| d.has_styles()) &&
-                (el.has_animation_only_dirty_descendants() ||
-                    data.as_ref()
-                        .unwrap()
-                        .hint
-                        .has_animation_hint_or_recascade());
+                (el.has_animation_only_dirty_descendants() || data
+                    .as_ref()
+                    .unwrap()
+                    .hint
+                    .has_animation_hint_or_recascade());
         }
 
         // Non-incremental layout visits every node.
         if is_servo_nonincremental_layout() {
             return true;
         }
 
         // Unwrap the data.
@@ -274,17 +274,18 @@ pub trait DomTraversal<E: TElement>: Syn
 
         // Gecko-only XBL handling.
         //
         // When we apply the XBL binding during frame construction, we restyle
         // the whole subtree again if the binding is valid, so assuming it's
         // likely to load valid bindings, we avoid wasted work here, which may
         // be a very big perf hit when elements with bindings are nested
         // heavily.
-        if cfg!(feature = "gecko") && is_initial_style &&
+        if cfg!(feature = "gecko") &&
+            is_initial_style &&
             parent_data.styles.primary().has_moz_binding()
         {
             debug!("Parent {:?} has XBL binding, deferring traversal", parent);
             return true;
         }
 
         return false;
     }
@@ -379,18 +380,17 @@ where
     StyleResolverForElement::new(
         element,
         context,
         rule_inclusion,
         PseudoElementResolution::Force,
     ).resolve_style(
         style.as_ref().map(|s| &**s),
         layout_parent_style.as_ref().map(|s| &**s),
-    )
-        .into()
+    ).into()
 }
 
 /// Calculates the style for a single node.
 #[inline]
 #[allow(unsafe_code)]
 pub fn recalc_style_at<E, D, F>(
     traversal: &D,
     traversal_data: &PerLevelTraversalData,
@@ -406,17 +406,18 @@ pub fn recalc_style_at<E, D, F>(
     use std::cmp;
     use traversal_flags::TraversalFlags;
 
     let flags = context.shared.traversal_flags;
     let is_initial_style = !data.has_styles();
 
     context.thread_local.statistics.elements_traversed += 1;
     debug_assert!(
-        flags.intersects(TraversalFlags::AnimationOnly) || !element.has_snapshot() ||
+        flags.intersects(TraversalFlags::AnimationOnly) ||
+            !element.has_snapshot() ||
             element.handled_snapshot(),
         "Should've handled snapshots here already"
     );
 
     let compute_self = !element.has_current_styles_for_traversal(data, flags);
 
     debug!(
         "recalc_style_at: {:?} (compute_self={:?}, \
@@ -507,18 +508,19 @@ pub fn recalc_style_at<E, D, F>(
     // Additionally, there are a few scenarios where we avoid traversing the
     // subtree even if descendant styles are out of date. These cases are
     // enumerated in should_cull_subtree().
     let mut traverse_children = has_dirty_descendants_for_this_restyle ||
         !propagated_hint.is_empty() ||
         !child_cascade_requirement.can_skip_cascade() ||
         is_servo_nonincremental_layout();
 
-    traverse_children = traverse_children &&
-        !traversal.should_cull_subtree(context, element, &data, is_initial_style);
+    traverse_children =
+        traverse_children &&
+            !traversal.should_cull_subtree(context, element, &data, is_initial_style);
 
     // Examine our children, and enqueue the appropriate ones for traversal.
     if traverse_children {
         note_children::<E, D, F>(
             context,
             element,
             data,
             propagated_hint,
@@ -530,17 +532,18 @@ pub fn recalc_style_at<E, D, F>(
 
     // FIXME(bholley): Make these assertions pass for servo.
     if cfg!(feature = "gecko") && cfg!(debug_assertions) && data.styles.is_display_none() {
         debug_assert!(!element.has_dirty_descendants());
         debug_assert!(!element.has_animation_only_dirty_descendants());
     }
 
     debug_assert!(
-        flags.for_animation_only() || !flags.contains(TraversalFlags::ClearDirtyBits) ||
+        flags.for_animation_only() ||
+            !flags.contains(TraversalFlags::ClearDirtyBits) ||
             !element.has_animation_only_dirty_descendants(),
         "Should have cleared animation bits already"
     );
     clear_state_after_traversing(element, data, flags);
 }
 
 fn clear_state_after_traversing<E>(element: E, data: &mut ElementData, flags: TraversalFlags)
 where
--- a/servo/components/style/use_counters/mod.rs
+++ b/servo/components/style/use_counters/mod.rs
@@ -66,17 +66,18 @@ pub struct UseCounters {
 }
 
 impl UseCounters {
     /// Merge the use counters.
     ///
     /// Used for parallel parsing, where we parse off-main-thread.
     #[inline]
     pub fn merge(&self, other: &Self) {
-        self.non_custom_properties.merge(&other.non_custom_properties)
+        self.non_custom_properties
+            .merge(&other.non_custom_properties)
     }
 }
 
 #[cfg(feature = "gecko")]
 unsafe impl HasFFI for UseCounters {
     type FFIType = ::gecko_bindings::structs::StyleUseCounters;
 }
 
--- a/servo/components/style/values/animated/color.rs
+++ b/servo/components/style/values/animated/color.rs
@@ -56,17 +56,18 @@ impl Animate for RGBA {
             // 0, but this is what current gecko does.
             return Ok(RGBA::transparent());
         }
 
         alpha = alpha.min(1.);
         let red =
             (self.red * self.alpha).animate(&(other.red * other.alpha), procedure)? * 1. / alpha;
         let green = (self.green * self.alpha).animate(&(other.green * other.alpha), procedure)? *
-            1. / alpha;
+            1. /
+            alpha;
         let blue =
             (self.blue * self.alpha).animate(&(other.blue * other.alpha), procedure)? * 1. / alpha;
 
         Ok(RGBA::new(red, green, blue, alpha))
     }
 }
 
 impl ComputeSquaredDistance for RGBA {
@@ -218,45 +219,45 @@ impl Animate for Color {
                 // Calculate the final foreground color ratios; perform
                 // animation on effective fg ratios.
                 let ComplexColorRatios { fg: fg1, .. } = self.effective_ratios();
                 let ComplexColorRatios { fg: fg2, .. } = other.effective_ratios();
                 // Perform fg1 op fg2
                 let fg = fg1.animate(&fg2, procedure)?;
 
                 Self::with_ratios(bg_color, ComplexColorRatios { bg: 1., fg })
-            }
+            },
         })
     }
 }
 
 impl ComputeSquaredDistance for Color {
     #[inline]
     fn compute_squared_distance(&self, other: &Self) -> Result<SquaredDistance, ()> {
         use self::GenericColor::*;
 
         // All comments from the Animate impl also applies here.
         Ok(match (*self, *other) {
             (Foreground, Foreground) => SquaredDistance::from_sqrt(0.),
             (Numeric(c1), Numeric(c2)) => c1.compute_squared_distance(&c2)?,
             (Foreground, Numeric(color)) | (Numeric(color), Foreground) => {
                 // `computed_squared_distance` is symmetric.
-                color.compute_squared_distance(&RGBA::transparent())?
-                    + SquaredDistance::from_sqrt(1.)
-            }
+                color.compute_squared_distance(&RGBA::transparent())? +
+                    SquaredDistance::from_sqrt(1.)
+            },
             (_, _) => {
                 let self_color = self.effective_intermediate_rgba();
                 let other_color = other.effective_intermediate_rgba();
                 let self_ratios = self.effective_ratios();
                 let other_ratios = other.effective_ratios();
 
-                self_color.compute_squared_distance(&other_color)?
-                    + self_ratios.bg.compute_squared_distance(&other_ratios.bg)?
-                    + self_ratios.fg.compute_squared_distance(&other_ratios.fg)?
-            }
+                self_color.compute_squared_distance(&other_color)? +
+                    self_ratios.bg.compute_squared_distance(&other_ratios.bg)? +
+                    self_ratios.fg.compute_squared_distance(&other_ratios.fg)?
+            },
         })
     }
 }
 
 impl ToAnimatedZero for Color {
     #[inline]
     fn to_animated_zero(&self) -> Result<Self, ()> {
         Ok(RGBA::transparent().into())
--- a/servo/components/style/values/animated/mod.rs
+++ b/servo/components/style/values/animated/mod.rs
@@ -394,12 +394,15 @@ where
 }
 
 impl<T> ToAnimatedZero for Box<[T]>
 where
     T: ToAnimatedZero,
 {
     #[inline]
     fn to_animated_zero(&self) -> Result<Self, ()> {
-        let v = self.iter().map(|v| v.to_animated_zero()).collect::<Result<Vec<_>, _>>()?;
+        let v = self
+            .iter()
+            .map(|v| v.to_animated_zero())
+            .collect::<Result<Vec<_>, _>>()?;
         Ok(v.into_boxed_slice())
     }
 }
--- a/servo/components/style/values/computed/angle.rs
+++ b/servo/components/style/values/computed/angle.rs
@@ -10,17 +10,19 @@ use std::f64::consts::PI;
 use std::ops::Add;
 use values::CSSFloat;
 use values::animated::{Animate, Procedure};
 use values::distance::{ComputeSquaredDistance, SquaredDistance};
 
 /// A computed angle.
 #[animate(fallback = "Self::animate_fallback")]
 #[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
-#[derive(Animate, Clone, Copy, Debug, MallocSizeOf, PartialEq, PartialOrd, ToAnimatedZero, ToCss)]
+#[derive(
+    Animate, Clone, Copy, Debug, MallocSizeOf, PartialEq, PartialOrd, ToAnimatedZero, ToCss,
+)]
 pub enum Angle {
     /// An angle with degree unit.
     #[css(dimension)]
     Deg(CSSFloat),
     /// An angle with gradian unit.
     #[css(dimension)]
     Grad(CSSFloat),
     /// An angle with radian unit.
@@ -68,17 +70,19 @@ impl Angle {
     pub fn degrees(&self) -> f32 {
         use std::f32::consts::PI;
         self.radians() * 360. / (2. * PI)
     }
 
     /// <https://drafts.csswg.org/css-transitions/#animtype-number>
     #[inline]
     fn animate_fallback(&self, other: &Self, procedure: Procedure) -> Result<Self, ()> {
-        Ok(Angle::from_radians(self.radians().animate(&other.radians(), procedure)?))
+        Ok(Angle::from_radians(
+            self.radians().animate(&other.radians(), procedure)?,
+        ))
     }
 }
 
 impl AsRef<Angle> for Angle {
     #[inline]
     fn as_ref(&self) -> &Self {
         self
     }
--- a/servo/components/style/values/computed/box.rs
+++ b/servo/components/style/values/computed/box.rs
@@ -29,109 +29,119 @@ impl AnimationIterationCount {
     }
 }
 
 /// A computed value for the `perspective` property.
 pub type Perspective = GenericPerspective<NonNegativeLength>;
 
 #[allow(missing_docs)]
 #[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
-#[derive(Clone, Copy, Debug, Eq, Hash, MallocSizeOf, Parse, PartialEq,
-         SpecifiedValueInfo, ToCss)]
+#[derive(
+    Clone, Copy, Debug, Eq, Hash, MallocSizeOf, Parse, PartialEq, SpecifiedValueInfo, ToCss,
+)]
 /// A computed value for the `float` property.
 pub enum Float {
     Left,
     Right,
-    None
+    None,
 }
 
 impl ToComputedValue for SpecifiedFloat {
     type ComputedValue = Float;
 
     #[inline]
     fn to_computed_value(&self, context: &Context) -> Self::ComputedValue {
         let ltr = context.style().writing_mode.is_bidi_ltr();
         // https://drafts.csswg.org/css-logical-props/#float-clear
         match *self {
             SpecifiedFloat::InlineStart => {
-                context.rule_cache_conditions.borrow_mut()
+                context
+                    .rule_cache_conditions
+                    .borrow_mut()
                     .set_writing_mode_dependency(context.builder.writing_mode);
                 if ltr {
                     Float::Left
                 } else {
                     Float::Right
                 }
             },
             SpecifiedFloat::InlineEnd => {
-                context.rule_cache_conditions.borrow_mut()
+                context
+                    .rule_cache_conditions
+                    .borrow_mut()
                     .set_writing_mode_dependency(context.builder.writing_mode);
                 if ltr {
                     Float::Right
                 } else {
                     Float::Left
                 }
             },
             SpecifiedFloat::Left => Float::Left,
             SpecifiedFloat::Right => Float::Right,
-            SpecifiedFloat::None => Float::None
+            SpecifiedFloat::None => Float::None,
         }
     }
 
     #[inline]
     fn from_computed_value(computed: &Self::ComputedValue) -> SpecifiedFloat {
         match *computed {
             Float::Left => SpecifiedFloat::Left,
             Float::Right => SpecifiedFloat::Right,
-            Float::None => SpecifiedFloat::None
+            Float::None => SpecifiedFloat::None,
         }
     }
 }
 
 #[allow(missing_docs)]
 #[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
-#[derive(Clone, Copy, Debug, Eq, Hash, MallocSizeOf, Parse, PartialEq,
-SpecifiedValueInfo, ToCss)]
+#[derive(
+    Clone, Copy, Debug, Eq, Hash, MallocSizeOf, Parse, PartialEq, SpecifiedValueInfo, ToCss,
+)]
 /// A computed value for the `clear` property.
 pub enum Clear {
     None,
     Left,
     Right,
-    Both
+    Both,
 }
 
 impl ToComputedValue for SpecifiedClear {
     type ComputedValue = Clear;
 
     #[inline]
     fn to_computed_value(&self, context: &Context) -> Self::ComputedValue {
         let ltr = context.style().writing_mode.is_bidi_ltr();
         // https://drafts.csswg.org/css-logical-props/#float-clear
         match *self {
             SpecifiedClear::InlineStart => {
-                context.rule_cache_conditions.borrow_mut()
+                context
+                    .rule_cache_conditions
+                    .borrow_mut()
                     .set_writing_mode_dependency(context.builder.writing_mode);
                 if ltr {
                     Clear::Left
                 } else {
                     Clear::Right
                 }
             },
             SpecifiedClear::InlineEnd => {
-                context.rule_cache_conditions.borrow_mut()
+                context
+                    .rule_cache_conditions
+                    .borrow_mut()
                     .set_writing_mode_dependency(context.builder.writing_mode);
                 if ltr {
                     Clear::Right
                 } else {
                     Clear::Left
                 }
             },
             SpecifiedClear::None => Clear::None,
             SpecifiedClear::Left => Clear::Left,
             SpecifiedClear::Right => Clear::Right,
-            SpecifiedClear::Both => Clear::Both
+            SpecifiedClear::Both => Clear::Both,
         }
     }
 
     #[inline]
     fn from_computed_value(computed: &Self::ComputedValue) -> SpecifiedClear {
         match *computed {
             Clear::None => SpecifiedClear::None,
             Clear::Left => SpecifiedClear::Left,
@@ -155,33 +165,37 @@ pub enum Resize {
 impl ToComputedValue for specified::Resize {
     type ComputedValue = Resize;
 
     #[inline]
     fn to_computed_value(&self, context: &Context) -> Resize {
         let is_vertical = context.style().writing_mode.is_vertical();
         match self {
             specified::Resize::Inline => {
-                context.rule_cache_conditions.borrow_mut()
+                context
+                    .rule_cache_conditions
+                    .borrow_mut()
                     .set_writing_mode_dependency(context.builder.writing_mode);
                 if is_vertical {
                     Resize::Vertical
                 } else {
                     Resize::Horizontal
                 }
-            }
+            },
             specified::Resize::Block => {
-                context.rule_cache_conditions.borrow_mut()
+                context
+                    .rule_cache_conditions
+                    .borrow_mut()
                     .set_writing_mode_dependency(context.builder.writing_mode);
                 if is_vertical {
                     Resize::Horizontal
                 } else {
                     Resize::Vertical
                 }
-            }
+            },
             specified::Resize::None => Resize::None,
             specified::Resize::Both => Resize::Both,
             specified::Resize::Horizontal => Resize::Horizontal,
             specified::Resize::Vertical => Resize::Vertical,
         }
     }
 
     #[inline]
--- a/servo/components/style/values/computed/counters.rs
+++ b/servo/components/style/values/computed/counters.rs
@@ -15,9 +15,8 @@ pub type CounterIncrement = GenericCount
 /// A computed value for the `counter-increment` property.
 pub type CounterReset = GenericCounterReset<i32>;
 
 /// A computed value for the `content` property.
 pub type Content = generics::Content<ComputedImageUrl>;
 
 /// A computed content item.
 pub type ContentItem = generics::ContentItem<ComputedImageUrl>;
-
--- a/servo/components/style/values/computed/effects.rs
+++ b/servo/components/style/values/computed/effects.rs
@@ -15,16 +15,18 @@ use values::generics::effects::BoxShadow
 use values::generics::effects::Filter as GenericFilter;
 use values::generics::effects::SimpleShadow as GenericSimpleShadow;
 
 /// A computed value for a single shadow of the `box-shadow` property.
 pub type BoxShadow = GenericBoxShadow<Color, Length, NonNegativeLength, Length>;
 
 /// A computed value for a single `filter`.
 #[cfg(feature = "gecko")]
-pub type Filter = GenericFilter<Angle, NonNegativeNumber, NonNegativeLength, SimpleShadow, ComputedUrl>;
+pub type Filter =
+    GenericFilter<Angle, NonNegativeNumber, NonNegativeLength, SimpleShadow, ComputedUrl>;
 
 /// A computed value for a single `filter`.
 #[cfg(not(feature = "gecko"))]
-pub type Filter = GenericFilter<Angle, NonNegativeNumber, NonNegativeLength, Impossible, Impossible>;
+pub type Filter =
+    GenericFilter<Angle, NonNegativeNumber, NonNegativeLength, Impossible, Impossible>;
 
 /// A computed value for the `drop-shadow()` filter.
 pub type SimpleShadow = GenericSimpleShadow<Color, Length, NonNegativeLength>;
--- a/servo/components/style/values/computed/font.rs
+++ b/servo/components/style/values/computed/font.rs
@@ -30,18 +30,17 @@ use values::specified::length::{FontBase
 pub use values::computed::Length as MozScriptMinSize;
 pub use values::specified::font::{FontSynthesis, MozScriptSizeMultiplier, XLang, XTextZoom};
 
 /// A value for the font-weight property per:
 ///
 /// https://drafts.csswg.org/css-fonts-4/#propdef-font-weight
 ///
 /// This is effectively just a `Number`.
-#[derive(Clone, ComputeSquaredDistance, Copy, Debug, MallocSizeOf, PartialEq,
-         ToCss)]
+#[derive(Clone, ComputeSquaredDistance, Copy, Debug, MallocSizeOf, PartialEq, ToCss)]
 #[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
 pub struct FontWeight(pub Number);
 
 impl Hash for FontWeight {
     fn hash<H: Hasher>(&self, hasher: &mut H) {
         hasher.write_u64((self.0 * 10000.).trunc() as u64);
     }
 }
@@ -55,18 +54,27 @@ impl ToAnimatedValue for FontWeight {
     }
 
     #[inline]
     fn from_animated_value(animated: Self::AnimatedValue) -> Self {
         FontWeight(animated.max(MIN_FONT_WEIGHT).min(MAX_FONT_WEIGHT))
     }
 }
 
-#[derive(Animate, Clone, ComputeSquaredDistance, Copy, Debug, MallocSizeOf, PartialEq,
-         ToAnimatedZero, ToCss)]
+#[derive(
+    Animate,
+    Clone,
+    ComputeSquaredDistance,
+    Copy,
+    Debug,
+    MallocSizeOf,
+    PartialEq,
+    ToAnimatedZero,
+    ToCss,
+)]
 /// The computed value of font-size
 pub struct FontSize {
     /// The size.
     pub size: NonNegativeLength,
     /// If derived from a keyword, the keyword and additional transformations applied to it
     #[css(skip)]
     pub keyword_info: Option<KeywordInfo>,
 }
@@ -212,19 +220,19 @@ impl ToAnimatedValue for FontSize {
 #[cfg_attr(feature = "servo", derive(MallocSizeOf))]
 /// Specifies a prioritized list of font family names or generic family names.
 pub struct FontFamily(pub FontFamilyList);
 
 impl FontFamily {
     #[inline]
     /// Get default font family as `serif` which is a generic font-family
     pub fn serif() -> Self {
-        FontFamily(FontFamilyList::new(Box::new([
-            SingleFontFamily::Generic(atom!("serif")),
-        ])))
+        FontFamily(FontFamilyList::new(Box::new([SingleFontFamily::Generic(
+            atom!("serif"),
+        )])))
     }
 }
 
 #[cfg(feature = "gecko")]
 impl MallocSizeOf for FontFamily {
     fn size_of(&self, _ops: &mut MallocSizeOfOps) -> usize {
         // SharedFontList objects are generally shared from the pointer
         // stored in the specified value. So only count this if the
@@ -468,19 +476,17 @@ impl SingleFontFamily {
         use gecko_bindings::structs::FontFamilyType;
 
         match family.mType {
             FontFamilyType::eFamily_sans_serif => SingleFontFamily::Generic(atom!("sans-serif")),
             FontFamilyType::eFamily_serif => SingleFontFamily::Generic(atom!("serif")),
             FontFamilyType::eFamily_monospace => SingleFontFamily::Generic(atom!("monospace")),
             FontFamilyType::eFamily_cursive => SingleFontFamily::Generic(atom!("cursive")),
             FontFamilyType::eFamily_fantasy => SingleFontFamily::Generic(atom!("fantasy")),
-            FontFamilyType::eFamily_moz_fixed => {
-                SingleFontFamily::Generic(atom!("-moz-fixed"))
-            },
+            FontFamilyType::eFamily_moz_fixed => SingleFontFamily::Generic(atom!("-moz-fixed")),
             FontFamilyType::eFamily_named => {
                 let name = Atom::from(&*family.mName);
                 SingleFontFamily::FamilyName(FamilyName {
                     name,
                     syntax: FamilyNameSyntax::Identifiers,
                 })
             },
             FontFamilyType::eFamily_named_quoted => SingleFontFamily::FamilyName(FamilyName {
@@ -846,19 +852,20 @@ impl ToAnimatedValue for FontStyleAngle 
     #[inline]
     fn to_animated_value(self) -> Self::AnimatedValue {
         self.0
     }
 
     #[inline]
     fn from_animated_value(animated: Self::AnimatedValue) -> Self {
         FontStyleAngle(Angle::Deg(
-            animated.degrees()
+            animated
+                .degrees()
                 .min(specified::FONT_STYLE_OBLIQUE_MAX_ANGLE_DEGREES)
-                .max(specified::FONT_STYLE_OBLIQUE_MIN_ANGLE_DEGREES)
+                .max(specified::FONT_STYLE_OBLIQUE_MIN_ANGLE_DEGREES),
         ))
     }
 }
 
 impl Hash for FontStyleAngle {
     fn hash<H: Hasher>(&self, hasher: &mut H) {
         hasher.write_u64((self.0.degrees() * 10000.).trunc() as u64);
     }
@@ -877,20 +884,21 @@ impl FontStyle {
         generics::FontStyle::Normal
     }
 
     /// The default angle for font-style: oblique. This is 20deg per spec:
     ///
     /// https://drafts.csswg.org/css-fonts-4/#valdef-font-style-oblique-angle
     #[inline]
     pub fn default_angle() -> FontStyleAngle {
-        FontStyleAngle(Angle::Deg(specified::DEFAULT_FONT_STYLE_OBLIQUE_ANGLE_DEGREES))
+        FontStyleAngle(Angle::Deg(
+            specified::DEFAULT_FONT_STYLE_OBLIQUE_ANGLE_DEGREES,
+        ))
     }
 
-
     /// Get the font style from Gecko's nsFont struct.
     #[cfg(feature = "gecko")]
     pub fn from_gecko(style: structs::FontSlantStyle) -> Self {
         let mut angle = 0.;
         let mut italic = false;
         let mut normal = false;
         unsafe {
             bindings::Gecko_FontSlantStyle_Get(style, &mut normal, &mut italic, &mut angle);
@@ -918,17 +926,17 @@ impl ToCss for FontStyle {
                 // Use `degrees` instead of just comparing Angle because
                 // `degrees` can return slightly different values due to
                 // floating point conversions.
                 if angle.0.degrees() != Self::default_angle().0.degrees() {
                     dest.write_char(' ')?;
                     angle.to_css(dest)?;
                 }
                 Ok(())
-            }
+            },
         }
     }
 }
 
 /// A value for the font-stretch property per:
 ///
 /// https://drafts.csswg.org/css-fonts-4/#propdef-font-stretch
 #[derive(Clone, ComputeSquaredDistance, Copy, Debug, MallocSizeOf, PartialEq, ToCss)]
--- a/servo/components/style/values/computed/length.rs
+++ b/servo/components/style/values/computed/length.rs
@@ -75,17 +75,18 @@ pub struct CalcLengthOrPercentage {
     pub percentage: Option<Percentage>,
 }
 
 impl ComputeSquaredDistance for CalcLengthOrPercentage {
     #[inline]
     fn compute_squared_distance(&self, other: &Self) -> Result<SquaredDistance, ()> {
         // FIXME(nox): This looks incorrect to me, to add a distance between lengths
         // with a distance between percentages.
-        Ok(self.unclamped_length()
+        Ok(self
+            .unclamped_length()
             .compute_squared_distance(&other.unclamped_length())? +
             self.percentage()
                 .compute_squared_distance(&other.percentage())?)
     }
 }
 
 impl CalcLengthOrPercentage {
     /// Returns a new `CalcLengthOrPercentage`.
@@ -280,19 +281,25 @@ impl specified::CalcLengthOrPercentage {
             |abs| context.maybe_zoom_text(abs.into()).0,
             base_size,
         )
     }
 
     /// Compute the value into pixel length as CSSFloat without context,
     /// so it returns Err(()) if there is any non-absolute unit.
     pub fn to_computed_pixel_length_without_context(&self) -> Result<CSSFloat, ()> {
-        if self.vw.is_some() || self.vh.is_some() || self.vmin.is_some() || self.vmax.is_some() ||
-            self.em.is_some() || self.ex.is_some() || self.ch.is_some() ||
-            self.rem.is_some() || self.percentage.is_some()
+        if self.vw.is_some() ||
+            self.vh.is_some() ||
+            self.vmin.is_some() ||
+            self.vmax.is_some() ||
+            self.em.is_some() ||
+            self.ex.is_some() ||
+            self.ch.is_some() ||
+            self.rem.is_some() ||
+            self.percentage.is_some()
         {
             return Err(());
         }
 
         match self.absolute {
             Some(abs) => Ok(abs.to_px()),
             None => {
                 debug_assert!(false, "Someone forgot to handle an unit here: {:?}", self);
@@ -319,18 +326,27 @@ impl ToComputedValue for specified::Calc
             ..Default::default()
         }
     }
 }
 
 #[allow(missing_docs)]
 #[animate(fallback = "Self::animate_fallback")]
 #[css(derive_debug)]
-#[derive(Animate, Clone, ComputeSquaredDistance, Copy, MallocSizeOf, PartialEq,
-         ToAnimatedValue, ToAnimatedZero, ToCss)]
+#[derive(
+    Animate,
+    Clone,
+    ComputeSquaredDistance,
+    Copy,
+    MallocSizeOf,
+    PartialEq,
+    ToAnimatedValue,
+    ToAnimatedZero,
+    ToCss,
+)]
 #[distance(fallback = "Self::compute_squared_distance_fallback")]
 pub enum LengthOrPercentage {
     Length(Length),
     Percentage(Percentage),
     Calc(CalcLengthOrPercentage),
 }
 
 impl LengthOrPercentage {
@@ -478,21 +494,19 @@ pub enum LengthOrPercentageOrAuto {
     Calc(CalcLengthOrPercentage),
 }
 
 impl LengthOrPercentageOrAuto {
     /// <https://drafts.csswg.org/css-transitions/#animtype-lpcalc>
     fn animate_fallback(&self, other: &Self, procedure: Procedure) -> Result<Self, ()> {
         let this = <Option<CalcLengthOrPercentage>>::from(*self);
         let other = <Option<CalcLengthOrPercentage>>::from(*other);
-        Ok(LengthOrPercentageOrAuto::Calc(this.animate(
-            &other,
-            procedure,
-        )?
-            .ok_or(())?))
+        Ok(LengthOrPercentageOrAuto::Calc(
+            this.animate(&other, procedure)?.ok_or(())?,
+        ))
     }
 
     #[inline]
     fn compute_squared_distance_fallback(&self, other: &Self) -> Result<SquaredDistance, ()> {
         <Option<CalcLengthOrPercentage>>::compute_squared_distance(
             &(*self).into(),
             &(*other).into(),
         )
@@ -597,21 +611,19 @@ pub enum LengthOrPercentageOrNone {
     None,
 }
 
 impl LengthOrPercentageOrNone {
     /// <https://drafts.csswg.org/css-transitions/#animtype-lpcalc>
     fn animate_fallback(&self, other: &Self, procedure: Procedure) -> Result<Self, ()> {
         let this = <Option<CalcLengthOrPercentage>>::from(*self);
         let other = <Option<CalcLengthOrPercentage>>::from(*other);
-        Ok(LengthOrPercentageOrNone::Calc(this.animate(
-            &other,
-            procedure,
-        )?
-            .ok_or(())?))
+        Ok(LengthOrPercentageOrNone::Calc(
+            this.animate(&other, procedure)?.ok_or(())?,
+        ))
     }
 
     fn compute_squared_distance_fallback(&self, other: &Self) -> Result<SquaredDistance, ()> {
         <Option<CalcLengthOrPercentage>>::compute_squared_distance(
             &(*self).into(),
             &(*other).into(),
         )
     }
@@ -722,18 +734,28 @@ impl NonNegativeLengthOrPercentage {
     #[inline]
     pub fn to_used_value(&self, containing_length: Au) -> Au {
         self.0.to_used_value(containing_length)
     }
 }
 
 /// The computed `<length>` value.
 #[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
-#[derive(Animate, Clone, ComputeSquaredDistance, Copy, Debug, MallocSizeOf, PartialEq,
-         PartialOrd, ToAnimatedValue, ToAnimatedZero)]
+#[derive(
+    Animate,
+    Clone,
+    ComputeSquaredDistance,
+    Copy,
+    Debug,
+    MallocSizeOf,
+    PartialEq,
+    PartialOrd,
+    ToAnimatedValue,
+    ToAnimatedZero,
+)]
 pub struct CSSPixelLength(CSSFloat);
 
 impl CSSPixelLength {
     /// Return a new CSSPixelLength.
     #[inline]
     pub fn new(px: CSSFloat) -> Self {
         CSSPixelLength(px)
     }
@@ -911,18 +933,17 @@ pub type NonNegativeLengthOrNormal = Eit
 
 /// Either a computed NonNegativeLengthOrPercentage or the `normal` keyword.
 pub type NonNegativeLengthOrPercentageOrNormal = Either<NonNegativeLengthOrPercentage, Normal>;
 
 /// A type for possible values for min- and max- flavors of width, height,
 /// block-size, and inline-size.
 #[allow(missing_docs)]
 #[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
-#[derive(Clone, Copy, Debug, Eq, MallocSizeOf, Parse, PartialEq,
-         SpecifiedValueInfo, ToCss)]
+#[derive(Clone, Copy, Debug, Eq, MallocSizeOf, Parse, PartialEq, SpecifiedValueInfo, ToCss)]
 pub enum ExtremumLength {
     MozMaxContent,
     MozMinContent,
     MozFitContent,
     MozAvailable,
 }
 
 impl ExtremumLength {
--- a/servo/components/style/values/computed/motion.rs
+++ b/servo/components/style/values/computed/motion.rs
@@ -2,9 +2,9 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 //! Computed types for CSS values that are related to motion path.
 
 /// A computed offset-path. The computed value is as specified value.
 ///
 /// https://drafts.fxtf.org/motion-1/#offset-path-property
-pub use values::specified::motion::OffsetPath as OffsetPath;
+pub use values::specified::motion::OffsetPath;
--- a/servo/components/style/values/computed/percentage.rs
+++ b/servo/components/style/values/computed/percentage.rs
@@ -7,19 +7,31 @@
 use std::fmt;
 use style_traits::{CssWriter, ToCss};
 use values::{serialize_percentage, CSSFloat};
 use values::animated::ToAnimatedValue;
 use values::generics::NonNegative;
 
 /// A computed percentage.
 #[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
-#[derive(Animate, Clone, ComputeSquaredDistance, Copy, Debug, Default,
-         MallocSizeOf, PartialEq, PartialOrd, SpecifiedValueInfo,
-         ToAnimatedValue, ToAnimatedZero, ToComputedValue)]
+#[derive(
+    Animate,
+    Clone,
+    ComputeSquaredDistance,
+    Copy,
+    Debug,
+    Default,
+    MallocSizeOf,
+    PartialEq,
+    PartialOrd,
+    SpecifiedValueInfo,
+    ToAnimatedValue,
+    ToAnimatedZero,
+    ToComputedValue,
+)]
 pub struct Percentage(pub CSSFloat);
 
 impl Percentage {
     /// 0%
     #[inline]
     pub fn zero() -> Self {
         Percentage(0.)
     }
--- a/servo/components/style/values/computed/transform.rs
+++ b/servo/components/style/values/computed/transform.rs
@@ -157,23 +157,23 @@ impl TransformOperation {
     ///
     /// Must be called on a Rotate function.
     pub fn to_rotate_3d(&self) -> Self {
         match *self {
             generic::TransformOperation::Rotate3D(..) => self.clone(),
             generic::TransformOperation::RotateZ(ref angle) |
             generic::TransformOperation::Rotate(ref angle) => {
                 generic::TransformOperation::Rotate3D(0., 0., 1., angle.clone())
-            }
+            },
             generic::TransformOperation::RotateX(ref angle) => {
                 generic::TransformOperation::Rotate3D(1., 0., 0., angle.clone())
-            }
+            },
             generic::TransformOperation::RotateY(ref angle) => {
                 generic::TransformOperation::Rotate3D(0., 1., 0., angle.clone())
-            }
+            },
             _ => unreachable!(),
         }
     }
 
     /// Convert to a Scale3D.
     ///
     /// Must be called on a Scale function
     pub fn to_scale_3d(&self) -> Self {
@@ -268,19 +268,19 @@ impl ToAnimatedZero for TransformOperati
                 Ok(generic::TransformOperation::RotateY(Angle::zero()))
             },
             generic::TransformOperation::RotateZ(_) => {
                 Ok(generic::TransformOperation::RotateZ(Angle::zero()))
             },
             generic::TransformOperation::Rotate(_) => {
                 Ok(generic::TransformOperation::Rotate(Angle::zero()))
             },
-            generic::TransformOperation::Perspective(ref l) => {
-                Ok(generic::TransformOperation::Perspective(l.to_animated_zero()?))
-            },
+            generic::TransformOperation::Perspective(ref l) => Ok(
+                generic::TransformOperation::Perspective(l.to_animated_zero()?),
+            ),
             generic::TransformOperation::AccumulateMatrix { .. } |
             generic::TransformOperation::InterpolateMatrix { .. } => {
                 // AccumulateMatrix/InterpolateMatrix: We do interpolation on
                 //     AccumulateMatrix/InterpolateMatrix by reading it as a ComputedMatrix
                 //     (with layout information), and then do matrix interpolation.
                 //
                 // Therefore, we use an identity matrix to represent the identity transform list.
                 // http://dev.w3.org/csswg/css-transforms/#identity-transform-function
@@ -288,20 +288,22 @@ impl ToAnimatedZero for TransformOperati
             },
         }
     }
 }
 
 impl ToAnimatedZero for Transform {
     #[inline]
     fn to_animated_zero(&self) -> Result<Self, ()> {
-        Ok(generic::Transform(self.0
-            .iter()
-            .map(|op| op.to_animated_zero())
-            .collect::<Result<Vec<_>, _>>()?))
+        Ok(generic::Transform(
+            self.0
+                .iter()
+                .map(|op| op.to_animated_zero())
+                .collect::<Result<Vec<_>, _>>()?,
+        ))
     }
 }
 
 /// A computed CSS `rotate`
 pub type Rotate = generic::Rotate<Number, Angle>;
 
 impl Rotate {
     /// Convert TransformOperation to Rotate.
--- a/servo/components/style/values/generics/background.rs
+++ b/servo/components/style/values/generics/background.rs
@@ -1,18 +1,29 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 //! Generic types for CSS values related to backgrounds.
 
 /// A generic value for the `background-size` property.
-#[derive(Animate, Clone, ComputeSquaredDistance, Copy, Debug, MallocSizeOf,
-         PartialEq, SpecifiedValueInfo, ToAnimatedValue, ToAnimatedZero,
-         ToComputedValue, ToCss)]
+#[derive(
+    Animate,
+    Clone,
+    ComputeSquaredDistance,
+    Copy,
+    Debug,
+    MallocSizeOf,
+    PartialEq,
+    SpecifiedValueInfo,
+    ToAnimatedValue,
+    ToAnimatedZero,
+    ToComputedValue,
+    ToCss,
+)]
 pub enum BackgroundSize<LengthOrPercentageOrAuto> {
     /// `<width> <height>`
     Explicit {
         /// Explicit width.
         width: LengthOrPercentageOrAuto,
         /// Explicit height.
         height: LengthOrPercentageOrAuto,
     },
--- a/servo/components/style/values/generics/basic_shape.rs
+++ b/servo/components/style/values/generics/basic_shape.rs
@@ -14,150 +14,217 @@ use values::generics::position::Position
 use values::generics::rect::Rect;
 use values::specified::SVGPathData;
 
 /// A clipping shape, for `clip-path`.
 pub type ClippingShape<BasicShape, Url> = ShapeSource<BasicShape, GeometryBox, Url>;
 
 /// <https://drafts.fxtf.org/css-masking-1/#typedef-geometry-box>
 #[allow(missing_docs)]
-#[derive(Animate, Clone, Copy, Debug, MallocSizeOf, PartialEq,
-         SpecifiedValueInfo, ToComputedValue, ToCss)]
+#[derive(
+    Animate, Clone, Copy, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss,
+)]
 pub enum GeometryBox {
     FillBox,
     StrokeBox,
     ViewBox,
     ShapeBox(ShapeBox),
 }
 
 /// A float area shape, for `shape-outside`.
 pub type FloatAreaShape<BasicShape, Image> = ShapeSource<BasicShape, ShapeBox, Image>;
 
 /// https://drafts.csswg.org/css-shapes-1/#typedef-shape-box
 #[allow(missing_docs)]
 #[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
-#[derive(Animate, Clone, Copy, Debug, Eq, MallocSizeOf, Parse, PartialEq,
-         SpecifiedValueInfo, ToComputedValue, ToCss)]
+#[derive(
+    Animate,
+    Clone,
+    Copy,
+    Debug,
+    Eq,
+    MallocSizeOf,
+    Parse,
+    PartialEq,
+    SpecifiedValueInfo,
+    ToComputedValue,
+    ToCss,
+)]
 pub enum ShapeBox {
     MarginBox,
     BorderBox,
     PaddingBox,
     ContentBox,
 }
 
 /// A shape source, for some reference box.
 #[allow(missing_docs)]
 #[animation(no_bound(ImageOrUrl))]
-#[derive(Animate, Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo,
-         ToComputedValue, ToCss)]
+#[derive(
+    Animate, Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss,
+)]
 pub enum ShapeSource<BasicShape, ReferenceBox, ImageOrUrl> {
     #[animation(error)]
     ImageOrUrl(ImageOrUrl),
     Shape(BasicShape, Option<ReferenceBox>),
     #[animation(error)]
     Box(ReferenceBox),
     #[css(function)]
     Path(Path),
     #[animation(error)]
     None,
 }
 
 #[allow(missing_docs)]
-#[derive(Animate, Clone, ComputeSquaredDistance, Debug, MallocSizeOf, PartialEq,
-         SpecifiedValueInfo, ToComputedValue, ToCss)]
+#[derive(
+    Animate,
+    Clone,
+    ComputeSquaredDistance,
+    Debug,
+    MallocSizeOf,
+    PartialEq,
+    SpecifiedValueInfo,
+    ToComputedValue,
+    ToCss,
+)]
 pub enum BasicShape<H, V, LengthOrPercentage> {
     Inset(#[css(field_bound)] InsetRect<LengthOrPercentage>),
     Circle(#[css(field_bound)] Circle<H, V, LengthOrPercentage>),
     Ellipse(#[css(field_bound)] Ellipse<H, V, LengthOrPercentage>),
     Polygon(Polygon<LengthOrPercentage>),
 }
 
 /// <https://drafts.csswg.org/css-shapes/#funcdef-inset>
 #[allow(missing_docs)]
 #[css(function = "inset")]
-#[derive(Animate, Clone, ComputeSquaredDistance, Debug, MallocSizeOf, PartialEq,
-         SpecifiedValueInfo, ToComputedValue)]
+#[derive(
+    Animate,
+    Clone,
+    ComputeSquaredDistance,
+    Debug,
+    MallocSizeOf,
+    PartialEq,
+    SpecifiedValueInfo,
+    ToComputedValue,
+)]
 pub struct InsetRect<LengthOrPercentage> {
     pub rect: Rect<LengthOrPercentage>,
     pub round: Option<BorderRadius<LengthOrPercentage>>,
 }
 
 /// <https://drafts.csswg.org/css-shapes/#funcdef-circle>
 #[allow(missing_docs)]
 #[css(function)]
-#[derive(Animate, Clone, ComputeSquaredDistance, Copy, Debug, MallocSizeOf,
-         PartialEq, SpecifiedValueInfo, ToComputedValue)]
+#[derive(
+    Animate,
+    Clone,
+    ComputeSquaredDistance,
+    Copy,
+    Debug,
+    MallocSizeOf,
+    PartialEq,
+    SpecifiedValueInfo,
+    ToComputedValue,
+)]
 pub struct Circle<H, V, LengthOrPercentage> {
     pub position: Position<H, V>,
     pub radius: ShapeRadius<LengthOrPercentage>,
 }
 
 /// <https://drafts.csswg.org/css-shapes/#funcdef-ellipse>
 #[allow(missing_docs)]
 #[css(function)]
-#[derive(Animate, Clone, ComputeSquaredDistance, Copy, Debug, MallocSizeOf,
-         PartialEq, SpecifiedValueInfo, ToComputedValue)]
+#[derive(
+    Animate,
+    Clone,
+    ComputeSquaredDistance,
+    Copy,
+    Debug,
+    MallocSizeOf,
+    PartialEq,
+    SpecifiedValueInfo,
+    ToComputedValue,
+)]
 pub struct Ellipse<H, V, LengthOrPercentage> {
     pub position: Position<H, V>,
     pub semiaxis_x: ShapeRadius<LengthOrPercentage>,
     pub semiaxis_y: ShapeRadius<LengthOrPercentage>,
 }
 
 /// <https://drafts.csswg.org/css-shapes/#typedef-shape-radius>
 #[allow(missing_docs)]
-#[derive(Animate, Clone, ComputeSquaredDistance, Copy, Debug, MallocSizeOf,
-         PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss)]
+#[derive(
+    Animate,
+    Clone,
+    ComputeSquaredDistance,
+    Copy,
+    Debug,
+    MallocSizeOf,
+    PartialEq,
+    SpecifiedValueInfo,
+    ToComputedValue,
+    ToCss,
+)]
 pub enum ShapeRadius<LengthOrPercentage> {
     Length(LengthOrPercentage),
     #[animation(error)]
     ClosestSide,
     #[animation(error)]
     FarthestSide,
 }
 
 /// A generic type for representing the `polygon()` function
 ///
 /// <https://drafts.csswg.org/css-shapes/#funcdef-polygon>
 #[css(comma, function)]
-#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo,
-         ToComputedValue, ToCss)]
+#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss)]
 pub struct Polygon<LengthOrPercentage> {
     /// The filling rule for a polygon.
     #[css(skip_if = "fill_is_default")]
     pub fill: FillRule,
     /// A collection of (x, y) coordinates to draw the polygon.
     #[css(iterable)]
     pub coordinates: Vec<PolygonCoord<LengthOrPercentage>>,
 }
 
 /// Coordinates for Polygon.
-#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo,
-         ToComputedValue, ToCss)]
+#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss)]
 pub struct PolygonCoord<LengthOrPercentage>(pub LengthOrPercentage, pub LengthOrPercentage);
 
 // https://drafts.csswg.org/css-shapes/#typedef-fill-rule
 // NOTE: Basic shapes spec says that these are the only two values, however
 // https://www.w3.org/TR/SVG/painting.html#FillRuleProperty
 // says that it can also be `inherit`
 #[allow(missing_docs)]
 #[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
-#[derive(Clone, Copy, Debug, Eq, MallocSizeOf, Parse, PartialEq,
-         SpecifiedValueInfo, ToComputedValue, ToCss)]
+#[derive(
+    Clone,
+    Copy,
+    Debug,
+    Eq,
+    MallocSizeOf,
+    Parse,
+    PartialEq,
+    SpecifiedValueInfo,
+    ToComputedValue,
+    ToCss,
+)]
 #[repr(u8)]
 pub enum FillRule {
     Nonzero,
     Evenodd,
 }
 
 /// The path function defined in css-shape-2.
 ///
 /// https://drafts.csswg.org/css-shapes-2/#funcdef-path
 #[css(comma)]
-#[derive(Animate, Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo,
-         ToComputedValue, ToCss)]
+#[derive(
+    Animate, Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss,
+)]
 pub struct Path {
     /// The filling rule for the svg path.
     #[css(skip_if = "fill_is_default")]
     #[animation(constant)]
     pub fill: FillRule,
     /// The svg path data.
     pub path: SVGPathData,
 }
@@ -169,27 +236,26 @@ where
     B: ComputeSquaredDistance,
     T: PartialEq,
 {
     fn compute_squared_distance(&self, other: &Self) -> Result<SquaredDistance, ()> {
         match (self, other) {
             (
                 &ShapeSource::Shape(ref this, ref this_box),
                 &ShapeSource::Shape(ref other, ref other_box),
-            ) if this_box == other_box =>
+            )
+                if this_box == other_box =>
             {
                 this.compute_squared_distance(other)
             },
-            (
-                &ShapeSource::Path(ref this),
-                &ShapeSource::Path(ref other),
-            ) if this.fill == other.fill =>
+            (&ShapeSource::Path(ref this), &ShapeSource::Path(ref other))
+                if this.fill == other.fill =>
             {
                 this.path.compute_squared_distance(&other.path)
-            }
+            },
             _ => Err(()),
         }
     }
 }
 
 impl<B, T, U> ToAnimatedZero for ShapeSource<B, T, U> {
     fn to_animated_zero(&self) -> Result<Self, ()> {
         Err(())
@@ -227,26 +293,26 @@ where
 {
     fn animate(&self, other: &Self, procedure: Procedure) -> Result<Self, ()> {
         if self.fill != other.fill {
             return Err(());
         }
         if self.coordinates.len() != other.coordinates.len() {
             return Err(());
         }
-        let coordinates = self.coordinates
+        let coordinates = self
+            .coordinates
             .iter()
             .zip(other.coordinates.iter())
             .map(|(this, other)| {
                 Ok(PolygonCoord(
                     this.0.animate(&other.0, procedure)?,
                     this.1.animate(&other.1, procedure)?,
                 ))
-            })
-            .collect::<Result<Vec<_>, _>>()?;
+            }).collect::<Result<Vec<_>, _>>()?;
         Ok(Polygon {
             fill: self.fill,
             coordinates,
         })
     }
 }
 
 impl<L> ComputeSquaredDistance for Polygon<L>
@@ -262,18 +328,17 @@ where
         }
         self.coordinates
             .iter()
             .zip(other.coordinates.iter())
             .map(|(this, other)| {
                 let d1 = this.0.compute_squared_distance(&other.0)?;
                 let d2 = this.1.compute_squared_distance(&other.1)?;
                 Ok(d1 + d2)
-            })
-            .sum()
+            }).sum()
     }
 }
 
 impl Default for FillRule {
     #[inline]
     fn default() -> Self {
         FillRule::Nonzero
     }
--- a/servo/components/style/values/generics/border.rs
+++ b/servo/components/style/values/generics/border.rs
@@ -5,69 +5,101 @@
 //! Generic types for CSS values related to borders.
 
 use std::fmt::{self, Write};
 use style_traits::{CssWriter, ToCss};
 use values::generics::rect::Rect;
 use values::generics::size::Size;
 
 /// A generic value for a single side of a `border-image-width` property.
-#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo,
-         ToComputedValue, ToCss)]
+#[derive(
+    Clone, Copy, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss,
+)]
 pub enum BorderImageSideWidth<LengthOrPercentage, Number> {
     /// `<length-or-percentage>`
     Length(LengthOrPercentage),
     /// `<number>`
     Number(Number),
     /// `auto`
     Auto,
 }
 
 /// A generic value for the `border-image-slice` property.
-#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo,
-         ToComputedValue, ToCss)]
+#[derive(
+    Clone, Copy, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss,
+)]
 pub struct BorderImageSlice<NumberOrPercentage> {
     /// The offsets.
     #[css(field_bound)]
     pub offsets: Rect<NumberOrPercentage>,
     /// Whether to fill the middle part.
     #[css(represents_keyword)]
     pub fill: bool,
 }
 
 /// A generic value for the `border-*-radius` longhand properties.
-#[derive(Animate, Clone, ComputeSquaredDistance, Copy, Debug, MallocSizeOf,
-         PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss)]
+#[derive(
+    Animate,
+    Clone,
+    ComputeSquaredDistance,
+    Copy,
+    Debug,
+    MallocSizeOf,
+    PartialEq,
+    SpecifiedValueInfo,
+    ToComputedValue,
+    ToCss,
+)]
 pub struct BorderCornerRadius<L>(#[css(field_bound)] pub Size<L>);
 
 impl<L> BorderCornerRadius<L> {
     /// Trivially create a `BorderCornerRadius`.
     pub fn new(w: L, h: L) -> Self {
         BorderCornerRadius(Size::new(w, h))
     }
 }
 
 /// A generic value for the `border-spacing` property.
-#[derive(Animate, Clone, ComputeSquaredDistance, Copy, Debug, MallocSizeOf,
-         PartialEq, SpecifiedValueInfo, ToAnimatedValue, ToAnimatedZero,
-         ToComputedValue, ToCss)]
+#[derive(
+    Animate,
+    Clone,
+    ComputeSquaredDistance,
+    Copy,
+    Debug,
+    MallocSizeOf,
+    PartialEq,
+    SpecifiedValueInfo,
+    ToAnimatedValue,
+    ToAnimatedZero,
+    ToComputedValue,
+    ToCss,
+)]
 pub struct BorderSpacing<L>(#[css(field_bound)] pub Size<L>);
 
 impl<L> BorderSpacing<L> {
     /// Trivially create a `BorderCornerRadius`.
     pub fn new(w: L, h: L) -> Self {
         BorderSpacing(Size::new(w, h))
     }
 }
 
 /// A generic value for `border-radius`, `outline-radius` and `inset()`.
 ///
 /// <https://drafts.csswg.org/css-backgrounds-3/#border-radius>
-#[derive(Animate, Clone, ComputeSquaredDistance, Copy, Debug, MallocSizeOf,
-         PartialEq, SpecifiedValueInfo, ToComputedValue)]
+#[derive(
+    Animate,
+    Clone,
+    ComputeSquaredDistance,
+    Copy,
+    Debug,
+    MallocSizeOf,
+    PartialEq,
+    SpecifiedValueInfo,
+    ToComputedValue,
+)]
 pub struct BorderRadius<LengthOrPercentage> {
     /// The top left radius.
     pub top_left: BorderCornerRadius<LengthOrPercentage>,
     /// The top right radius.
     pub top_right: BorderCornerRadius<LengthOrPercentage>,
     /// The bottom right radius.
     pub bottom_right: BorderCornerRadius<LengthOrPercentage>,
     /// The bottom left radius.
@@ -115,17 +147,19 @@ where
         widths: Rect<&L>,
         heights: Rect<&L>,
         dest: &mut CssWriter<W>,
     ) -> fmt::Result
     where
         W: Write,
     {
         widths.to_css(dest)?;
-        if widths.0 != heights.0 || widths.1 != heights.1 || widths.2 != heights.2 ||
+        if widths.0 != heights.0 ||
+            widths.1 != heights.1 ||
+            widths.2 != heights.2 ||
             widths.3 != heights.3
         {
             dest.write_str(" / ")?;
             heights.to_css(dest)?;
         }
         Ok(())
     }
 }
--- a/servo/components/style/values/generics/box.rs
+++ b/servo/components/style/values/generics/box.rs
@@ -2,18 +2,28 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 //! Generic types for box properties.
 
 use values::animated::ToAnimatedZero;
 
 /// A generic value for the `vertical-align` property.
-#[derive(Animate, Clone, ComputeSquaredDistance, Copy, Debug, MallocSizeOf,
-         PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss)]
+#[derive(
+    Animate,
+    Clone,
+    ComputeSquaredDistance,
+    Copy,
+    Debug,
+    MallocSizeOf,
+    PartialEq,
+    SpecifiedValueInfo,
+    ToComputedValue,
+    ToCss,
+)]
 pub enum VerticalAlign<LengthOrPercentage> {
     /// `baseline`
     Baseline,
     /// `sub`
     Sub,
     /// `super`
     Super,
     /// `top`
@@ -43,29 +53,39 @@ impl<L> VerticalAlign<L> {
 
 impl<L> ToAnimatedZero for VerticalAlign<L> {
     fn to_animated_zero(&self) -> Result<Self, ()> {
         Err(())
     }
 }
 
 /// https://drafts.csswg.org/css-animations/#animation-iteration-count
-#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo,
-         ToComputedValue, ToCss)]
+#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss)]
 pub enum AnimationIterationCount<Number> {
     /// A `<number>` value.
     Number(Number),
     /// The `infinite` keyword.
     Infinite,
 }
 
 /// A generic value for the `perspective` property.
-#[derive(Animate, Clone, ComputeSquaredDistance, Copy, Debug, MallocSizeOf,
-         PartialEq, SpecifiedValueInfo, ToAnimatedValue, ToAnimatedZero,
-         ToComputedValue, ToCss)]
+#[derive(
+    Animate,
+    Clone,
+    ComputeSquaredDistance,
+    Copy,
+    Debug,
+    MallocSizeOf,
+    PartialEq,
+    SpecifiedValueInfo,
+    ToAnimatedValue,
+    ToAnimatedZero,
+    ToComputedValue,
+    ToCss,
+)]
 pub enum Perspective<NonNegativeLength> {
     /// A non-negative length.
     Length(NonNegativeLength),
     /// The keyword `none`.
     None,
 }
 
 impl<L> Perspective<L> {
--- a/servo/components/style/values/generics/column.rs
+++ b/servo/components/style/values/generics/column.rs
@@ -1,18 +1,29 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 //! Generic types for the column properties.
 
 /// A generic type for `column-count` values.
-#[derive(Animate, Clone, ComputeSquaredDistance, Copy, Debug, MallocSizeOf,
-         PartialEq, SpecifiedValueInfo, ToAnimatedValue, ToAnimatedZero,
-         ToComputedValue, ToCss)]
+#[derive(
+    Animate,
+    Clone,
+    ComputeSquaredDistance,
+    Copy,
+    Debug,
+    MallocSizeOf,
+    PartialEq,
+    SpecifiedValueInfo,
+    ToAnimatedValue,
+    ToAnimatedZero,
+    ToComputedValue,
+    ToCss,
+)]
 pub enum ColumnCount<PositiveInteger> {
     /// A positive integer.
     Integer(PositiveInteger),
     /// The keyword `auto`.
     #[animation(error)]
     Auto,
 }
 
--- a/servo/components/style/values/generics/counters.rs
+++ b/servo/components/style/values/generics/counters.rs
@@ -9,28 +9,28 @@ use computed_values::list_style_type::T 
 use std::ops::Deref;
 use values::CustomIdent;
 #[cfg(feature = "gecko")]
 use values::generics::CounterStyleOrNone;
 #[cfg(feature = "gecko")]
 use values::specified::Attr;
 
 /// A name / value pair for counters.
-#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo,
-         ToComputedValue, ToCss)]
+#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss)]
 pub struct CounterPair<Integer> {
     /// The name of the counter.
     pub name: CustomIdent,
     /// The value of the counter / increment / etc.
     pub value: Integer,
 }
 
 /// A generic value for the `counter-increment` property.
-#[derive(Clone, Debug, Default, MallocSizeOf, PartialEq, SpecifiedValueInfo,
-         ToComputedValue, ToCss)]
+#[derive(
+    Clone, Debug, Default, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss,
+)]
 pub struct CounterIncrement<I>(Counters<I>);
 
 impl<I> CounterIncrement<I> {
     /// Returns a new value for `counter-increment`.
     #[inline]
     pub fn new(counters: Vec<CounterPair<I>>) -> Self {
         CounterIncrement(Counters(counters.into_boxed_slice()))
     }
@@ -41,18 +41,19 @@ impl<I> Deref for CounterIncrement<I> {
 
     #[inline]
     fn deref(&self) -> &Self::Target {
         &(self.0).0
     }
 }
 
 /// A generic value for the `counter-reset` property.
-#[derive(Clone, Debug, Default, MallocSizeOf, PartialEq, SpecifiedValueInfo,
-         ToComputedValue, ToCss)]
+#[derive(
+    Clone, Debug, Default, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss,
+)]
 pub struct CounterReset<I>(Counters<I>);
 
 impl<I> CounterReset<I> {
     /// Returns a new value for `counter-reset`.
     #[inline]
     pub fn new(counters: Vec<CounterPair<I>>) -> Self {
         CounterReset(Counters(counters.into_boxed_slice()))
     }
@@ -65,18 +66,17 @@ impl<I> Deref for CounterReset<I> {
     fn deref(&self) -> &Self::Target {
         &(self.0).0
     }
 }
 
 /// A generic value for lists of counters.
 ///
 /// Keyword `none` is represented by an empty vector.
-#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo,
-         ToComputedValue, ToCss)]
+#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss)]
 pub struct Counters<I>(#[css(iterable, if_empty = "none")] Box<[CounterPair<I>]>);
 
 impl<I> Default for Counters<I> {
     #[inline]
     fn default() -> Self {
         Counters(vec![].into_boxed_slice())
     }
 }
@@ -97,18 +97,17 @@ fn is_decimal(counter_type: &CounterStyl
 #[inline]
 fn is_decimal(counter_type: &CounterStyleType) -> bool {
     *counter_type == CounterStyleOrNone::decimal()
 }
 
 /// The specified value for the `content` property.
 ///
 /// https://drafts.csswg.org/css-content/#propdef-content
-#[derive(Clone, Debug, Eq, MallocSizeOf, PartialEq, SpecifiedValueInfo,
-         ToComputedValue, ToCss)]
+#[derive(Clone, Debug, Eq, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss)]
 pub enum Content<ImageUrl> {
     /// `normal` reserved keyword.
     Normal,
     /// `none` reserved keyword.
     None,
     /// `-moz-alt-content`.
     #[cfg(feature = "gecko")]
     MozAltContent,
@@ -120,18 +119,17 @@ impl<ImageUrl> Content<ImageUrl> {
     /// Set `content` property to `normal`.
     #[inline]
     pub fn normal() -> Self {
         Content::Normal
     }
 }
 
 /// Items for the `content` property.
-#[derive(Clone, Debug, Eq, MallocSizeOf, PartialEq, SpecifiedValueInfo,
-         ToComputedValue, ToCss)]
+#[derive(Clone, Debug, Eq, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss)]
 pub enum ContentItem<ImageUrl> {
     /// Literal string content.
     String(Box<str>),
     /// `counter(name, style)`.
     #[css(comma, function)]
     Counter(CustomIdent, #[css(skip_if = "is_decimal")] CounterStyleType),
     /// `counters(name, separator, style)`.
     #[css(comma, function)]
--- a/servo/components/style/values/generics/effects.rs
+++ b/servo/components/style/values/generics/effects.rs
@@ -1,33 +1,51 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 //! Generic types for CSS values related to effects.
 
 /// A generic value for a single `box-shadow`.
-#[derive(Animate, Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo,
-         ToAnimatedValue, ToAnimatedZero, ToCss)]
+#[derive(
+    Animate,
+    Clone,
+    Debug,
+    MallocSizeOf,
+    PartialEq,
+    SpecifiedValueInfo,
+    ToAnimatedValue,
+    ToAnimatedZero,
+    ToCss,
+)]
 pub struct BoxShadow<Color, SizeLength, BlurShapeLength, ShapeLength> {
     /// The base shadow.
     pub base: SimpleShadow<Color, SizeLength, BlurShapeLength>,
     /// The spread radius.
     pub spread: ShapeLength,
     /// Whether this is an inset box shadow.
     #[animation(constant)]
     #[css(represents_keyword)]
     pub inset: bool,
 }
 
 /// A generic value for a single `filter`.
 #[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
 #[animation(no_bound(Url))]
-#[derive(Clone, ComputeSquaredDistance, Debug, MallocSizeOf, PartialEq,
-         SpecifiedValueInfo, ToAnimatedValue, ToComputedValue, ToCss)]
+#[derive(
+    Clone,
+    ComputeSquaredDistance,
+    Debug,
+    MallocSizeOf,
+    PartialEq,
+    SpecifiedValueInfo,
+    ToAnimatedValue,
+    ToComputedValue,
+    ToCss,
+)]
 pub enum Filter<Angle, Factor, Length, DropShadow, Url> {
     /// `blur(<length>)`
     #[css(function)]
     Blur(Length),
     /// `brightness(<factor>)`
     #[css(function)]
     Brightness(Factor),
     /// `contrast(<factor>)`
@@ -58,18 +76,28 @@ pub enum Filter<Angle, Factor, Length, D
     #[animation(error)]
     Url(Url),
 }
 
 /// A generic value for the `drop-shadow()` filter and the `text-shadow` property.
 ///
 /// Contrary to the canonical order from the spec, the color is serialised
 /// first, like in Gecko and Webkit.
-#[derive(Animate, Clone, ComputeSquaredDistance, Debug, MallocSizeOf, PartialEq,
-         SpecifiedValueInfo, ToAnimatedValue, ToAnimatedZero, ToCss)]
+#[derive(
+    Animate,
+    Clone,
+    ComputeSquaredDistance,
+    Debug,
+    MallocSizeOf,
+    PartialEq,
+    SpecifiedValueInfo,
+    ToAnimatedValue,
+    ToAnimatedZero,
+    ToCss,
+)]
 pub struct SimpleShadow<Color, SizeLength, ShapeLength> {
     /// Color.
     pub color: Color,
     /// Horizontal radius.
     pub horizontal: SizeLength,
     /// Vertical radius.
     pub vertical: SizeLength,
     /// Blur radius.
--- a/servo/components/style/values/generics/flex.rs
+++ b/servo/components/style/values/generics/flex.rs
@@ -1,17 +1,27 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 //! Generic types for CSS values related to flexbox.
 
 /// A generic value for the `flex-basis` property.
 #[cfg_attr(feature = "servo", derive(MallocSizeOf))]
-#[derive(Animate, Clone, ComputeSquaredDistance, Copy, Debug, PartialEq,
-         SpecifiedValueInfo, ToAnimatedValue, ToAnimatedZero, ToComputedValue,
-         ToCss)]
+#[derive(
+    Animate,
+    Clone,
+    ComputeSquaredDistance,
+    Copy,
+    Debug,
+    PartialEq,
+    SpecifiedValueInfo,
+    ToAnimatedValue,
+    ToAnimatedZero,
+    ToComputedValue,
+    ToCss,
+)]
 pub enum FlexBasis<Width> {
     /// `content`
     Content,
     /// `<width>`
     Width(Width),
 }
--- a/servo/components/style/values/generics/font.rs
+++ b/servo/components/style/values/generics/font.rs
@@ -11,18 +11,17 @@ use num_traits::One;
 use parser::{Parse, ParserContext};
 use std::fmt::{self, Write};
 use std::io::Cursor;
 use style_traits::{CssWriter, KeywordsCollectFn, ParseError};
 use style_traits::{SpecifiedValueInfo, StyleParseErrorKind, ToCss};
 use values::distance::{ComputeSquaredDistance, SquaredDistance};
 
 /// https://drafts.csswg.org/css-fonts-4/#feature-tag-value
-#[derive(Clone, Debug, Eq, MallocSizeOf, PartialEq, SpecifiedValueInfo,
-         ToComputedValue)]
+#[derive(Clone, Debug, Eq, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue)]
 pub struct FeatureTagValue<Integer> {
     /// A four-character tag, packed into a u32 (one byte per character).
     pub tag: FontTag,
     /// The actual value.
     pub value: Integer,
 }
 
 impl<Integer> ToCss for FeatureTagValue<Integer>
@@ -42,18 +41,19 @@ where
 
         Ok(())
     }
 }
 
 /// Variation setting for a single feature, see:
 ///
 /// https://drafts.csswg.org/css-fonts-4/#font-variation-settings-def
-#[derive(Animate, Clone, Debug, Eq, MallocSizeOf, PartialEq, SpecifiedValueInfo,
-         ToComputedValue, ToCss)]
+#[derive(
+    Animate, Clone, Debug, Eq, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss,
+)]
 pub struct VariationValue<Number> {
     /// A four-character tag, packed into a u32 (one byte per character).
     #[animation(constant)]
     pub tag: FontTag,
     /// The actual value.
     pub value: Number,
 }
 
@@ -67,18 +67,17 @@ where
             return Err(());
         }
         self.value.compute_squared_distance(&other.value)
     }
 }
 
 /// A value both for font-variation-settings and font-feature-settings.
 #[css(comma)]
-#[derive(Clone, Debug, Eq, MallocSizeOf, PartialEq, SpecifiedValueInfo,
-         ToComputedValue, ToCss)]
+#[derive(Clone, Debug, Eq, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss)]
 pub struct FontSettings<T>(#[css(if_empty = "normal", iterable)] pub Box<[T]>);
 
 impl<T> FontSettings<T> {
     /// Default value of font settings as `normal`.
     #[inline]
     pub fn normal() -> Self {
         FontSettings(vec![].into_boxed_slice())
     }
@@ -104,18 +103,17 @@ impl<T: Parse> Parse for FontSettings<T>
 }
 
 /// A font four-character tag, represented as a u32 for convenience.
 ///
 /// See:
 ///   https://drafts.csswg.org/css-fonts-4/#font-variation-settings-def
 ///   https://drafts.csswg.org/css-fonts-4/#descdef-font-face-font-feature-settings
 ///
-#[derive(Clone, Copy, Debug, Eq, MallocSizeOf, PartialEq, SpecifiedValueInfo,
-         ToComputedValue)]
+#[derive(Clone, Copy, Debug, Eq, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue)]
 pub struct FontTag(pub u32);
 
 impl ToCss for FontTag {
     fn to_css<W>(&self, dest: &mut CssWriter<W>) -> fmt::Result
     where
         W: Write,
     {
         use byteorder::{BigEndian, ByteOrder};
@@ -140,18 +138,28 @@ impl Parse for FontTag {
             return Err(location.new_custom_error(StyleParseErrorKind::UnspecifiedError));
         }
 
         let mut raw = Cursor::new(tag.as_bytes());
         Ok(FontTag(raw.read_u32::<BigEndian>().unwrap()))
     }
 }
 
-#[derive(Animate, Clone, ComputeSquaredDistance, Copy, Debug, MallocSizeOf, PartialEq,
-         ToAnimatedValue, ToAnimatedZero, ToCss)]
+#[derive(
+    Animate,
+    Clone,
+    ComputeSquaredDistance,
+    Copy,
+    Debug,
+    MallocSizeOf,
+    PartialEq,
+    ToAnimatedValue,
+    ToAnimatedZero,
+    ToCss,
+)]
 /// Additional information for keyword-derived font sizes.
 pub struct KeywordInfo<Length> {
     /// The keyword used
     pub kw: KeywordSize,
     /// A factor to be multiplied by the computed size of the keyword
     #[css(skip)]
     pub factor: f32,
     /// An additional Au offset to add to the kw*factor in the case of calcs
@@ -184,19 +192,30 @@ where
 
 impl<L> SpecifiedValueInfo for KeywordInfo<L> {
     fn collect_completion_keywords(f: KeywordsCollectFn) {
         <KeywordSize as SpecifiedValueInfo>::collect_completion_keywords(f);
     }
 }
 
 /// CSS font keywords
-#[derive(Animate, Clone, ComputeSquaredDistance, Copy, Debug, MallocSizeOf,
-         Parse, PartialEq, SpecifiedValueInfo, ToAnimatedValue, ToAnimatedZero,
-         ToCss)]
+#[derive(
+    Animate,
+    Clone,
+    ComputeSquaredDistance,
+    Copy,
+    Debug,
+    MallocSizeOf,
+    Parse,
+    PartialEq,
+    SpecifiedValueInfo,
+    ToAnimatedValue,
+    ToAnimatedZero,
+    ToCss,
+)]
 #[allow(missing_docs)]
 pub enum KeywordSize {
     #[css(keyword = "xx-small")]
     XXSmall,
     XSmall,
     Small,
     Medium,
     Large,
@@ -223,18 +242,29 @@ impl Default for KeywordSize {
     }
 }
 
 /// A generic value for the `font-style` property.
 ///
 /// https://drafts.csswg.org/css-fonts-4/#font-style-prop
 #[allow(missing_docs)]
 #[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
-#[derive(Animate, Clone, ComputeSquaredDistance, Copy, Debug, Hash, MallocSizeOf,
-         PartialEq, SpecifiedValueInfo, ToAnimatedValue, ToAnimatedZero)]
+#[derive(
+    Animate,
+    Clone,
+    ComputeSquaredDistance,
+    Copy,
+    Debug,
+    Hash,
+    MallocSizeOf,
+    PartialEq,
+    SpecifiedValueInfo,
+    ToAnimatedValue,
+    ToAnimatedZero,
+)]
 pub enum FontStyle<Angle> {
     #[animation(error)]
     Normal,
     #[animation(error)]
     Italic,
     #[value_info(starts_with_keyword)]
     Oblique(Angle),
 }
--- a/servo/components/style/values/generics/gecko.rs
+++ b/servo/components/style/values/generics/gecko.rs
@@ -2,18 +2,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 //! Generic types for legacy Gecko-only properties that should probably be
 //! unshipped at some point in the future.
 
 /// A generic value for scroll snap points.
 #[cfg_attr(feature = "gecko", derive(MallocSizeOf))]
-#[derive(Clone, Copy, Debug, PartialEq, SpecifiedValueInfo, ToComputedValue,
-         ToCss)]
+#[derive(Clone, Copy, Debug, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss)]
 pub enum ScrollSnapPoint<LengthOrPercentage> {
     /// `none`
     None,
     /// `repeat(<length-or-percentage>)`
     #[css(function)]
     Repeat(LengthOrPercentage),
 }
 
--- a/servo/components/style/values/generics/grid.rs
+++ b/servo/components/style/values/generics/grid.rs
@@ -13,18 +13,17 @@ use style_traits::{CssWriter, ParseError
 use values::{CSSFloat, CustomIdent};
 use values::computed::{Context, ToComputedValue};
 use values::specified;
 use values::specified::grid::parse_line_names;
 
 /// A `<grid-line>` type.
 ///
 /// <https://drafts.csswg.org/css-grid/#typedef-grid-row-start-grid-line>
-#[derive(Clone, Debug, Default, MallocSizeOf, PartialEq, SpecifiedValueInfo,
-         ToComputedValue)]
+#[derive(Clone, Debug, Default, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue)]
 pub struct GridLine<Integer> {
     /// Flag to check whether it's a `span` keyword.
     pub is_span: bool,
     /// A custom identifier for named lines.
     ///
     /// <https://drafts.csswg.org/css-grid/#grid-placement-slot>
     pub ident: Option<CustomIdent>,
     /// Denotes the nth grid line from grid item's placement.
@@ -144,30 +143,39 @@ impl Parse for GridLine<specified::Integ
         }
 
         Ok(grid_line)
     }
 }
 
 #[allow(missing_docs)]
 #[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
-#[derive(Clone, Copy, Debug, Eq, MallocSizeOf, Parse, PartialEq,
-         SpecifiedValueInfo, ToComputedValue, ToCss)]
+#[derive(
+    Clone,
+    Copy,
+    Debug,
+    Eq,
+    MallocSizeOf,
+    Parse,
+    PartialEq,
+    SpecifiedValueInfo,
+    ToComputedValue,
+    ToCss,
+)]
 pub enum TrackKeyword {
     Auto,
     MaxContent,
     MinContent,
 }
 
 /// A track breadth for explicit grid track sizing. It's generic solely to
 /// avoid re-implementing it for the computed type.
 ///
 /// <https://drafts.csswg.org/css-grid/#typedef-track-breadth>
-#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo,
-         ToComputedValue, ToCss)]
+#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss)]
 pub enum TrackBreadth<L> {
     /// The generic type is almost always a non-negative `<length-percentage>`
     Breadth(L),
     /// A flex fraction specified in `fr` units.
     #[css(dimension)]
     Fr(CSSFloat),
     /// One of the track-sizing keywords (`auto`, `min-content`, `max-content`)
     Keyword(TrackKeyword),
@@ -378,18 +386,17 @@ impl Parse for RepeatCount<specified::In
         }
     }
 }
 
 /// The structure containing `<line-names>` and `<track-size>` values.
 ///
 /// It can also hold `repeat()` function parameters, which expands into the respective
 /// values in its computed form.
-#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo,
-         ToComputedValue)]
+#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue)]
 #[css(function = "repeat")]
 pub struct TrackRepeat<L, I> {
     /// The number of times for the value to be repeated (could also be `auto-fit` or `auto-fill`)
     pub count: RepeatCount<I>,
     /// `<line-names>` accompanying `<track_size>` values.
     ///
     /// If there's no `<line-names>`, then it's represented by an empty vector.
     /// For N `<track-size>` values, there will be N+1 `<line-names>`, and so this vector's
@@ -404,17 +411,18 @@ impl<L: ToCss, I: ToCss> ToCss for Track
     where
         W: Write,
     {
         dest.write_str("repeat(")?;
         self.count.to_css(dest)?;
         dest.write_str(", ")?;
 
         let mut line_names_iter = self.line_names.iter();
-        for (i, (ref size, ref names)) in self.track_sizes
+        for (i, (ref size, ref names)) in self
+            .track_sizes
             .iter()
             .zip(&mut line_names_iter)
             .enumerate()
         {
             if i > 0 {
                 dest.write_str(" ")?;
             }
 
@@ -466,18 +474,17 @@ impl<L: Clone> TrackRepeat<L, specified:
                 track_sizes: self.track_sizes.clone(),
                 line_names: self.line_names.clone(),
             }
         }
     }
 }
 
 /// Track list values. Can be <track-size> or <track-repeat>
-#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo,
-         ToComputedValue, ToCss)]
+#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss)]
 pub enum TrackListValue<LengthOrPercentage, Integer> {
     /// A <track-size> value.
     TrackSize(TrackSize<LengthOrPercentage>),
     /// A <track-repeat> value.
     TrackRepeat(TrackRepeat<LengthOrPercentage, Integer>),
 }
 
 /// The type of a `<track-list>` as determined during parsing.
@@ -573,18 +580,17 @@ impl<L: ToCss, I: ToCss> ToCss for Track
         Ok(())
     }
 }
 
 /// The `<line-name-list>` for subgrids.
 ///
 /// `subgrid [ <line-names> | repeat(<positive-integer> | auto-fill, <line-names>+) ]+`
 /// Old spec: https://www.w3.org/TR/2015/WD-css-grid-1-20150917/#typedef-line-name-list
-#[derive(Clone, Debug, Default, MallocSizeOf, PartialEq, SpecifiedValueInfo,
-         ToComputedValue)]
+#[derive(Clone, Debug, Default, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue)]
 pub struct LineNameList {
     /// The optional `<line-name-list>`
     pub names: Box<[Box<[CustomIdent]>]>,
     /// Indicates the line name that requires `auto-fill`
     pub fill_idx: Option<u32>,
 }
 
 impl Parse for LineNameList {
@@ -619,17 +625,19 @@ impl Parse for LineNameList {
                             .iter()
                             .cloned()
                             .cycle()
                             .take(num.value() as usize * names_list.len()),
                     ),
                     RepeatCount::AutoFill if fill_idx.is_none() => {
                         // `repeat(autof-fill, ..)` should have just one line name.
                         if names_list.len() != 1 {
-                            return Err(input.new_custom_error(StyleParseErrorKind::UnspecifiedError));
+                            return Err(
+                                input.new_custom_error(StyleParseErrorKind::UnspecifiedError)
+                            );
                         }
                         let names = names_list.pop().unwrap();
 
                         line_names.push(names);
                         fill_idx = Some(line_names.len() as u32 - 1);
                     },
                     _ => return Err(input.new_custom_error(StyleParseErrorKind::UnspecifiedError)),
                 }
@@ -677,18 +685,17 @@ impl ToCss for LineNameList {
 
         Ok(())
     }
 }
 
 /// Variants for `<grid-template-rows> | <grid-template-columns>`
 /// Subgrid deferred to Level 2 spec due to lack of implementation.
 /// But it's implemented in gecko, so we have to as well.
-#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo,
-         ToComputedValue, ToCss)]
+#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss)]
 pub enum GridTemplateComponent<L, I> {
     /// `none` value.
     None,
     /// The grid `<track-list>`
     TrackList(#[compute(field_bound)] TrackList<L, I>),
     /// A `subgrid <line-name-list>?`
     Subgrid(LineNameList),
 }
--- a/servo/components/style/values/generics/image.rs
+++ b/servo/components/style/values/generics/image.rs
@@ -140,17 +140,17 @@ pub struct PaintWorklet {
     /// The name the worklet was registered with.
     pub name: Atom,
     /// The arguments for the worklet.
     /// TODO: store a parsed representation of the arguments.
     #[cfg_attr(feature = "servo", ignore_malloc_size_of = "Arc")]
     pub arguments: Vec<Arc<custom_properties::SpecifiedValue>>,
 }
 
-impl ::style_traits::SpecifiedValueInfo for PaintWorklet { }
+impl ::style_traits::SpecifiedValueInfo for PaintWorklet {}
 
 impl ToCss for PaintWorklet {
     fn to_css<W>(&self, dest: &mut CssWriter<W>) -> fmt::Result
     where
         W: Write,
     {
         dest.write_str("paint(")?;
         serialize_atom_identifier(&self.name, dest)?;
@@ -162,18 +162,17 @@ impl ToCss for PaintWorklet {
     }
 }
 
 /// Values for `moz-image-rect`.
 ///
 /// `-moz-image-rect(<uri>, top, right, bottom, left);`
 #[allow(missing_docs)]
 #[css(comma, function)]
-#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo,
-         ToComputedValue, ToCss)]
+#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss)]
 pub struct MozImageRect<NumberOrPercentage, MozImageRectUrl> {
     pub url: MozImageRectUrl,
     pub top: NumberOrPercentage,
     pub right: NumberOrPercentage,
     pub bottom: NumberOrPercentage,
     pub left: NumberOrPercentage,
 }
 
--- a/servo/components/style/values/generics/mod.rs
+++ b/servo/components/style/values/generics/mod.rs
@@ -152,19 +152,42 @@ impl SpecifiedValueInfo for CounterStyle
             }
         }
         include!("../../counter_style/predefined.rs");
     }
 }
 
 /// A wrapper of Non-negative values.
 #[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
-#[derive(Animate, Clone, ComputeSquaredDistance, Copy, Debug, Hash, MallocSizeOf,
-         PartialEq, PartialOrd, SpecifiedValueInfo, ToAnimatedZero,
-         ToComputedValue, ToCss)]
+#[derive(
+    Animate,
+    Clone,
+    ComputeSquaredDistance,
+    Copy,
+    Debug,
+    Hash,
+    MallocSizeOf,
+    PartialEq,
+    PartialOrd,
+    SpecifiedValueInfo,
+    ToAnimatedZero,
+    ToComputedValue,
+    ToCss,
+)]
 pub struct NonNegative<T>(pub T);
 
 /// A wrapper of greater-than-or-equal-to-one values.
 #[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
-#[derive(Animate, Clone, ComputeSquaredDistance, Copy, Debug, MallocSizeOf,
-         PartialEq, PartialOrd, SpecifiedValueInfo, ToAnimatedZero,
-         ToComputedValue, ToCss)]
+#[derive(
+    Animate,
+    Clone,
+    ComputeSquaredDistance,
+    Copy,
+    Debug,
+    MallocSizeOf,
+    PartialEq,
+    PartialOrd,
+    SpecifiedValueInfo,
+    ToAnimatedZero,
+    ToComputedValue,
+    ToCss,
+)]
 pub struct GreaterThanOrEqualToOne<T>(pub T);
--- a/servo/components/style/values/generics/position.rs
+++ b/servo/components/style/values/generics/position.rs
@@ -1,18 +1,28 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 //! Generic types for CSS handling of specified and computed values of
 //! [`position`](https://drafts.csswg.org/css-backgrounds-3/#position)
 
 /// A generic type for representing a CSS [position](https://drafts.csswg.org/css-values/#position).
-#[derive(Animate, Clone, ComputeSquaredDistance, Copy, Debug, MallocSizeOf,
-         PartialEq, SpecifiedValueInfo, ToAnimatedZero, ToComputedValue)]
+#[derive(
+    Animate,
+    Clone,
+    ComputeSquaredDistance,
+    Copy,
+    Debug,
+    MallocSizeOf,
+    PartialEq,
+    SpecifiedValueInfo,
+    ToAnimatedZero,
+    ToComputedValue,
+)]
 pub struct Position<H, V> {
     /// The horizontal component of position.
     pub horizontal: H,
     /// The vertical component of position.
     pub vertical: V,
 }
 
 impl<H, V> Position<H, V> {
@@ -21,18 +31,29 @@ impl<H, V> Position<H, V> {
         Self {
             horizontal: horizontal,
             vertical: vertical,
         }
     }
 }
 
 /// A generic value for the `z-index` property.
-#[derive(Animate, Clone, ComputeSquaredDistance, Copy, Debug, MallocSizeOf,
-         PartialEq, SpecifiedValueInfo, ToAnimatedZero, ToComputedValue, ToCss)]
+#[derive(
+    Animate,
+    Clone,
+    ComputeSquaredDistance,
+    Copy,
+    Debug,
+    MallocSizeOf,
+    PartialEq,
+    SpecifiedValueInfo,
+    ToAnimatedZero,
+    ToComputedValue,
+    ToCss,
+)]
 pub enum ZIndex<Integer> {
     /// An integer value.
     Integer(Integer),
     /// The keyword `auto`.
     Auto,
 }
 
 impl<Integer> ZIndex<Integer> {
--- a/servo/components/style/values/generics/rect.rs
+++ b/servo/components/style/values/generics/rect.rs
@@ -6,18 +6,27 @@
 
 use cssparser::Parser;
 use parser::{Parse, ParserContext};
 use std::fmt::{self, Write};
 use style_traits::{CssWriter, ParseError, ToCss};
 
 /// A CSS value made of four components, where its `ToCss` impl will try to
 /// serialize as few components as possible, like for example in `border-width`.
-#[derive(Animate, Clone, ComputeSquaredDistance, Copy, Debug, MallocSizeOf,
-         PartialEq, SpecifiedValueInfo, ToComputedValue)]
+#[derive(
+    Animate,
+    Clone,
+    ComputeSquaredDistance,
+    Copy,
+    Debug,
+    MallocSizeOf,
+    PartialEq,
+    SpecifiedValueInfo,
+    ToComputedValue,
+)]
 pub struct Rect<T>(pub T, pub T, pub T, pub T);
 
 impl<T> Rect<T> {
     /// Returns a new `Rect<T>` value.
     pub fn new(first: T, second: T, third: T, fourth: T) -> Self {
         Rect(first, second, third, fourth)
     }
 }
--- a/servo/components/style/values/generics/size.rs
+++ b/servo/components/style/values/generics/size.rs
@@ -8,18 +8,27 @@ use cssparser::Parser;
 use euclid::Size2D;
 use parser::ParserContext;
 use std::fmt::{self, Write};
 use style_traits::{CssWriter, ParseError, SpecifiedValueInfo, ToCss};
 use values::animated::ToAnimatedValue;
 
 /// A generic size, for `border-*-radius` longhand properties, or
 /// `border-spacing`.
-#[derive(Animate, Clone, ComputeSquaredDistance, Copy, Debug, MallocSizeOf, PartialEq,
-         ToAnimatedZero, ToComputedValue)]
+#[derive(
+    Animate,
+    Clone,
+    ComputeSquaredDistance,
+    Copy,
+    Debug,
+    MallocSizeOf,
+    PartialEq,
+    ToAnimatedZero,
+    ToComputedValue,
+)]
 pub struct Size<L>(pub Size2D<L>);
 
 impl<L> Size<L> {
     #[inline]
     /// Create a new `Size` for an area of given width and height.
     pub fn new(width: L, height: L) -> Size<L> {
         Size(Size2D::new(width, height))
     }
--- a/servo/components/style/values/generics/svg.rs
+++ b/servo/components/style/values/generics/svg.rs
@@ -11,34 +11,54 @@ use values::{Either, None_};
 use values::computed::NumberOrPercentage;
 use values::computed::length::LengthOrPercentage;
 use values::distance::{ComputeSquaredDistance, SquaredDistance};
 
 /// An SVG paint value
 ///
 /// <https://www.w3.org/TR/SVG2/painting.html#SpecifyingPaint>
 #[animation(no_bound(UrlPaintServer))]
-#[derive(Animate, Clone, ComputeSquaredDistance, Debug, MallocSizeOf, PartialEq,
-         SpecifiedValueInfo, ToAnimatedValue, ToComputedValue, ToCss)]
+#[derive(
+    Animate,
+    Clone,
+    ComputeSquaredDistance,
+    Debug,
+    MallocSizeOf,
+    PartialEq,
+    SpecifiedValueInfo,
+    ToAnimatedValue,
+    ToComputedValue,
+    ToCss,
+)]
 pub struct SVGPaint<ColorType, UrlPaintServer> {
     /// The paint source
     pub kind: SVGPaintKind<ColorType, UrlPaintServer>,
     /// The fallback color. It would be empty, the `none` keyword or <color>.
     pub fallback: Option<Either<ColorType, None_>>,
 }
 
 /// An SVG paint value without the fallback
 ///
 /// Whereas the spec only allows PaintServer
 /// to have a fallback, Gecko lets the context
 /// properties have a fallback as well.
 #[animation(no_bound(UrlPaintServer))]
-#[derive(Animate, Clone, ComputeSquaredDistance, Debug, MallocSizeOf, PartialEq,
-         SpecifiedValueInfo, ToAnimatedValue, ToAnimatedZero, ToComputedValue,
-         ToCss)]
+#[derive(
+    Animate,
+    Clone,
+    ComputeSquaredDistance,
+    Debug,
+    MallocSizeOf,
+    PartialEq,
+    SpecifiedValueInfo,
+    ToAnimatedValue,
+    ToAnimatedZero,
+    ToComputedValue,
+    ToCss,
+)]
 pub enum SVGPaintKind<ColorType, UrlPaintServer> {
     /// `none`
     #[animation(error)]
     None,
     /// `<color>`
     Color(ColorType),
     /// `url(...)`
     #[animation(error)]
@@ -108,18 +128,28 @@ impl<ColorType: Parse, UrlPaintServer: P
         } else {
             Err(input.new_custom_error(StyleParseErrorKind::UnspecifiedError))
         }
     }
 }
 
 /// A value of <length> | <percentage> | <number> for svg which allow unitless length.
 /// <https://www.w3.org/TR/SVG11/painting.html#StrokeProperties>
-#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo,
-         ToAnimatedValue, ToAnimatedZero, ToComputedValue, ToCss)]
+#[derive(
+    Clone,
+    Copy,
+    Debug,
+    MallocSizeOf,
+    PartialEq,
+    SpecifiedValueInfo,
+    ToAnimatedValue,
+    ToAnimatedZero,
+    ToComputedValue,
+    ToCss,
+)]
 pub enum SvgLengthOrPercentageOrNumber<LengthOrPercentage, Number> {
     /// <length> | <percentage>
     LengthOrPercentage(LengthOrPercentage),
     /// <number>
     Number(Number),
 }
 
 impl<L, N> ComputeSquaredDistance for SvgLengthOrPercentageOrNumber<L, N>
@@ -186,44 +216,69 @@ impl<LengthOrPercentageType: Parse, Numb
         if let Ok(lop) = input.try(|i| LengthOrPercentageType::parse(context, i)) {
             return Ok(SvgLengthOrPercentageOrNumber::LengthOrPercentage(lop));
         }
         Err(input.new_custom_error(StyleParseErrorKind::UnspecifiedError))
     }
 }
 
 /// An SVG length value supports `context-value` in addition to length.
-#[derive(Clone, ComputeSquaredDistance, Copy, Debug, MallocSizeOf, PartialEq,
-         SpecifiedValueInfo, ToAnimatedValue, ToAnimatedZero, ToComputedValue,
-         ToCss)]
+#[derive(
+    Clone,
+    ComputeSquaredDistance,
+    Copy,
+    Debug,
+    MallocSizeOf,
+    PartialEq,
+    SpecifiedValueInfo,
+    ToAnimatedValue,
+    ToAnimatedZero,
+    ToComputedValue,
+    ToCss,
+)]
 pub enum SVGLength<LengthType> {
     /// `<length> | <percentage> | <number>`
     Length(LengthType),
     /// `context-value`
     ContextValue,
 }
 
 /// Generic value for stroke-dasharray.
-#[derive(Clone, Debug, MallocSizeOf, PartialEq,
-         SpecifiedValueInfo, ToAnimatedValue, ToComputedValue, ToCss)]
+#[derive(
+    Clone,
+    Debug,
+    MallocSizeOf,
+    PartialEq,
+    SpecifiedValueInfo,
+    ToAnimatedValue,
+    ToComputedValue,
+    ToCss,
+)]
 pub enum SVGStrokeDashArray<LengthType> {
     /// `[ <length> | <percentage> | <number> ]#`
     #[css(comma)]
-    Values(
-        #[css(if_empty = "none", iterable)]
-        Vec<LengthType>,
-    ),
+    Values(#[css(if_empty = "none", iterable)] Vec<LengthType>),
     /// `context-value`
     ContextValue,
 }
 
 /// An SVG opacity value accepts `context-{fill,stroke}-opacity` in
 /// addition to opacity value.
-#[derive(Clone, ComputeSquaredDistance, Copy, Debug, MallocSizeOf, PartialEq,
-         SpecifiedValueInfo, ToAnimatedZero, ToComputedValue, ToCss)]
+#[derive(
+    Clone,
+    ComputeSquaredDistance,
+    Copy,
+    Debug,
+    MallocSizeOf,
+    PartialEq,
+    SpecifiedValueInfo,
+    ToAnimatedZero,
+    ToComputedValue,
+    ToCss,
+)]
 pub enum SVGOpacity<OpacityType> {
     /// `<opacity-value>`
     Opacity(OpacityType),
     /// `context-fill-opacity`
     ContextFillOpacity,
     /// `context-stroke-opacity`
     ContextStrokeOpacity,
 }
--- a/servo/components/style/values/generics/text.rs
+++ b/servo/components/style/values/generics/text.rs
@@ -7,36 +7,38 @@
 use app_units::Au;
 use cssparser::Parser;
 use parser::ParserContext;
 use style_traits::ParseError;
 use values::animated::{Animate, Procedure, ToAnimatedZero};
 use values::distance::{ComputeSquaredDistance, SquaredDistance};
 
 /// A generic value for the `initial-letter` property.
-#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo,
-         ToComputedValue, ToCss)]
+#[derive(
+    Clone, Copy, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss,
+)]
 pub enum InitialLetter<Number, Integer> {
     /// `normal`
     Normal,
     /// `<number> <integer>?`
     Specified(Number, Option<Integer>),
 }
 
 impl<N, I> InitialLetter<N, I> {
     /// Returns `normal`.
     #[inline]
     pub fn normal() -> Self {
         InitialLetter::Normal
     }
 }
 
 /// A generic spacing value for the `letter-spacing` and `word-spacing` properties.
-#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo,
-         ToComputedValue, ToCss)]
+#[derive(
+    Clone, Copy, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss,
+)]
 pub enum Spacing<Value> {
     /// `normal`
     Normal,
     /// `<value>`
     Value(Value),
 }
 
 impl<Value> Spacing<Value> {
@@ -107,18 +109,28 @@ where
 {
     #[inline]
     fn to_animated_zero(&self) -> Result<Self, ()> {
         Err(())
     }
 }
 
 /// A generic value for the `line-height` property.
-#[derive(Animate, Clone, ComputeSquaredDistance, Copy, Debug, MallocSizeOf,
-         PartialEq, SpecifiedValueInfo, ToAnimatedValue, ToCss)]
+#[derive(
+    Animate,
+    Clone,
+    ComputeSquaredDistance,
+    Copy,
+    Debug,
+    MallocSizeOf,
+    PartialEq,
+    SpecifiedValueInfo,
+    ToAnimatedValue,
+    ToCss,
+)]
 pub enum LineHeight<Number, LengthOrPercentage> {
     /// `normal`
     Normal,
     /// `-moz-block-height`
     #[cfg(feature = "gecko")]
     MozBlockHeight,
     /// `<number>`
     Number(Number),
@@ -137,17 +149,28 @@ impl<N, L> LineHeight<N, L> {
     /// Returns `normal`.
     #[inline]
     pub fn normal() -> Self {
         LineHeight::Normal
     }
 }
 
 /// A generic value for the `-moz-tab-size` property.
-#[derive(Animate, Clone, ComputeSquaredDistance, Copy, Debug, MallocSizeOf,
-         PartialEq, SpecifiedValueInfo, ToAnimatedValue, ToAnimatedZero,
-         ToComputedValue, ToCss)]
+#[derive(
+    Animate,
+    Clone,
+    ComputeSquaredDistance,
+    Copy,
+    Debug,
+    MallocSizeOf,
+    PartialEq,
+    SpecifiedValueInfo,
+    ToAnimatedValue,
+    ToAnimatedZero,
+    ToComputedValue,
+    ToCss,
+)]
 pub enum MozTabSize<Number, Length> {
     /// A number.
     Number(Number),
     /// A length.
     Length(Length),
 }
--- a/servo/components/style/values/generics/transform.rs
+++ b/servo/components/style/values/generics/transform.rs
@@ -10,18 +10,19 @@ use num_traits::Zero;
 use values::{computed, CSSFloat};
 use values::computed::length::Length as ComputedLength;
 use values::computed::length::LengthOrPercentage as ComputedLengthOrPercentage;
 use values::specified::length::Length as SpecifiedLength;
 use values::specified::length::LengthOrPercentage as SpecifiedLengthOrPercentage;
 
 /// A generic 2D transformation matrix.
 #[allow(missing_docs)]
-#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo,
-         ToComputedValue, ToCss)]
+#[derive(
+    Clone, Copy, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss,
+)]
 #[css(comma, function)]
 pub struct Matrix<T> {
     pub a: T,
     pub b: T,
     pub c: T,
     pub d: T,
     pub e: T,
     pub f: T,
@@ -61,32 +62,42 @@ impl<T: Into<f64>> From<Matrix3D<T>> for
             m.m21.into(), m.m22.into(), m.m23.into(), m.m24.into(),
             m.m31.into(), m.m32.into(), m.m33.into(), m.m34.into(),
             m.m41.into(), m.m42.into(), m.m43.into(), m.m44.into(),
         )
     }
 }
 
 /// A generic transform origin.
-#[derive(Animate, Clone, ComputeSquaredDistance, Copy, Debug, MallocSizeOf,
-         PartialEq, SpecifiedValueInfo, ToAnimatedZero, ToComputedValue, ToCss)]
+#[derive(
+    Animate,
+    Clone,
+    ComputeSquaredDistance,
+    Copy,
+    Debug,
+    MallocSizeOf,
+    PartialEq,
+    SpecifiedValueInfo,
+    ToAnimatedZero,
+    ToComputedValue,
+    ToCss,
+)]
 pub struct TransformOrigin<H, V, Depth> {
     /// The horizontal origin.
     pub horizontal: H,
     /// The vertical origin.
     pub vertical: V,
     /// The depth.
     pub depth: Depth,
 }
 
 /// A generic timing function.
 ///
 /// <https://drafts.csswg.org/css-timing-1/#single-timing-function-production>
-#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo,
-         ToCss)]
+#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToCss)]
 #[value_info(ty = "TIMING_FUNCTION")]
 pub enum TimingFunction<Integer, Number> {
     /// `linear | ease | ease-in | ease-out | ease-in-out`
     Keyword(TimingKeyword),
     /// `cubic-bezier(<number>, <number>, <number>, <number>)`
     #[allow(missing_docs)]
     #[css(comma, function)]
     CubicBezier {
@@ -101,18 +112,28 @@ pub enum TimingFunction<Integer, Number>
     Steps(Integer, #[css(skip_if = "is_end")] StepPosition),
     /// `frames(<integer>)`
     #[css(comma, function)]
     Frames(Integer),
 }
 
 #[allow(missing_docs)]
 #[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
-#[derive(Clone, Copy, Debug, Eq, MallocSizeOf, Parse, PartialEq,
-         SpecifiedValueInfo, ToComputedValue, ToCss)]
+#[derive(
+    Clone,
+    Copy,
+    Debug,
+    Eq,
+    MallocSizeOf,
+    Parse,
+    PartialEq,
+    SpecifiedValueInfo,
+    ToComputedValue,
+    ToCss,
+)]
 pub enum TimingKeyword {
     Linear,
     Ease,
     EaseIn,
     EaseOut,
     EaseInOut,
 }
 
@@ -158,18 +179,17 @@ impl TimingKeyword {
             TimingKeyword::Ease => (0.25, 0.1, 0.25, 1.),
             TimingKeyword::EaseIn => (0.42, 0., 1., 1.),
             TimingKeyword::EaseOut => (0., 0., 0.58, 1.),
             TimingKeyword::EaseInOut => (0.42, 0., 0.58, 1.),
         }
     }
 }
 
-#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo,
-         ToComputedValue, ToCss)]
+#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss)]
 /// A single operation in the list of a `transform` value
 pub enum TransformOperation<Angle, Number, Length, Integer, LengthOrPercentage> {
     /// Represents a 2D 2x3 matrix.
     Matrix(Matrix<Number>),
     /// Represents a 3D 4x4 matrix.
     Matrix3D(Matrix3D<Number>),
     /// A 2D skew.
     ///
@@ -263,34 +283,29 @@ pub enum TransformOperation<Angle, Numbe
     AccumulateMatrix {
         from_list:
             Transform<TransformOperation<Angle, Number, Length, Integer, LengthOrPercentage>>,
         to_list: Transform<TransformOperation<Angle, Number, Length, Integer, LengthOrPercentage>>,
         count: Integer,
     },
 }
 
-#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo,
-         ToComputedValue, ToCss)]
+#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss)]
 /// A value of the `transform` property
 pub struct Transform<T>(#[css(if_empty = "none", iterable)] pub Vec<T>);
 
 impl<Angle, Number, Length, Integer, LengthOrPercentage>
     TransformOperation<Angle, Number, Length, Integer, LengthOrPercentage>
 {
     /// Check if it is any rotate function.
     pub fn is_rotate(&self) -> bool {
         use self::TransformOperation::*;
         matches!(
             *self,
-            Rotate(..) |
-            Rotate3D(..) |
-            RotateX(..) |
-            RotateY(..) |
-            RotateZ(..)
+            Rotate(..) | Rotate3D(..) | RotateX(..) | RotateY(..) | RotateZ(..)
         )
     }
 
     /// Check if it is any translate function
     pub fn is_translate(&self) -> bool {
         use self::TransformOperation::*;
         match *self {
             Translate(..) | Translate3D(..) | TranslateX(..) | TranslateY(..) | TranslateZ(..) => {
@@ -569,64 +584,94 @@ pub fn get_normalized_vector_and_angle<T
         // rotation to not be applied, so we use identity matrix (i.e. rotate3d(0, 0, 1, 0)).
         (0., 0., 1., T::zero())
     } else {
         let vector = vector.robust_normalize();
         (vector.x, vector.y, vector.z, angle)
     }
 }
 
-#[derive(Clone, ComputeSquaredDistance, Copy, Debug, MallocSizeOf, PartialEq,
-         SpecifiedValueInfo, ToAnimatedZero, ToComputedValue, ToCss)]
+#[derive(
+    Clone,
+    ComputeSquaredDistance,
+    Copy,
+    Debug,
+    MallocSizeOf,
+    PartialEq,
+    SpecifiedValueInfo,
+    ToAnimatedZero,
+    ToComputedValue,
+    ToCss,
+)]
 /// A value of the `Rotate` property
 ///
 /// <https://drafts.csswg.org/css-transforms-2/#individual-transforms>
 pub enum Rotate<Number, Angle> {
     /// 'none'
     None,
     /// '<angle>'
     Rotate(Angle),
     /// '<number>{3} <angle>'
     Rotate3D(Number, Number, Number, Angle),
 }
 
-#[derive(Clone, ComputeSquaredDistance, Copy, Debug, MallocSizeOf, PartialEq,
-         SpecifiedValueInfo, ToAnimatedZero, ToComputedValue, ToCss)]
+#[derive(
+    Clone,
+    ComputeSquaredDistance,
+    Copy,
+    Debug,
+    MallocSizeOf,
+    PartialEq,
+    SpecifiedValueInfo,
+    ToAnimatedZero,
+    ToComputedValue,
+    ToCss,
+)]
 /// A value of the `Scale` property
 ///
 /// <https://drafts.csswg.org/css-transforms-2/#individual-transforms>
 pub enum Scale<Number> {
     /// 'none'
     None,
     /// '<number>'
     ScaleX(Number),
     /// '<number>{2}'
     Scale(Number, Number),
     /// '<number>{3}'
     Scale3D(Number, Number, Number),
 }
 
-#[derive(Clone, ComputeSquaredDistance, Debug, MallocSizeOf, PartialEq,
-         SpecifiedValueInfo, ToAnimatedZero, ToComputedValue, ToCss)]
+#[derive(
+    Clone,
+    ComputeSquaredDistance,
+    Debug,
+    MallocSizeOf,
+    PartialEq,
+    SpecifiedValueInfo,
+    ToAnimatedZero,
+    ToComputedValue,
+    ToCss,
+)]
 /// A value of the `Translate` property
 ///
 /// <https://drafts.csswg.org/css-transforms-2/#individual-transforms>
 pub enum Translate<LengthOrPercentage, Length> {
     /// 'none'
     None,
     /// '<length-percentage>'
     TranslateX(LengthOrPercentage),
     /// '<length-percentage> <length-percentage>'
     Translate(LengthOrPercentage, LengthOrPercentage),
     /// '<length-percentage> <length-percentage> <length>'
     Translate3D(LengthOrPercentage, LengthOrPercentage, Length),
 }
 
 #[allow(missing_docs)]
-#[derive(Clone, Copy, Debug, MallocSizeOf, Parse, PartialEq, SpecifiedValueInfo,
-         ToComputedValue, ToCss)]
+#[derive(
+    Clone, Copy, Debug, MallocSizeOf, Parse, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss,
+)]
 pub enum TransformStyle {
     #[cfg(feature = "servo")]
     Auto,
     Flat,
     #[css(keyword = "preserve-3d")]
     Preserve3d,
 }
--- a/servo/components/style/values/generics/ui.rs
+++ b/servo/components/style/values/generics/ui.rs
@@ -6,18 +6,17 @@
 
 use std::fmt::{self, Write};
 use style_traits::{CssWriter, ToCss};
 use style_traits::cursor::CursorKind;
 
 /// A generic value for the `cursor` property.
 ///
 /// https://drafts.csswg.org/css-ui/#cursor
-#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo,
-         ToComputedValue)]
+#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue)]
 pub struct Cursor<Image> {
     /// The parsed images for the cursor.
     pub images: Box<[Image]>,
     /// The kind of the cursor [default | help | ...].
     pub keyword: CursorKind,
 }
 
 impl<Image> Cursor<Image> {
@@ -40,18 +39,17 @@ impl<Image: ToCss> ToCss for Cursor<Imag
             image.to_css(dest)?;
             dest.write_str(", ")?;
         }
         self.keyword.to_css(dest)
     }
 }
 
 /// A generic value for item of `image cursors`.
-#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo,
-         ToComputedValue)]
+#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue)]
 pub struct CursorImage<ImageUrl, Number> {
     /// The url to parse images from.
     pub url: ImageUrl,
     /// The <x> and <y> coordinates.
     pub hotspot: Option<(Number, Number)>,
 }
 
 impl<ImageUrl: ToCss, Number: ToCss> ToCss for CursorImage<ImageUrl, Number> {
--- a/servo/components/style/values/generics/url.rs
+++ b/servo/components/style/values/generics/url.rs
@@ -4,19 +4,29 @@
 
 //! Generic types for url properties.
 
 use cssparser::Parser;
 use parser::{Parse, ParserContext};
 use style_traits::ParseError;
 
 /// An image url or none, used for example in list-style-image
-#[derive(Animate, Clone, ComputeSquaredDistance, Debug, MallocSizeOf, PartialEq,
-         SpecifiedValueInfo, ToAnimatedValue, ToAnimatedZero, ToComputedValue,
-         ToCss)]
+#[derive(
+    Animate,
+    Clone,
+    ComputeSquaredDistance,
+    Debug,
+    MallocSizeOf,
+    PartialEq,
+    SpecifiedValueInfo,
+    ToAnimatedValue,
+    ToAnimatedZero,
+    ToComputedValue,
+    ToCss,
+)]
 pub enum UrlOrNone<Url> {
     /// `none`
     None,
     /// `A URL`
     Url(Url),
 }
 
 impl<Url> UrlOrNone<Url> {
--- a/servo/components/style/values/mod.rs
+++ b/servo/components/style/values/mod.rs
@@ -87,18 +87,23 @@ pub fn serialize_percentage<W>(value: CS
 where
     W: Write,
 {
     (value * 100.).to_css(dest)?;
     dest.write_str("%")
 }
 
 /// Convenience void type to disable some properties and values through types.
-#[cfg_attr(feature = "servo", derive(Deserialize, MallocSizeOf, Serialize))]
-#[derive(Clone, Copy, Debug, PartialEq, SpecifiedValueInfo, ToAnimatedValue, ToComputedValue, ToCss)]
+#[cfg_attr(
+    feature = "servo",
+    derive(Deserialize, MallocSizeOf, Serialize)
+)]
+#[derive(
+    Clone, Copy, Debug, PartialEq, SpecifiedValueInfo, ToAnimatedValue, ToComputedValue, ToCss,
+)]
 pub enum Impossible {}
 
 // FIXME(nox): This should be derived but the derive code cannot cope
 // with uninhabited enums.
 impl ComputeSquaredDistance for Impossible {
     #[inline]
     fn compute_squared_distance(&self, _other: &Self) -> Result<SquaredDistance, ()> {
         match *self {}
@@ -110,19 +115,29 @@ impl Parse for Impossible {
         _context: &ParserContext,
         input: &mut Parser<'i, 't>,
     ) -> Result<Self, ParseError<'i>> {
         Err(input.new_custom_error(StyleParseErrorKind::UnspecifiedError))
     }
 }
 
 /// A struct representing one of two kinds of values.
-#[derive(Animate, Clone, ComputeSquaredDistance, Copy, MallocSizeOf, PartialEq,
-         SpecifiedValueInfo, ToAnimatedValue, ToAnimatedZero, ToComputedValue,
-         ToCss)]
+#[derive(
+    Animate,
+    Clone,
+    ComputeSquaredDistance,
+    Copy,
+    MallocSizeOf,
+    PartialEq,
+    SpecifiedValueInfo,
+    ToAnimatedValue,
+    ToAnimatedZero,
+    ToComputedValue,
+    ToCss,
+)]
 pub enum Either<A, B> {
     /// The first value.
     First(A),
     /// The second kind of value.
     Second(B),
 }
 
 impl<A: Debug, B: Debug> Debug for Either<A, B> {
@@ -143,33 +158,34 @@ impl<A: Parse, B: Parse> Parse for Eithe
             Ok(Either::First(v))
         } else {
             B::parse(context, input).map(Either::Second)
         }
     }
 }
 
 /// <https://drafts.csswg.org/css-values-4/#custom-idents>
-#[derive(Clone, Debug, Eq, Hash, MallocSizeOf, PartialEq, SpecifiedValueInfo,
-         ToComputedValue)]
+#[derive(Clone, Debug, Eq, Hash, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue)]
 pub struct CustomIdent(pub Atom);
 
 impl CustomIdent {
     /// Parse an already-tokenizer identifier
     pub fn from_ident<'i>(
         location: SourceLocation,
         ident: &CowRcStr<'i>,
         excluding: &[&str],
     ) -> Result<Self, ParseError<'i>> {
         let valid = match_ignore_ascii_case! { ident,
             "initial" | "inherit" | "unset" | "default" => false,
             _ => true
         };
         if !valid {
-            return Err(location.new_custom_error(SelectorParseErrorKind::UnexpectedIdent(ident.clone())));
+            return Err(
+                location.new_custom_error(SelectorParseErrorKind::UnexpectedIdent(ident.clone()))
+            );
         }
         if excluding.iter().any(|s| ident.eq_ignore_ascii_case(s)) {
             Err(location.new_custom_error(StyleParseErrorKind::UnspecifiedError))
         } else {
             Ok(CustomIdent(Atom::from(ident.as_ref())))
         }
     }
 }
--- a/servo/components/style/values/specified/align.rs
+++ b/servo/components/style/values/specified/align.rs
@@ -678,18 +678,23 @@ fn parse_self_position<'i, 't>(
         "self-end" => AlignFlags::SELF_END,
         "left" if axis == AxisDirection::Inline => AlignFlags::LEFT,
         "right" if axis == AxisDirection::Inline => AlignFlags::RIGHT,
     })
 }
 
 fn list_self_position_keywords(f: KeywordsCollectFn, axis: AxisDirection) {
     f(&[
-      "start", "end", "flex-start", "flex-end",
-      "center", "self-start", "self-end",
+        "start",
+        "end",
+        "flex-start",
+        "flex-end",
+        "center",
+        "self-start",
+        "self-end",
     ]);
     if axis == AxisDirection::Inline {
         f(&["left", "right"]);
     }
 }
 
 fn parse_left_right_center<'i, 't>(
     input: &mut Parser<'i, 't>,
--- a/servo/components/style/values/specified/background.rs
+++ b/servo/components/style/values/specified/background.rs
@@ -38,31 +38,40 @@ impl BackgroundSize {
         GenericBackgroundSize::Explicit {
             width: NonNegativeLengthOrPercentageOrAuto::auto(),
             height: NonNegativeLengthOrPercentageOrAuto::auto(),
         }
     }
 }
 
 /// One of the keywords for `background-repeat`.
-#[derive(Clone, Copy, Debug, Eq, MallocSizeOf, Parse, PartialEq,
-         SpecifiedValueInfo, ToComputedValue, ToCss)]
+#[derive(
+    Clone,
+    Copy,
+    Debug,
+    Eq,
+    MallocSizeOf,
+    Parse,
+    PartialEq,
+    SpecifiedValueInfo,
+    ToComputedValue,
+    ToCss,
+)]
 #[allow(missing_docs)]
 pub enum BackgroundRepeatKeyword {
     Repeat,
     Space,
     Round,
     NoRepeat,
 }
 
 /// The specified value for the `background-repeat` property.
 ///
 /// https://drafts.csswg.org/css-backgrounds/#the-background-repeat
-#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo,
-         ToCss)]
+#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToCss)]
 pub enum BackgroundRepeat {
     /// `repeat-x`
     RepeatX,
     /// `repeat-y`
     RepeatY,
     /// `[repeat | space | round | no-repeat]{1,2}`
     Keywords(BackgroundRepeatKeyword, Option<BackgroundRepeatKeyword>),
 }
@@ -86,16 +95,18 @@ impl Parse for BackgroundRepeat {
             "repeat-x" => return Ok(BackgroundRepeat::RepeatX),
             "repeat-y" => return Ok(BackgroundRepeat::RepeatY),
             _ => {},
         }
 
         let horizontal = match BackgroundRepeatKeyword::from_ident(&ident) {
             Ok(h) => h,
             Err(()) => {
-                return Err(input.new_custom_error(SelectorParseErrorKind::UnexpectedIdent(ident.clone())));
+                return Err(
+                    input.new_custom_error(SelectorParseErrorKind::UnexpectedIdent(ident.clone()))
+                );
             },
         };
 
         let vertical = input.try(BackgroundRepeatKeyword::parse).ok();
         Ok(BackgroundRepeat::Keywords(horizontal, vertical))
     }
 }
--- a/servo/components/style/values/specified/basic_shape.rs
+++ b/servo/components/style/values/specified/basic_shape.rs
@@ -263,18 +263,17 @@ impl Ellipse {
         input: &mut Parser<'i, 't>,
     ) -> Result<Self, ParseError<'i>> {
         let (a, b) = input
             .try(|i| -> Result<_, ParseError> {
                 Ok((
                     ShapeRadius::parse(context, i)?,
                     ShapeRadius::parse(context, i)?,
                 ))
-            })
-            .unwrap_or_default();
+            }).unwrap_or_default();
         let position = if input.try(|i| i.expect_ident_matching("at")).is_ok() {
             Position::parse(context, input)?
         } else {
             Position::center()
         };
 
         Ok(generic::Ellipse {
             semiaxis_x: a,
@@ -411,18 +410,17 @@ impl Polygon {
         context: &ParserContext,
         input: &mut Parser<'i, 't>,
     ) -> Result<Self, ParseError<'i>> {
         let fill = input
             .try(|i| -> Result<_, ParseError> {
                 let fill = FillRule::parse(i)?;
                 i.expect_comma()?; // only eat the comma if there is something before it
                 Ok(fill)
-            })
-            .unwrap_or_default();
+            }).unwrap_or_default();
 
         let buf = input.parse_comma_separated(|i| {
             Ok(PolygonCoord(
                 LengthOrPercentage::parse(context, i)?,
                 LengthOrPercentage::parse(context, i)?,
             ))
         })?;
 
@@ -444,17 +442,18 @@ impl Parse for Path {
 }
 
 impl Path {
     /// Parse the inner arguments of a `path` function.
     fn parse_function_arguments<'i, 't>(
         context: &ParserContext,
         input: &mut Parser<'i, 't>,
     ) -> Result<Self, ParseError<'i>> {
-        let fill = input.try(|i| -> Result<_, ParseError> {
-            let fill = FillRule::parse(i)?;
-            i.expect_comma()?;
-            Ok(fill)
-        }).unwrap_or_default();
+        let fill = input
+            .try(|i| -> Result<_, ParseError> {
+                let fill = FillRule::parse(i)?;
+                i.expect_comma()?;
+                Ok(fill)
+            }).unwrap_or_default();
         let path = SVGPathData::parse(context, input)?;
         Ok(Path { fill, path })
     }
 }
--- a/servo/components/style/values/specified/border.rs
+++ b/servo/components/style/values/specified/border.rs
@@ -184,30 +184,28 @@ impl Parse for BorderSpacing {
             Length::parse_non_negative_quirky(context, input, AllowQuirks::Yes).map(From::from)
         }).map(GenericBorderSpacing)
     }
 }
 
 /// A single border-image-repeat keyword.
 #[allow(missing_docs)]
 #[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
-#[derive(Clone, Copy, Debug, Eq, MallocSizeOf, Parse, PartialEq,
-         SpecifiedValueInfo, ToCss)]
+#[derive(Clone, Copy, Debug, Eq, MallocSizeOf, Parse, PartialEq, SpecifiedValueInfo, ToCss)]
 pub enum BorderImageRepeatKeyword {
     Stretch,
     Repeat,
     Round,
     Space,
 }
 
 /// The specified value for the `border-image-repeat` property.
 ///
 /// https://drafts.csswg.org/css-backgrounds/#the-border-image-repeat
-#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo,
-         ToComputedValue)]
+#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue)]
 pub struct BorderImageRepeat(pub BorderImageRepeatKeyword, pub BorderImageRepeatKeyword);
 
 impl ToCss for BorderImageRepeat {
     fn to_css<W>(&self, dest: &mut CssWriter<W>) -> fmt::Result
     where
         W: Write,
     {
         self.0.to_css(dest)?;
--- a/servo/components/style/values/specified/box.rs
+++ b/servo/components/style/values/specified/box.rs
@@ -16,54 +16,63 @@ use values::{CustomIdent, KeyframesName}
 use values::generics::box_::AnimationIterationCount as GenericAnimationIterationCount;
 use values::generics::box_::Perspective as GenericPerspective;
 use values::generics::box_::VerticalAlign as GenericVerticalAlign;
 use values::specified::{AllowQuirks, Number};
 use values::specified::length::{LengthOrPercentage, NonNegativeLength};
 
 fn in_ua_or_chrome_sheet(context: &ParserContext) -> bool {
     use stylesheets::Origin;
-    context.stylesheet_origin == Origin::UserAgent ||
-    context.chrome_rules_enabled()
+    context.stylesheet_origin == Origin::UserAgent || context.chrome_rules_enabled()
 }
 
 #[cfg(feature = "gecko")]
 fn moz_display_values_enabled(context: &ParserContext) -> bool {
     use gecko_bindings::structs;
     in_ua_or_chrome_sheet(context) ||
-    unsafe {
-        structs::StaticPrefs_sVarCache_layout_css_xul_display_values_content_enabled
-    }
+        unsafe { structs::StaticPrefs_sVarCache_layout_css_xul_display_values_content_enabled }
 }
 
 #[cfg(feature = "gecko")]
 fn moz_box_display_values_enabled(context: &ParserContext) -> bool {
     use gecko_bindings::structs;
     in_ua_or_chrome_sheet(context) ||
-    unsafe {
-        structs::StaticPrefs_sVarCache_layout_css_xul_box_display_values_content_enabled
-    }
+        unsafe {
+            structs::StaticPrefs_sVarCache_layout_css_xul_box_display_values_content_enabled
+        }
 }
 
 /// Defines an element’s display type, which consists of
 /// the two basic qualities of how an element generates boxes
 /// <https://drafts.csswg.org/css-display/#propdef-display>
 ///
 ///
 /// NOTE(emilio): Order is important in Gecko!
 ///
 /// If you change it, make sure to take a look at the
 /// FrameConstructionDataByDisplay stuff (both the XUL and non-XUL version), and
 /// ensure it's still correct!
 ///
 /// Also, when you change this from Gecko you may need to regenerate the
 /// C++-side bindings (see components/style/cbindgen.toml).
 #[allow(missing_docs)]
-#[derive(Clone, Copy, Debug, Eq, FromPrimitive, Hash, MallocSizeOf, Parse,
-         PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss)]
+#[derive(
+    Clone,
+    Copy,
+    Debug,
+    Eq,
+    FromPrimitive,
+    Hash,
+    MallocSizeOf,
+    Parse,
+    PartialEq,
+    SpecifiedValueInfo,
+    ToComputedValue,
+    ToCss,
+)]
 #[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
 #[repr(u8)]
 pub enum Display {
     None = 0,
     Block,
     #[cfg(feature = "gecko")]
     FlowRoot,
     Inline,
@@ -195,17 +204,20 @@ impl Display {
     }
 
     /// Returns whether this "display" value is one of the types for
     /// ruby.
     #[cfg(feature = "gecko")]
     pub fn is_ruby_type(&self) -> bool {
         matches!(
             *self,
-            Display::Ruby | Display::RubyBase | Display::RubyText | Display::RubyBaseContainer |
+            Display::Ruby |
+                Display::RubyBase |
+                Display::RubyText |
+                Display::RubyBaseContainer |
                 Display::RubyTextContainer
         )
     }
 
     /// Returns whether this "display" value is a ruby level container.
     #[cfg(feature = "gecko")]
     pub fn is_ruby_level_container(&self) -> bool {
         matches!(
@@ -341,18 +353,17 @@ impl AnimationIterationCount {
     /// Returns the value `1.0`.
     #[inline]
     pub fn one() -> Self {
         GenericAnimationIterationCount::Number(Number::new(1.0))
     }
 }
 
 /// A value for the `animation-name` property.
-#[derive(Clone, Debug, Eq, Hash, MallocSizeOf, PartialEq, SpecifiedValueInfo,
-         ToComputedValue)]
+#[derive(Clone, Debug, Eq, Hash, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue)]
 #[value_info(other_values = "none")]
 pub struct AnimationName(pub Option<KeyframesName>);
 
 impl AnimationName {
     /// Get the name of the animation as an `Atom`.
     pub fn as_atom(&self) -> Option<&Atom> {
         self.0.as_ref().map(|n| n.as_atom())
     }
@@ -386,45 +397,74 @@ impl Parse for AnimationName {
 
         input.expect_ident_matching("none")?;
         Ok(AnimationName(None))
     }
 }
 
 #[allow(missing_docs)]
 #[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
-#[derive(Clone, Copy, Debug, Eq, MallocSizeOf, Parse, PartialEq,
-         SpecifiedValueInfo, ToComputedValue, ToCss)]
+#[derive(
+    Clone,
+    Copy,
+    Debug,
+    Eq,
+    MallocSizeOf,
+    Parse,
+    PartialEq,
+    SpecifiedValueInfo,
+    ToComputedValue,
+    ToCss,
+)]
 pub enum ScrollSnapType {
     None,
     Mandatory,
     Proximity,
 }
 
 #[allow(missing_docs)]
 #[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
-#[derive(Clone, Copy, Debug, Eq, MallocSizeOf, Parse, PartialEq,
-         SpecifiedValueInfo, ToComputedValue, ToCss)]
+#[derive(
+    Clone,
+    Copy,
+    Debug,
+    Eq,
+    MallocSizeOf,
+    Parse,
+    PartialEq,
+    SpecifiedValueInfo,
+    ToComputedValue,
+    ToCss,
+)]
 pub enum OverscrollBehavior {
     Auto,
     Contain,
     None,
 }
 
 #[allow(missing_docs)]
 #[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
-#[derive(Clone, Copy, Debug, Eq, MallocSizeOf, Parse, PartialEq,
-         SpecifiedValueInfo, ToComputedValue, ToCss)]
+#[derive(
+    Clone,
+    Copy,
+    Debug,
+    Eq,
+    MallocSizeOf,
+    Parse,
+    PartialEq,
+    SpecifiedValueInfo,
+    ToComputedValue,
+    ToCss,
+)]
 pub enum OverflowClipBox {
     PaddingBox,
     ContentBox,
 }
 
-#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo,
-         ToComputedValue, ToCss)]
+#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss)]
 /// Provides a rendering hint to the user agent,
 /// stating what kinds of changes the author expects
 /// to perform on the element
 ///
 /// <https://drafts.csswg.org/css-will-change/#will-change>
 pub enum WillChange {
     /// Expresses no particular intent
     Auto,
@@ -492,21 +532,21 @@ fn change_bits_for_longhand(longhand: Lo
 
 fn change_bits_for_maybe_property(ident: &str, context: &ParserContext) -> WillChangeBits {
     let id = match PropertyId::parse_ignoring_rule_type(ident, context) {
         Ok(id) => id,
         Err(..) => return WillChangeBits::empty(),
     };
 
     match id.as_shorthand() {
-        Ok(shorthand) => {
-            shorthand.longhands().fold(WillChangeBits::empty(), |flags, p| {
+        Ok(shorthand) => shorthand
+            .longhands()
+            .fold(WillChangeBits::empty(), |flags, p| {
                 flags | change_bits_for_longhand(p)
-            })
-        }
+            }),
         Err(PropertyDeclarationId::Longhand(longhand)) => change_bits_for_longhand(longhand),
         Err(PropertyDeclarationId::Custom(..)) => WillChangeBits::empty(),
     }
 }
 
 impl Parse for WillChange {
     /// auto | <animateable-feature>#
     fn parse<'i, 't>(
@@ -576,19 +616,18 @@ impl ToCss for TouchAction {
     fn to_css<W>(&self, dest: &mut CssWriter<W>) -> fmt::Result
     where
         W: Write,
     {
         match *self {
             TouchAction::TOUCH_ACTION_NONE => dest.write_str("none"),
             TouchAction::TOUCH_ACTION_AUTO => dest.write_str("auto"),
             TouchAction::TOUCH_ACTION_MANIPULATION => dest.write_str("manipulation"),
-            _ if self.contains(
-                TouchAction::TOUCH_ACTION_PAN_X | TouchAction::TOUCH_ACTION_PAN_Y,
-            ) =>
+            _ if self
+                .contains(TouchAction::TOUCH_ACTION_PAN_X | TouchAction::TOUCH_ACTION_PAN_Y) =>
             {
                 dest.write_str("pan-x pan-y")
             },
             _ if self.contains(TouchAction::TOUCH_ACTION_PAN_X) => dest.write_str("pan-x"),
             _ if self.contains(TouchAction::TOUCH_ACTION_PAN_Y) => dest.write_str("pan-y"),
             _ => panic!("invalid touch-action value"),
         }
     }
@@ -751,18 +790,17 @@ impl Parse for Perspective {
     fn parse<'i, 't>(
         context: &ParserContext,
         input: &mut Parser<'i, 't>,
     ) -> Result<Self, ParseError<'i>> {
         if input.try(|i| i.expect_ident_matching("none")).is_ok() {
             return Ok(GenericPerspective::None);
         }
         Ok(GenericPerspective::Length(NonNegativeLength::parse(
-            context,
-            input,
+            context, input,
         )?))
     }
 }
 
 /// A given transition property, that is either `All`, a longhand or shorthand
 /// property, or an unsupported or custom property.
 #[derive(Clone, Debug, Eq, Hash, MallocSizeOf, PartialEq, ToComputedValue)]
 pub enum TransitionProperty {
@@ -784,47 +822,47 @@ impl ToCss for TransitionProperty {
     {
         use values::serialize_atom_name;
         match *self {
             TransitionProperty::Shorthand(ref s) => s.to_css(dest),
             TransitionProperty::Longhand(ref l) => l.to_css(dest),
             TransitionProperty::Custom(ref name) => {
                 dest.write_str("--")?;
                 serialize_atom_name(name, dest)
-            }
+            },
             TransitionProperty::Unsupported(ref i) => i.to_css(dest),
         }
     }
 }
 
 impl Parse for TransitionProperty {
     fn parse<'i, 't>(
         context: &ParserContext,
         input: &mut Parser<'i, 't>,
     ) -> Result<Self, ParseError<'i>> {
         let location = input.current_source_location();
         let ident = input.expect_ident()?;
 
         let id = match PropertyId::parse_ignoring_rule_type(&ident, context) {
             Ok(id) => id,
-            Err(..) => return Ok(TransitionProperty::Unsupported(
-                CustomIdent::from_ident(location, ident, &["none"])?,
-            )),
+            Err(..) => {
+                return Ok(TransitionProperty::Unsupported(CustomIdent::from_ident(
+                    location,
+                    ident,
+                    &["none"],
+                )?))
+            },
         };
 
         Ok(match id.as_shorthand() {
             Ok(s) => TransitionProperty::Shorthand(s),
-            Err(longhand_or_custom) => {
-                match longhand_or_custom {
-                    PropertyDeclarationId::Longhand(id) => TransitionProperty::Longhand(id),
-                    PropertyDeclarationId::Custom(custom) => {
-                        TransitionProperty::Custom(custom.clone())
-                    }
-                }
-            }
+            Err(longhand_or_custom) => match longhand_or_custom {
+                PropertyDeclarationId::Longhand(id) => TransitionProperty::Longhand(id),
+                PropertyDeclarationId::Custom(custom) => TransitionProperty::Custom(custom.clone()),
+            },
         })
     }
 }
 
 impl SpecifiedValueInfo for TransitionProperty {
     fn collect_completion_keywords(f: KeywordsCollectFn) {
         // `transition-property` can actually accept all properties and
         // arbitrary identifiers, but `all` is a special one we'd like
@@ -841,59 +879,61 @@ impl TransitionProperty {
     }
 
     /// Convert TransitionProperty to nsCSSPropertyID.
     #[cfg(feature = "gecko")]
     pub fn to_nscsspropertyid(&self) -> Result<::gecko_bindings::structs::nsCSSPropertyID, ()> {
         Ok(match *self {
             TransitionProperty::Shorthand(ShorthandId::All) => {
                 ::gecko_bindings::structs::nsCSSPropertyID::eCSSPropertyExtra_all_properties
-            }
+            },
             TransitionProperty::Shorthand(ref id) => id.to_nscsspropertyid(),
             TransitionProperty::Longhand(ref id) => id.to_nscsspropertyid(),
-            TransitionProperty::Custom(..) |
-            TransitionProperty::Unsupported(..) => return Err(()),
+            TransitionProperty::Custom(..) | TransitionProperty::Unsupported(..) => return Err(()),
         })
     }
 }
 
 #[allow(missing_docs)]
 #[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
-#[derive(Clone, Copy, Debug, Eq, Hash, MallocSizeOf, Parse, PartialEq,
-         SpecifiedValueInfo, ToCss)]
+#[derive(
+    Clone, Copy, Debug, Eq, Hash, MallocSizeOf, Parse, PartialEq, SpecifiedValueInfo, ToCss,
+)]
 /// https://drafts.csswg.org/css-box/#propdef-float
 pub enum Float {
     Left,
     Right,
     None,
     // https://drafts.csswg.org/css-logical-props/#float-clear
     InlineStart,
-    InlineEnd
+    InlineEnd,
 }
 
 #[allow(missing_docs)]
 #[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
-#[derive(Clone, Copy, Debug, Eq, Hash, MallocSizeOf, Parse, PartialEq,
-         SpecifiedValueInfo, ToCss)]
+#[derive(
+    Clone, Copy, Debug, Eq, Hash, MallocSizeOf, Parse, PartialEq, SpecifiedValueInfo, ToCss,
+)]
 /// https://drafts.csswg.org/css-box/#propdef-clear
 pub enum Clear {
     None,
     Left,
     Right,
     Both,
     // https://drafts.csswg.org/css-logical-props/#float-clear
     InlineStart,
-    InlineEnd
+    InlineEnd,
 }
 
 /// https://drafts.csswg.org/css-ui/#propdef-resize
 #[allow(missing_docs)]
 #[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
-#[derive(Clone, Copy, Debug, Eq, Hash, MallocSizeOf, Parse, PartialEq,
-         SpecifiedValueInfo, ToCss)]
+#[derive(
+    Clone, Copy, Debug, Eq, Hash, MallocSizeOf, Parse, PartialEq, SpecifiedValueInfo, ToCss,
+)]
 pub enum Resize {
     None,
     Both,
     Horizontal,
     Vertical,
     // https://drafts.csswg.org/css-logical-1/#resize
     Inline,
     Block,
@@ -901,18 +941,29 @@ pub enum Resize {
 
 /// The value for the `appearance` property.
 ///
 /// https://developer.mozilla.org/en-US/docs/Web/CSS/-moz-appearance
 ///
 /// NOTE(emilio): When changing this you may want to regenerate the C++ bindings
 /// (see components/style/cbindgen.toml)
 #[allow(missing_docs)]
-#[derive(Clone, Copy, Debug, Eq, Hash, MallocSizeOf, Parse, PartialEq,
-         SpecifiedValueInfo, ToCss, ToComputedValue)]
+#[derive(
+    Clone,
+    Copy,
+    Debug,
+    Eq,
+    Hash,
+    MallocSizeOf,
+    Parse,
+    PartialEq,
+    SpecifiedValueInfo,
+    ToCss,
+    ToComputedValue,
+)]
 #[repr(u8)]
 pub enum Appearance {
     /// No appearance at all.
     None,
     /// A typical dialog button.
     Button,
     /// Various arrows that go in buttons
     ButtonArrowDown,
--- a/servo/components/style/values/specified/color.rs
+++ b/servo/components/style/values/specified/color.rs
@@ -84,21 +84,21 @@ impl<'a, 'b: 'a, 'i: 'a> ::cssparser::Co
                 let angle = Angle::parse_dimension(value, unit, /* from_calc = */ false);
 
                 let degrees = match angle {
                     Ok(angle) => angle.degrees(),
                     Err(()) => return Err(location.new_unexpected_token_error(token.clone())),
                 };
 
                 Ok(AngleOrNumber::Angle { degrees })
-            }
+            },
             Token::Number { value, .. } => Ok(AngleOrNumber::Number { value }),
             Token::Function(ref name) if name.eq_ignore_ascii_case("calc") => {
                 input.parse_nested_block(|i| CalcNode::parse_angle_or_number(self.0, i))
-            }
+            },
             t => return Err(location.new_unexpected_token_error(t)),
         }
     }
 
     fn parse_percentage<'t>(&self, input: &mut Parser<'i, 't>) -> Result<f32, ParseError<'i>> {
         use values::specified::Percentage;
 
         Ok(Percentage::parse(self.0, input)?.get())
@@ -115,20 +115,20 @@ impl<'a, 'b: 'a, 'i: 'a> ::cssparser::Co
         input: &mut Parser<'i, 't>,
     ) -> Result<NumberOrPercentage, ParseError<'i>> {
         let location = input.current_source_location();
 
         match input.next()?.clone() {
             Token::Number { value, .. } => Ok(NumberOrPercentage::Number { value }),
             Token::Percentage { unit_value, .. } => {
                 Ok(NumberOrPercentage::Percentage { unit_value })
-            }
+            },
             Token::Function(ref name) if name.eq_ignore_ascii_case("calc") => {
                 input.parse_nested_block(|i| CalcNode::parse_number_or_percentage(self.0, i))
-            }
+            },
             t => return Err(location.new_unexpected_token_error(t)),
         }
     }
 }
 
 impl Parse for Color {
     fn parse<'i, 't>(
         context: &ParserContext,
@@ -164,20 +164,20 @@ impl Parse for Color {
                     }
                 }
 
                 match e.kind {
                     ParseErrorKind::Basic(BasicParseErrorKind::UnexpectedToken(t)) => {
                         Err(e.location.new_custom_error(StyleParseErrorKind::ValueError(
                             ValueParseErrorKind::InvalidColor(t),
                         )))
-                    }
+                    },
                     _ => Err(e),
                 }
-            }
+            },
         }
     }
 }
 
 impl ToCss for Color {
     fn to_css<W>(&self, dest: &mut CssWriter<W>) -> fmt::Result
     where
         W: Write,
@@ -271,20 +271,20 @@ impl Color {
                 ..
             } => (integer, Some(unit)),
             Token::Ident(ref ident) => {
                 if ident.len() != 3 && ident.len() != 6 {
                     return Err(location.new_custom_error(StyleParseErrorKind::UnspecifiedError));
                 }
                 return parse_hash_color(ident.as_bytes())
                     .map_err(|()| location.new_custom_error(StyleParseErrorKind::UnspecifiedError));
-            }
+            },
             ref t => {
                 return Err(location.new_unexpected_token_error(t.clone()));
-            }
+            },
         };
         if value < 0 {
             return Err(location.new_custom_error(StyleParseErrorKind::UnspecifiedError));
         }
         let length = if value <= 9 {
             1
         } else if value <= 99 {
             2
@@ -354,21 +354,21 @@ impl Color {
                     convert_nscolor_to_computedcolor(match special {
                         Keyword::MozDefaultColor => pres_context.mDefaultColor,
                         Keyword::MozDefaultBackgroundColor => pres_context.mBackgroundColor,
                         Keyword::MozHyperlinktext => pres_context.mLinkColor,
                         Keyword::MozActivehyperlinktext => pres_context.mActiveLinkColor,
                         Keyword::MozVisitedhyperlinktext => pres_context.mVisitedLinkColor,
                     })
                 })
-            }
+            },
             #[cfg(feature = "gecko")]
             Color::InheritFromBodyQuirk => {
                 _context.map(|context| ComputedColor::rgba(context.device().body_text_color()))
-            }
+            },
         }
     }
 }
 
 impl ToComputedValue for Color {
     type ComputedValue = ComputedColor;
 
     fn to_computed_value(&self, context: &Context) -> ComputedColor {
--- a/servo/components/style/values/specified/column.rs
+++ b/servo/components/style/values/specified/column.rs
@@ -17,13 +17,12 @@ impl Parse for ColumnCount {
     fn parse<'i, 't>(
         context: &ParserContext,
         input: &mut Parser<'i, 't>,
     ) -> Result<Self, ParseError<'i>> {
         if input.try(|i| i.expect_ident_matching("auto")).is_ok() {
             return Ok(GenericColumnCount::Auto);
         }
         Ok(GenericColumnCount::Integer(PositiveInteger::parse(
-            context,
-            input,
+            context, input,
         )?))
     }
 }
--- a/servo/components/style/values/specified/counters.rs
+++ b/servo/components/style/values/specified/counters.rs
@@ -88,28 +88,26 @@ pub type ContentItem = generics::Content
 
 impl Content {
     #[cfg(feature = "servo")]
     fn parse_counter_style(_: &ParserContext, input: &mut Parser) -> ListStyleType {
         input
             .try(|input| {
                 input.expect_comma()?;
                 ListStyleType::parse(input)
-            })
-            .unwrap_or(ListStyleType::Decimal)
+            }).unwrap_or(ListStyleType::Decimal)
     }
 
     #[cfg(feature = "gecko")]
     fn parse_counter_style(context: &ParserContext, input: &mut Parser) -> CounterStyleOrNone {
         input
             .try(|input| {
                 input.expect_comma()?;
                 CounterStyleOrNone::parse(context, input)
-            })
-            .unwrap_or(CounterStyleOrNone::decimal())
+            }).unwrap_or(CounterStyleOrNone::decimal())
     }
 }
 
 impl Parse for Content {
     // normal | none | [ <string> | <counter> | open-quote | close-quote | no-open-quote |
     // no-close-quote ]+
     // TODO: <uri>, attr(<identifier>)
     fn parse<'i, 't>(
--- a/servo/components/style/values/specified/effects.rs
+++ b/servo/components/style/values/specified/effects.rs
@@ -113,19 +113,19 @@ impl Parse for BoxShadow {
                     inset = true;
                     continue;
                 }
             }
             if lengths.is_none() {
                 let value = input.try::<_, _, ParseError>(|i| {
                     let horizontal = Length::parse(context, i)?;
                     let vertical = Length::parse(context, i)?;
-                    let (blur, spread) = match i.try::<_, _, ParseError>(|i| {
-                        Length::parse_non_negative(context, i)
-                    }) {
+                    let (blur, spread) = match i
+                        .try::<_, _, ParseError>(|i| Length::parse_non_negative(context, i))
+                    {
                         Ok(blur) => {
                             let spread = i.try(|i| Length::parse(context, i)).ok();
                             (Some(blur.into()), spread)
                         },
                         Err(_) => (None, None),
                     };
                     Ok((horizontal, vertical, blur, spread))
                 });
@@ -138,17 +138,18 @@ impl Parse for BoxShadow {
                 if let Ok(value) = input.try(|i| Color::parse(context, i)) {
                     color = Some(value);
                     continue;
                 }
             }
             break;
         }
 
-        let lengths = lengths.ok_or(input.new_custom_error(StyleParseErrorKind::UnspecifiedError))?;
+        let lengths =
+            lengths.ok_or(input.new_custom_error(StyleParseErrorKind::UnspecifiedError))?;
         Ok(BoxShadow {
             base: SimpleShadow {
                 color: color,
                 horizontal: lengths.0,
                 vertical: lengths.1,
                 blur: lengths.2,
             },
             spread: lengths.3,
@@ -159,17 +160,18 @@ impl Parse for BoxShadow {
 
 impl ToComputedValue for BoxShadow {
     type ComputedValue = ComputedBoxShadow;
 
     #[inline]
     fn to_computed_value(&self, context: &Context) -> Self::ComputedValue {
         ComputedBoxShadow {
             base: self.base.to_computed_value(context),
-            spread: self.spread
+            spread: self
+                .spread
                 .as_ref()
                 .unwrap_or(&Length::zero())
                 .to_computed_value(context),
             inset: self.inset,
         }
     }
 
     #[inline]
@@ -266,23 +268,25 @@ impl Parse for SimpleShadow {
 }
 
 impl ToComputedValue for SimpleShadow {
     type ComputedValue = ComputedSimpleShadow;
 
     #[inline]
     fn to_computed_value(&self, context: &Context) -> Self::ComputedValue {
         ComputedSimpleShadow {
-            color: self.color
+            color: self
+                .color
                 .as_ref()
                 .unwrap_or(&Color::currentcolor())
                 .to_computed_value(context),
             horizontal: self.horizontal.to_computed_value(context),
             vertical: self.vertical.to_computed_value(context),
-            blur: self.blur
+            blur: self
+                .blur
                 .as_ref()
                 .unwrap_or(&NonNegativeLength::zero())
                 .to_computed_value(context),
         }
     }
 
     #[inline]
     fn from_computed_value(computed: &Self::ComputedValue) -> Self {
--- a/servo/components/style/values/specified/font.rs
+++ b/servo/components/style/values/specified/font.rs
@@ -143,19 +143,19 @@ impl ToComputedValue for FontWeight {
                 .clone_font_weight()
                 .lighter(),
             FontWeight::System(_) => self.compute_system(context),
         }