mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
style: Reformat recent changes.
This commit is contained in:
parent
9a8cee2800
commit
5aeab7adb1
17 changed files with 70 additions and 53 deletions
|
@ -8,7 +8,7 @@ use super::{Animate, Procedure, ToAnimatedZero};
|
|||
use crate::properties::animated_properties::ListAnimation;
|
||||
use crate::values::animated::color::Color as AnimatedColor;
|
||||
use crate::values::computed::url::ComputedUrl;
|
||||
use crate::values::distance::{SquaredDistance, ComputeSquaredDistance};
|
||||
use crate::values::distance::{ComputeSquaredDistance, SquaredDistance};
|
||||
use crate::values::generics::svg::{SVGPaint, SVGStrokeDashArray};
|
||||
|
||||
/// Animated SVGPaint.
|
||||
|
|
|
@ -76,7 +76,7 @@ pub use self::svg::{SVGLength, SVGOpacity, SVGPaint, SVGPaintKind};
|
|||
pub use self::svg::{SVGPaintOrder, SVGStrokeDashArray, SVGWidth};
|
||||
pub use self::table::XSpan;
|
||||
pub use self::text::{InitialLetter, LetterSpacing, LineHeight};
|
||||
pub use self::text::{OverflowWrap, TextOverflow, WordSpacing, WordBreak};
|
||||
pub use self::text::{OverflowWrap, TextOverflow, WordBreak, WordSpacing};
|
||||
pub use self::text::{TextAlign, TextEmphasisPosition, TextEmphasisStyle};
|
||||
pub use self::time::Time;
|
||||
pub use self::transform::{Rotate, Scale, Transform, TransformOperation};
|
||||
|
|
|
@ -57,9 +57,7 @@ impl SVGWidth {
|
|||
/// `1px`.
|
||||
pub fn one() -> Self {
|
||||
use crate::values::generics::NonNegative;
|
||||
generic::SVGLength::LengthPercentage(
|
||||
NonNegative(LengthPercentage::one()),
|
||||
)
|
||||
generic::SVGLength::LengthPercentage(NonNegative(LengthPercentage::one()))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -18,9 +18,9 @@ use crate::Zero;
|
|||
use std::fmt::{self, Write};
|
||||
use style_traits::{CssWriter, ToCss};
|
||||
|
||||
pub use crate::values::specified::{OverflowWrap, WordBreak};
|
||||
pub use crate::values::specified::TextAlignKeyword as TextAlign;
|
||||
pub use crate::values::specified::TextEmphasisPosition;
|
||||
pub use crate::values::specified::{OverflowWrap, WordBreak};
|
||||
|
||||
/// A computed value for the `initial-letter` property.
|
||||
pub type InitialLetter = GenericInitialLetter<CSSFloat, CSSInteger>;
|
||||
|
|
|
@ -592,9 +592,7 @@ impl Translate {
|
|||
/// Convert Translate to TransformOperation.
|
||||
pub fn from_transform_operation(operation: &TransformOperation) -> Translate {
|
||||
match *operation {
|
||||
generic::TransformOperation::Translate(tx, ty) => {
|
||||
generic::Translate::Translate(tx, ty)
|
||||
},
|
||||
generic::TransformOperation::Translate(tx, ty) => generic::Translate::Translate(tx, ty),
|
||||
generic::TransformOperation::Translate3D(tx, ty, tz) => {
|
||||
generic::Translate::Translate3D(tx, ty, tz)
|
||||
},
|
||||
|
|
|
@ -215,7 +215,19 @@ pub struct GreaterThanOrEqualToOne<T>(pub T);
|
|||
|
||||
/// A clip rect for clip and image-region
|
||||
#[allow(missing_docs)]
|
||||
#[derive(Clone, ComputeSquaredDistance, Copy, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToAnimatedValue, ToAnimatedZero, ToComputedValue, ToCss)]
|
||||
#[derive(
|
||||
Clone,
|
||||
ComputeSquaredDistance,
|
||||
Copy,
|
||||
Debug,
|
||||
MallocSizeOf,
|
||||
PartialEq,
|
||||
SpecifiedValueInfo,
|
||||
ToAnimatedValue,
|
||||
ToAnimatedZero,
|
||||
ToComputedValue,
|
||||
ToCss,
|
||||
)]
|
||||
#[css(function = "rect", comma)]
|
||||
pub struct ClipRect<LengthOrAuto> {
|
||||
pub top: LengthOrAuto,
|
||||
|
|
|
@ -29,9 +29,7 @@ impl<N, I> InitialLetter<N, I> {
|
|||
}
|
||||
|
||||
/// A generic spacing value for the `letter-spacing` and `word-spacing` properties.
|
||||
#[derive(
|
||||
Clone, Copy, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToCss,
|
||||
)]
|
||||
#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToCss)]
|
||||
pub enum Spacing<Value> {
|
||||
/// `normal`
|
||||
Normal,
|
||||
|
|
|
@ -137,7 +137,10 @@ where
|
|||
SkewY(Angle),
|
||||
/// translate(x, y) or translate(x)
|
||||
#[css(comma, function)]
|
||||
Translate(LengthPercentage, #[css(skip_if = "Zero::is_zero")] LengthPercentage),
|
||||
Translate(
|
||||
LengthPercentage,
|
||||
#[css(skip_if = "Zero::is_zero")] LengthPercentage,
|
||||
),
|
||||
/// translateX(x)
|
||||
#[css(function = "translateX")]
|
||||
TranslateX(LengthPercentage),
|
||||
|
@ -637,7 +640,14 @@ impl<Number: ToCss + PartialEq> ToCss for Scale<Number> {
|
|||
}
|
||||
|
||||
#[derive(
|
||||
Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToAnimatedZero, ToComputedValue, ToCss
|
||||
Clone,
|
||||
Debug,
|
||||
MallocSizeOf,
|
||||
PartialEq,
|
||||
SpecifiedValueInfo,
|
||||
ToAnimatedZero,
|
||||
ToComputedValue,
|
||||
ToCss,
|
||||
)]
|
||||
/// A value of the `translate` property
|
||||
///
|
||||
|
@ -660,7 +670,10 @@ where
|
|||
/// 'none'
|
||||
None,
|
||||
/// '<length-percentage>' or '<length-percentage> <length-percentage>'
|
||||
Translate(LengthPercentage, #[css(skip_if = "Zero::is_zero")] LengthPercentage),
|
||||
Translate(
|
||||
LengthPercentage,
|
||||
#[css(skip_if = "Zero::is_zero")] LengthPercentage,
|
||||
),
|
||||
/// '<length-percentage> <length-percentage> <length>'
|
||||
Translate3D(LengthPercentage, LengthPercentage, Length),
|
||||
}
|
||||
|
|
|
@ -652,7 +652,12 @@ impl ClipRect {
|
|||
left = parse_argument(context, input, allow_quirks)?;
|
||||
}
|
||||
|
||||
Ok(ClipRect { top, right, bottom, left })
|
||||
Ok(ClipRect {
|
||||
top,
|
||||
right,
|
||||
bottom,
|
||||
left,
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,9 +6,9 @@
|
|||
|
||||
use crate::parser::{Parse, ParserContext};
|
||||
use crate::values::generics::svg as generic;
|
||||
use crate::values::specified::AllowQuirks;
|
||||
use crate::values::specified::color::Color;
|
||||
use crate::values::specified::url::SpecifiedUrl;
|
||||
use crate::values::specified::AllowQuirks;
|
||||
use crate::values::specified::LengthPercentage;
|
||||
use crate::values::specified::{NonNegativeLengthPercentage, Opacity};
|
||||
use crate::values::CustomIdent;
|
||||
|
@ -52,10 +52,9 @@ macro_rules! parse_svg_length {
|
|||
context: &ParserContext,
|
||||
input: &mut Parser<'i, 't>,
|
||||
) -> Result<Self, ParseError<'i>> {
|
||||
if let Ok(lp) = input.try(|i| {
|
||||
<$lp>::parse_quirky(context, i, AllowQuirks::Always)
|
||||
}) {
|
||||
return Ok(generic::SVGLength::LengthPercentage(lp))
|
||||
if let Ok(lp) = input.try(|i| <$lp>::parse_quirky(context, i, AllowQuirks::Always))
|
||||
{
|
||||
return Ok(generic::SVGLength::LengthPercentage(lp));
|
||||
}
|
||||
|
||||
try_match_ident_ignore_ascii_case! { input,
|
||||
|
@ -65,7 +64,7 @@ macro_rules! parse_svg_length {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
parse_svg_length!(SVGLength, LengthPercentage);
|
||||
|
@ -78,11 +77,7 @@ impl Parse for SVGStrokeDashArray {
|
|||
) -> Result<Self, ParseError<'i>> {
|
||||
if let Ok(values) = input.try(|i| {
|
||||
CommaWithSpace::parse(i, |i| {
|
||||
NonNegativeLengthPercentage::parse_quirky(
|
||||
context,
|
||||
i,
|
||||
AllowQuirks::Always,
|
||||
)
|
||||
NonNegativeLengthPercentage::parse_quirky(context, i, AllowQuirks::Always)
|
||||
})
|
||||
}) {
|
||||
return Ok(generic::SVGStrokeDashArray::Values(values));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue