mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
style: Rustfmt recent changes.
This commit is contained in:
parent
71daec59eb
commit
be616c31e8
15 changed files with 41 additions and 37 deletions
|
@ -9,7 +9,9 @@ use crate::values::animated::ToAnimatedValue;
|
|||
use crate::values::computed::NonNegativeNumber;
|
||||
use crate::values::distance::{ComputeSquaredDistance, SquaredDistance};
|
||||
use crate::values::generics::length as generics;
|
||||
use crate::values::generics::length::{MaxSize as GenericMaxSize, Size as GenericSize, GenericLengthOrNumber};
|
||||
use crate::values::generics::length::{
|
||||
GenericLengthOrNumber, MaxSize as GenericMaxSize, Size as GenericSize,
|
||||
};
|
||||
use crate::values::generics::transform::IsZeroLength;
|
||||
use crate::values::generics::NonNegative;
|
||||
use crate::values::specified::length::ViewportPercentageLength;
|
||||
|
|
|
@ -21,7 +21,8 @@ pub type TransformOperation =
|
|||
pub type Transform = generic::Transform<TransformOperation>;
|
||||
|
||||
/// The computed value of a CSS `<transform-origin>`
|
||||
pub type TransformOrigin = generic::GenericTransformOrigin<LengthPercentage, LengthPercentage, Length>;
|
||||
pub type TransformOrigin =
|
||||
generic::GenericTransformOrigin<LengthPercentage, LengthPercentage, Length>;
|
||||
|
||||
/// A vector to represent the direction vector (rotate axis) for Rotate3D.
|
||||
pub type DirectionVector = Vector3D<CSSFloat>;
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
//! Generic types for CSS values related to backgrounds.
|
||||
|
||||
use crate::values::generics::length::{LengthPercentageOrAuto, GenericLengthPercentageOrAuto};
|
||||
use crate::values::generics::length::{GenericLengthPercentageOrAuto, LengthPercentageOrAuto};
|
||||
use std::fmt::{self, Write};
|
||||
use style_traits::{CssWriter, ToCss};
|
||||
|
||||
|
|
|
@ -127,8 +127,8 @@ impl Parse for CounterStyleOrNone {
|
|||
let symbols = Symbols::parse(context, input)?;
|
||||
// There must be at least two symbols for alphabetic or
|
||||
// numeric system.
|
||||
if (symbols_type == SymbolsType::Alphabetic ||
|
||||
symbols_type == SymbolsType::Numeric) && symbols.0.len() < 2
|
||||
if (symbols_type == SymbolsType::Alphabetic || symbols_type == SymbolsType::Numeric) &&
|
||||
symbols.0.len() < 2
|
||||
{
|
||||
return Err(input.new_custom_error(StyleParseErrorKind::UnspecifiedError));
|
||||
}
|
||||
|
@ -177,7 +177,7 @@ impl SpecifiedValueInfo for CounterStyleOrNone {
|
|||
#[repr(transparent)]
|
||||
pub struct NonNegative<T>(pub T);
|
||||
|
||||
impl <T: Add<Output = T>> Add<NonNegative<T>> for NonNegative<T> {
|
||||
impl<T: Add<Output = T>> Add<NonNegative<T>> for NonNegative<T> {
|
||||
type Output = Self;
|
||||
|
||||
fn add(self, other: Self) -> Self {
|
||||
|
@ -185,7 +185,7 @@ impl <T: Add<Output = T>> Add<NonNegative<T>> for NonNegative<T> {
|
|||
}
|
||||
}
|
||||
|
||||
impl <T: Zero> Zero for NonNegative<T> {
|
||||
impl<T: Zero> Zero for NonNegative<T> {
|
||||
fn is_zero(&self) -> bool {
|
||||
self.0.is_zero()
|
||||
}
|
||||
|
|
|
@ -32,7 +32,10 @@ pub use self::GenericPosition as Position;
|
|||
impl<H, V> Position<H, V> {
|
||||
/// Returns a new position.
|
||||
pub fn new(horizontal: H, vertical: V) -> Self {
|
||||
Self { horizontal, vertical }
|
||||
Self {
|
||||
horizontal,
|
||||
vertical,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -98,7 +98,11 @@ pub use self::GenericTransformOrigin as TransformOrigin;
|
|||
impl<H, V, D> TransformOrigin<H, V, D> {
|
||||
/// Returns a new transform origin.
|
||||
pub fn new(horizontal: H, vertical: V, depth: D) -> Self {
|
||||
Self { horizontal, vertical, depth }
|
||||
Self {
|
||||
horizontal,
|
||||
vertical,
|
||||
depth,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -419,16 +419,7 @@ pub enum ScrollSnapAlignKeyword {
|
|||
/// https://drafts.csswg.org/css-scroll-snap-1/#scroll-snap-align
|
||||
#[allow(missing_docs)]
|
||||
#[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
|
||||
#[derive(
|
||||
Clone,
|
||||
Copy,
|
||||
Debug,
|
||||
Eq,
|
||||
MallocSizeOf,
|
||||
PartialEq,
|
||||
SpecifiedValueInfo,
|
||||
ToComputedValue,
|
||||
)]
|
||||
#[derive(Clone, Copy, Debug, Eq, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue)]
|
||||
#[repr(C)]
|
||||
pub struct ScrollSnapAlign {
|
||||
block: ScrollSnapAlignKeyword,
|
||||
|
|
|
@ -17,7 +17,7 @@ use crate::values::generics::font::{KeywordSize, VariationValue};
|
|||
use crate::values::generics::NonNegative;
|
||||
use crate::values::specified::length::{FontBaseSize, AU_PER_PT, AU_PER_PX};
|
||||
use crate::values::specified::{AllowQuirks, Angle, Integer, LengthPercentage};
|
||||
use crate::values::specified::{NoCalcLength, Number, NonNegativeNumber, Percentage};
|
||||
use crate::values::specified::{NoCalcLength, NonNegativeNumber, Number, Percentage};
|
||||
use crate::values::CustomIdent;
|
||||
use crate::Atom;
|
||||
use app_units::Au;
|
||||
|
|
|
@ -11,11 +11,13 @@ use crate::font_metrics::FontMetricsQueryResult;
|
|||
use crate::parser::{Parse, ParserContext};
|
||||
use crate::values::computed::{self, CSSPixelLength, Context};
|
||||
use crate::values::generics::length as generics;
|
||||
use crate::values::generics::length::{MaxSize as GenericMaxSize, Size as GenericSize, GenericLengthOrNumber};
|
||||
use crate::values::generics::length::{
|
||||
GenericLengthOrNumber, MaxSize as GenericMaxSize, Size as GenericSize,
|
||||
};
|
||||
use crate::values::generics::transform::IsZeroLength;
|
||||
use crate::values::generics::NonNegative;
|
||||
use crate::values::specified::NonNegativeNumber;
|
||||
use crate::values::specified::calc::CalcNode;
|
||||
use crate::values::specified::NonNegativeNumber;
|
||||
use crate::values::{Auto, CSSFloat, Either, Normal};
|
||||
use app_units::Au;
|
||||
use cssparser::{Parser, Token};
|
||||
|
|
|
@ -19,10 +19,10 @@ use crate::values::serialize_atom_identifier;
|
|||
use crate::values::specified::calc::CalcNode;
|
||||
use crate::{Atom, Namespace, Prefix};
|
||||
use cssparser::{Parser, Token};
|
||||
use num_traits::{Zero, One};
|
||||
use num_traits::{One, Zero};
|
||||
use std::f32;
|
||||
use std::ops::Add;
|
||||
use std::fmt::{self, Write};
|
||||
use std::ops::Add;
|
||||
use style_traits::values::specified::AllowedNumericType;
|
||||
use style_traits::{CssWriter, ParseError, SpecifiedValueInfo, StyleParseErrorKind, ToCss};
|
||||
|
||||
|
|
|
@ -64,7 +64,7 @@ impl Parse for SVGStrokeDashArray {
|
|||
NonNegativeSvgLengthPercentageOrNumber::parse(context, i)
|
||||
})
|
||||
}) {
|
||||
return Ok(generic::SVGStrokeDashArray::Values(values))
|
||||
return Ok(generic::SVGStrokeDashArray::Values(values));
|
||||
}
|
||||
|
||||
try_match_ident_ignore_ascii_case! { input,
|
||||
|
|
|
@ -14,9 +14,9 @@ use crate::values::computed::{Context, ToComputedValue};
|
|||
use crate::values::generics::text::InitialLetter as GenericInitialLetter;
|
||||
use crate::values::generics::text::LineHeight as GenericLineHeight;
|
||||
use crate::values::generics::text::Spacing;
|
||||
use crate::values::specified::length::NonNegativeLengthPercentage;
|
||||
use crate::values::specified::length::{FontRelativeLength, Length};
|
||||
use crate::values::specified::length::{LengthPercentage, NoCalcLength};
|
||||
use crate::values::specified::length::{NonNegativeLengthPercentage};
|
||||
use crate::values::specified::{AllowQuirks, Integer, NonNegativeNumber, Number};
|
||||
use cssparser::{Parser, Token};
|
||||
use selectors::parser::SelectorParseErrorKind;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue