Bug 1508026 - Fix formatting.
authorEmilio Cobos Álvarez <emilio@crisal.io>
Sat, 17 Nov 2018 09:48:01 +0100
changeset 503344 8abb8992a558885e973d5c308c11fd7a9e6ed7bb
parent 503343 896d672ed0abaece6317543d2d14783044c2709a
child 503345 c23d6003a3c3a37f523437afedc7e2914c9e194a
push id10290
push userffxbld-merge
push dateMon, 03 Dec 2018 16:23:23 +0000
treeherdermozilla-beta@700bed2445e6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1508026
milestone65.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 1508026 - Fix formatting.
servo/components/style/custom_properties.rs
servo/components/style/media_queries/media_feature_expression.rs
servo/components/style/values/computed/box.rs
servo/components/style/values/computed/mod.rs
servo/components/style/values/specified/basic_shape.rs
servo/components/style/values/specified/mod.rs
servo/components/style/values/specified/transform.rs
--- a/servo/components/style/custom_properties.rs
+++ b/servo/components/style/custom_properties.rs
@@ -330,17 +330,18 @@ impl VariableValue {
 
     /// Parse a custom property value.
     pub fn parse<'i, 't>(input: &mut Parser<'i, 't>) -> Result<Arc<Self>, ParseError<'i>> {
         let mut references = VarOrEnvReferences::default();
 
         let (first_token_type, css, last_token_type) =
             parse_self_contained_declaration_value(input, Some(&mut references))?;
 
-        let custom_property_references = references.custom_property_references
+        let custom_property_references = references
+            .custom_property_references
             .into_iter()
             .collect::<Vec<_>>()
             .into_boxed_slice();
 
         Ok(Arc::new(VariableValue {
             css: css.into_owned(),
             first_token_type,
             last_token_type,
--- a/servo/components/style/media_queries/media_feature_expression.rs
+++ b/servo/components/style/media_queries/media_feature_expression.rs
@@ -320,17 +320,21 @@ impl MediaFeatureExpression {
                 } else if starts_with_ignore_ascii_case(feature_name, "max-") {
                     feature_name = &feature_name[4..];
                     Some(Range::Max)
                 } else {
                     None
                 };
 
                 let atom = Atom::from(string_as_ascii_lowercase(feature_name));
-                match MEDIA_FEATURES.iter().enumerate().find(|(_, f)| f.name == atom) {
+                match MEDIA_FEATURES
+                    .iter()
+                    .enumerate()
+                    .find(|(_, f)| f.name == atom)
+                {
                     Some((i, f)) => Ok((i, f, range)),
                     None => Err(()),
                 }
             };
 
             match result {
                 Ok((i, f, r)) => {
                     feature_index = i;
--- a/servo/components/style/values/computed/box.rs
+++ b/servo/components/style/values/computed/box.rs
@@ -7,18 +7,18 @@
 use crate::values::computed::length::{LengthOrPercentage, NonNegativeLength};
 use crate::values::computed::{Context, Number, ToComputedValue};
 use crate::values::generics::box_::AnimationIterationCount as GenericAnimationIterationCount;
 use crate::values::generics::box_::Perspective as GenericPerspective;
 use crate::values::generics::box_::VerticalAlign as GenericVerticalAlign;
 use crate::values::specified::box_ as specified;
 
 pub use crate::values::specified::box_::{AnimationName, Appearance, BreakBetween, BreakWithin};
+pub use crate::values::specified::box_::{Clear as SpecifiedClear, Float as SpecifiedFloat};
 pub use crate::values::specified::box_::{Contain, Display, OverflowClipBox};
-pub use crate::values::specified::box_::{Clear as SpecifiedClear, Float as SpecifiedFloat};
 pub use crate::values::specified::box_::{OverscrollBehavior, ScrollSnapType};
 pub use crate::values::specified::box_::{TouchAction, TransitionProperty, WillChange};
 
 /// A computed value for the `vertical-align` property.
 pub type VerticalAlign = GenericVerticalAlign<LengthOrPercentage>;
 
 /// A computed value for the `animation-iteration-count` property.
 pub type AnimationIterationCount = GenericAnimationIterationCount<Number>;
--- a/servo/components/style/values/computed/mod.rs
+++ b/servo/components/style/values/computed/mod.rs
@@ -1,14 +1,15 @@
 /* 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/. */
 
 //! Computed values.
 
+use self::transform::DirectionVector;
 use super::animated::ToAnimatedValue;
 use super::generics::grid::GridTemplateComponent as GenericGridTemplateComponent;
 use super::generics::grid::{GridLine as GenericGridLine, TrackBreadth as GenericTrackBreadth};
 use super::generics::grid::{TrackList as GenericTrackList, TrackSize as GenericTrackSize};
 use super::generics::transform::IsParallelTo;
 use super::generics::{GreaterThanOrEqualToOne, NonNegative};
 use super::specified;
 use super::{CSSFloat, CSSInteger};
@@ -18,17 +19,16 @@ use crate::media_queries::Device;
 #[cfg(feature = "gecko")]
 use crate::properties;
 use crate::properties::{ComputedValues, LonghandId, StyleBuilder};
 use crate::rule_cache::RuleCacheConditions;
 use crate::Atom;
 #[cfg(feature = "servo")]
 use crate::Prefix;
 use euclid::Size2D;
-use self::transform::DirectionVector;
 use std::cell::RefCell;
 use std::cmp;
 use std::f32;
 use std::fmt::{self, Write};
 use style_traits::cursor::CursorKind;
 use style_traits::{CssWriter, ToCss};
 
 #[cfg(feature = "gecko")]
@@ -462,17 +462,20 @@ trivial_to_computed_value!(Box<str>);
 pub type Number = CSSFloat;
 
 impl IsParallelTo for (Number, Number, Number) {
     fn is_parallel_to(&self, vector: &DirectionVector) -> bool {
         use euclid::approxeq::ApproxEq;
         // If a and b is parallel, the angle between them is 0deg, so
         // a x b = |a|*|b|*sin(0)*n = 0 * n, |a x b| == 0.
         let self_vector = DirectionVector::new(self.0, self.1, self.2);
-        self_vector.cross(*vector).square_length().approx_eq(&0.0f32)
+        self_vector
+            .cross(*vector)
+            .square_length()
+            .approx_eq(&0.0f32)
     }
 }
 
 /// A wrapper of Number, but the value >= 0.
 pub type NonNegativeNumber = NonNegative<CSSFloat>;
 
 impl ToAnimatedValue for NonNegativeNumber {
     type AnimatedValue = CSSFloat;
--- a/servo/components/style/values/specified/basic_shape.rs
+++ b/servo/components/style/values/specified/basic_shape.rs
@@ -9,17 +9,17 @@
 
 use crate::parser::{Parse, ParserContext};
 use crate::values::generics::basic_shape as generic;
 use crate::values::generics::basic_shape::{GeometryBox, Path, PolygonCoord};
 use crate::values::generics::basic_shape::{ShapeBox, ShapeSource};
 use crate::values::generics::rect::Rect;
 use crate::values::specified::border::BorderRadius;
 use crate::values::specified::image::Image;
-use crate::values::specified::position::{HorizontalPosition, VerticalPosition, Position};
+use crate::values::specified::position::{HorizontalPosition, Position, VerticalPosition};
 use crate::values::specified::url::SpecifiedUrl;
 use crate::values::specified::LengthOrPercentage;
 use crate::values::specified::SVGPathData;
 use cssparser::Parser;
 use std::fmt::{self, Write};
 use style_traits::{CssWriter, ParseError, StyleParseErrorKind, ToCss};
 
 /// A specified alias for FillRule.
--- a/servo/components/style/values/specified/mod.rs
+++ b/servo/components/style/values/specified/mod.rs
@@ -295,17 +295,20 @@ impl ToCss for Number {
 }
 
 impl IsParallelTo for (Number, Number, Number) {
     fn is_parallel_to(&self, vector: &DirectionVector) -> bool {
         use euclid::approxeq::ApproxEq;
         // If a and b is parallel, the angle between them is 0deg, so
         // a x b = |a|*|b|*sin(0)*n = 0 * n, |a x b| == 0.
         let self_vector = DirectionVector::new(self.0.get(), self.1.get(), self.2.get());
-        self_vector.cross(*vector).square_length().approx_eq(&0.0f32)
+        self_vector
+            .cross(*vector)
+            .square_length()
+            .approx_eq(&0.0f32)
     }
 }
 
 impl SpecifiedValueInfo for Number {}
 
 impl From<Number> for f32 {
     #[inline]
     fn from(n: Number) -> Self {
--- a/servo/components/style/values/specified/transform.rs
+++ b/servo/components/style/values/specified/transform.rs
@@ -357,31 +357,34 @@ impl Parse for Rotate {
             return Ok(generic::Rotate::None);
         }
 
         // Parse <angle> or [ x | y | z | <number>{3} ] && <angle>.
         //
         // The rotate axis and angle could be in any order, so we parse angle twice to cover
         // two cases. i.e. `<number>{3} <angle>` or `<angle> <number>{3}`
         let angle = input.try(|i| specified::Angle::parse(context, i)).ok();
-        let axis = input.try(|i| {
-            Ok(try_match_ident_ignore_ascii_case! { i,
-                "x" => (Number::new(1.), Number::new(0.), Number::new(0.)),
-                "y" => (Number::new(0.), Number::new(1.), Number::new(0.)),
-                "z" => (Number::new(0.), Number::new(0.), Number::new(1.)),
+        let axis = input
+            .try(|i| {
+                Ok(try_match_ident_ignore_ascii_case! { i,
+                    "x" => (Number::new(1.), Number::new(0.), Number::new(0.)),
+                    "y" => (Number::new(0.), Number::new(1.), Number::new(0.)),
+                    "z" => (Number::new(0.), Number::new(0.), Number::new(1.)),
+                })
             })
-        }).or_else(|_: ParseError| -> Result<_, ParseError> {
-            input.try(|i| {
-                Ok((
-                    Number::parse(context, i)?,
-                    Number::parse(context, i)?,
-                    Number::parse(context, i)?,
-                ))
+            .or_else(|_: ParseError| -> Result<_, ParseError> {
+                input.try(|i| {
+                    Ok((
+                        Number::parse(context, i)?,
+                        Number::parse(context, i)?,
+                        Number::parse(context, i)?,
+                    ))
+                })
             })
-        }).ok();
+            .ok();
         let angle = match angle {
             Some(a) => a,
             None => specified::Angle::parse(context, input)?,
         };
 
         Ok(match axis {
             Some((x, y, z)) => generic::Rotate::Rotate3D(x, y, z, angle),
             None => generic::Rotate::Rotate(angle),