mirror of
https://github.com/servo/servo.git
synced 2025-06-09 00:53:26 +00:00
style: Fix formatting.
This commit is contained in:
parent
cd75cd6a86
commit
06fe0a1fc0
7 changed files with 34 additions and 20 deletions
|
@ -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();
|
||||
|
|
|
@ -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(()),
|
||||
}
|
||||
|
|
|
@ -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};
|
||||
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -362,13 +362,15 @@ 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| {
|
||||
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> {
|
||||
})
|
||||
.or_else(|_: ParseError| -> Result<_, ParseError> {
|
||||
input.try(|i| {
|
||||
Ok((
|
||||
Number::parse(context, i)?,
|
||||
|
@ -376,7 +378,8 @@ impl Parse for Rotate {
|
|||
Number::parse(context, i)?,
|
||||
))
|
||||
})
|
||||
}).ok();
|
||||
})
|
||||
.ok();
|
||||
let angle = match angle {
|
||||
Some(a) => a,
|
||||
None => specified::Angle::parse(context, input)?,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue