diff options
author | Emilio Cobos Álvarez <emilio@crisal.io> | 2018-11-17 09:48:01 +0100 |
---|---|---|
committer | Emilio Cobos Álvarez <emilio@crisal.io> | 2018-11-17 09:56:05 +0100 |
commit | 06fe0a1fc04700b6473be0412c561d3de489d32c (patch) | |
tree | 14e2fbd28608cb95b315ed46767a89375edeb0eb /components | |
parent | cd75cd6a86cbae850d8927c7c0772fb68582d25a (diff) | |
download | servo-06fe0a1fc04700b6473be0412c561d3de489d32c.tar.gz servo-06fe0a1fc04700b6473be0412c561d3de489d32c.zip |
style: Fix formatting.
Diffstat (limited to 'components')
-rw-r--r-- | components/style/custom_properties.rs | 3 | ||||
-rw-r--r-- | components/style/media_queries/media_feature_expression.rs | 6 | ||||
-rw-r--r-- | components/style/values/computed/box.rs | 2 | ||||
-rw-r--r-- | components/style/values/computed/mod.rs | 7 | ||||
-rw-r--r-- | components/style/values/specified/basic_shape.rs | 2 | ||||
-rw-r--r-- | components/style/values/specified/mod.rs | 5 | ||||
-rw-r--r-- | components/style/values/specified/transform.rs | 29 |
7 files changed, 34 insertions, 20 deletions
diff --git a/components/style/custom_properties.rs b/components/style/custom_properties.rs index c1d337ac2fa..c9d4ab0b753 100644 --- a/components/style/custom_properties.rs +++ b/components/style/custom_properties.rs @@ -335,7 +335,8 @@ impl VariableValue { 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(); diff --git a/components/style/media_queries/media_feature_expression.rs b/components/style/media_queries/media_feature_expression.rs index 122b7ca05ff..0b093931fad 100644 --- a/components/style/media_queries/media_feature_expression.rs +++ b/components/style/media_queries/media_feature_expression.rs @@ -325,7 +325,11 @@ impl MediaFeatureExpression { }; 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(()), } diff --git a/components/style/values/computed/box.rs b/components/style/values/computed/box.rs index 1af0efff85c..8cf2a63b3c1 100644 --- a/components/style/values/computed/box.rs +++ b/components/style/values/computed/box.rs @@ -12,8 +12,8 @@ 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_::{Contain, Display, OverflowClipBox}; 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_::{OverscrollBehavior, ScrollSnapType}; pub use crate::values::specified::box_::{TouchAction, TransitionProperty, WillChange}; diff --git a/components/style/values/computed/mod.rs b/components/style/values/computed/mod.rs index cae5519f2e7..0dce1502e92 100644 --- a/components/style/values/computed/mod.rs +++ b/components/style/values/computed/mod.rs @@ -4,6 +4,7 @@ //! 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}; @@ -23,7 +24,6 @@ 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; @@ -467,7 +467,10 @@ impl IsParallelTo for (Number, Number, Number) { // 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) } } diff --git a/components/style/values/specified/basic_shape.rs b/components/style/values/specified/basic_shape.rs index b371d709b80..252542df794 100644 --- a/components/style/values/specified/basic_shape.rs +++ b/components/style/values/specified/basic_shape.rs @@ -14,7 +14,7 @@ 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; diff --git a/components/style/values/specified/mod.rs b/components/style/values/specified/mod.rs index 0a1c323481e..5ffa947ef35 100644 --- a/components/style/values/specified/mod.rs +++ b/components/style/values/specified/mod.rs @@ -300,7 +300,10 @@ impl IsParallelTo for (Number, Number, Number) { // 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) } } diff --git a/components/style/values/specified/transform.rs b/components/style/values/specified/transform.rs index 5f455c733de..650722b249f 100644 --- a/components/style/values/specified/transform.rs +++ b/components/style/values/specified/transform.rs @@ -362,21 +362,24 @@ impl Parse for Rotate { // 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)?, |