mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
style: Rustfmt.
This commit is contained in:
parent
c6dfe53483
commit
2d85b54db0
5 changed files with 300 additions and 438 deletions
|
@ -21,10 +21,10 @@ use std::cmp;
|
|||
|
||||
pub mod color;
|
||||
pub mod effects;
|
||||
pub mod transform;
|
||||
mod font;
|
||||
mod length;
|
||||
mod svg;
|
||||
pub mod transform;
|
||||
|
||||
/// The category a property falls into for ordering purposes.
|
||||
///
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -529,14 +529,7 @@ pub fn get_normalized_vector_and_angle<T: Zero>(
|
|||
}
|
||||
|
||||
#[derive(
|
||||
Clone,
|
||||
Copy,
|
||||
Debug,
|
||||
MallocSizeOf,
|
||||
PartialEq,
|
||||
SpecifiedValueInfo,
|
||||
ToAnimatedZero,
|
||||
ToComputedValue,
|
||||
Clone, Copy, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToAnimatedZero, ToComputedValue,
|
||||
)]
|
||||
/// A value of the `Rotate` property
|
||||
///
|
||||
|
@ -598,14 +591,7 @@ where
|
|||
}
|
||||
|
||||
#[derive(
|
||||
Clone,
|
||||
Copy,
|
||||
Debug,
|
||||
MallocSizeOf,
|
||||
PartialEq,
|
||||
SpecifiedValueInfo,
|
||||
ToAnimatedZero,
|
||||
ToComputedValue,
|
||||
Clone, Copy, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToAnimatedZero, ToComputedValue,
|
||||
)]
|
||||
/// A value of the `Scale` property
|
||||
///
|
||||
|
@ -646,13 +632,7 @@ impl<Number: ToCss + PartialEq> ToCss for Scale<Number> {
|
|||
}
|
||||
|
||||
#[derive(
|
||||
Clone,
|
||||
Debug,
|
||||
MallocSizeOf,
|
||||
PartialEq,
|
||||
SpecifiedValueInfo,
|
||||
ToAnimatedZero,
|
||||
ToComputedValue,
|
||||
Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToAnimatedZero, ToComputedValue,
|
||||
)]
|
||||
/// A value of the `Translate` property
|
||||
///
|
||||
|
|
|
@ -1299,26 +1299,25 @@ impl BreakBetween {
|
|||
///
|
||||
/// See https://drafts.csswg.org/css-break/#page-break-properties.
|
||||
#[inline]
|
||||
pub fn parse_legacy<'i>(
|
||||
input: &mut Parser<'i, '_>,
|
||||
) -> Result<Self, ParseError<'i>> {
|
||||
pub fn parse_legacy<'i>(input: &mut Parser<'i, '_>) -> Result<Self, ParseError<'i>> {
|
||||
let location = input.current_source_location();
|
||||
let ident = input.expect_ident()?;
|
||||
let break_value = match BreakBetween::from_ident(ident) {
|
||||
Ok(v) => v,
|
||||
Err(()) => return Err(location.new_custom_error(
|
||||
SelectorParseErrorKind::UnexpectedIdent(ident.clone())
|
||||
)),
|
||||
Err(()) => {
|
||||
return Err(location
|
||||
.new_custom_error(SelectorParseErrorKind::UnexpectedIdent(ident.clone())))
|
||||
},
|
||||
};
|
||||
match break_value {
|
||||
BreakBetween::Always => Ok(BreakBetween::Page),
|
||||
BreakBetween::Auto |
|
||||
BreakBetween::Avoid |
|
||||
BreakBetween::Left |
|
||||
BreakBetween::Right => Ok(break_value),
|
||||
BreakBetween::Auto | BreakBetween::Avoid | BreakBetween::Left | BreakBetween::Right => {
|
||||
Ok(break_value)
|
||||
},
|
||||
BreakBetween::Page => {
|
||||
Err(location.new_custom_error(SelectorParseErrorKind::UnexpectedIdent(ident.clone())))
|
||||
}
|
||||
Err(location
|
||||
.new_custom_error(SelectorParseErrorKind::UnexpectedIdent(ident.clone())))
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1330,10 +1329,9 @@ impl BreakBetween {
|
|||
W: Write,
|
||||
{
|
||||
match *self {
|
||||
BreakBetween::Auto |
|
||||
BreakBetween::Avoid |
|
||||
BreakBetween::Left |
|
||||
BreakBetween::Right => self.to_css(dest),
|
||||
BreakBetween::Auto | BreakBetween::Avoid | BreakBetween::Left | BreakBetween::Right => {
|
||||
self.to_css(dest)
|
||||
},
|
||||
BreakBetween::Page => dest.write_str("always"),
|
||||
BreakBetween::Always => Ok(()),
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue