Rustfmt recent changes.

This commit is contained in:
Emilio Cobos Álvarez 2019-12-15 23:58:55 +01:00
parent e885ccb7ae
commit ef16c5844f
28 changed files with 111 additions and 63 deletions

View file

@ -1373,11 +1373,7 @@ impl ComputedTranslate {
LengthPercentage::zero(),
Length::zero(),
),
Translate::Translate(ref tx, ref ty, ref tz) => (
tx.clone(),
ty.clone(),
tz.clone(),
),
Translate::Translate(ref tx, ref ty, ref tz) => (tx.clone(), ty.clone(), tz.clone()),
}
}
}

View file

@ -75,9 +75,7 @@ impl ToComputedValue for specified::Length {
///
/// https://drafts.csswg.org/css-values-4/#typedef-length-percentage
#[allow(missing_docs)]
#[derive(
Clone, Debug, Deserialize, MallocSizeOf, Serialize, ToAnimatedZero, ToResolvedValue,
)]
#[derive(Clone, Debug, Deserialize, MallocSizeOf, Serialize, ToAnimatedZero, ToResolvedValue)]
#[repr(C)]
pub struct LengthPercentage {
length: Length,

View file

@ -75,11 +75,11 @@ pub use self::resolution::Resolution;
pub use self::svg::MozContextProperties;
pub use self::svg::{SVGLength, SVGOpacity, SVGPaint, SVGPaintKind};
pub use self::svg::{SVGPaintOrder, SVGStrokeDashArray, SVGWidth};
pub use self::text::TextUnderlinePosition;
pub use self::text::{InitialLetter, LetterSpacing, LineBreak, LineHeight};
pub use self::text::{OverflowWrap, TextOverflow, WordBreak, WordSpacing};
pub use self::text::{TextAlign, TextEmphasisPosition, TextEmphasisStyle};
pub use self::text::{TextDecorationLength, TextDecorationSkipInk};
pub use self::text::TextUnderlinePosition;
pub use self::time::Time;
pub use self::transform::{Rotate, Scale, Transform, TransformOperation};
pub use self::transform::{TransformOrigin, TransformStyle, Translate};

View file

@ -19,10 +19,10 @@ use std::fmt::{self, Write};
use style_traits::{CssWriter, ToCss};
pub use crate::values::specified::TextAlignKeyword as TextAlign;
pub use crate::values::specified::TextUnderlinePosition;
pub use crate::values::specified::{LineBreak, OverflowWrap, WordBreak};
pub use crate::values::specified::{TextDecorationLine, TextEmphasisPosition};
pub use crate::values::specified::{TextDecorationSkipInk, TextTransform};
pub use crate::values::specified::TextUnderlinePosition;
/// A computed value for the `initial-letter` property.
pub type InitialLetter = GenericInitialLetter<CSSFloat, CSSInteger>;

View file

@ -390,11 +390,9 @@ impl Display {
Display::from3(DisplayOutside::Block, inside, self.is_list_item())
},
#[cfg(feature = "gecko")]
DisplayOutside::XUL => {
match self.inside() {
DisplayInside::MozInlineBox | DisplayInside::MozBox => Display::MozBox,
_ => Display::Block,
}
DisplayOutside::XUL => match self.inside() {
DisplayInside::MozInlineBox | DisplayInside::MozBox => Display::MozBox,
_ => Display::Block,
},
DisplayOutside::Block | DisplayOutside::None => *self,
#[cfg(any(feature = "servo-layout-2013", feature = "gecko"))]

View file

@ -961,7 +961,8 @@ impl FontSize {
// others should reject negatives during parsing. But SMIL
// allows parsing negatives, and relies on us _not_ doing that
// clamping. That's so bonkers :(
calc.percentage_relative_to(base_size.resolve(context)).clamp_to_non_negative()
calc.percentage_relative_to(base_size.resolve(context))
.clamp_to_non_negative()
},
FontSize::Keyword(i) => {
// As a specified keyword, this is keyword derived

View file

@ -5,7 +5,7 @@
//! Specified types for legacy Gecko-only properties.
use crate::parser::{Parse, ParserContext};
use crate::values::computed::{self, LengthPercentage, Length};
use crate::values::computed::{self, Length, LengthPercentage};
use crate::values::generics::rect::Rect;
use cssparser::{Parser, Token};
use std::fmt;

View file

@ -101,7 +101,11 @@ impl FontRelativeLength {
}
/// Computes the font-relative length.
pub fn to_computed_value(&self, context: &Context, base_size: FontBaseSize) -> computed::Length {
pub fn to_computed_value(
&self,
context: &Context,
base_size: FontBaseSize,
) -> computed::Length {
let (reference_size, length) = self.reference_font_size_and_length(context, base_size);
reference_size * length
}

View file

@ -80,11 +80,11 @@ pub use self::svg::MozContextProperties;
pub use self::svg::{SVGLength, SVGOpacity, SVGPaint};
pub use self::svg::{SVGPaintOrder, SVGStrokeDashArray, SVGWidth};
pub use self::svg_path::SVGPathData;
pub use self::text::TextUnderlinePosition;
pub use self::text::{InitialLetter, LetterSpacing, LineBreak, LineHeight, TextAlign};
pub use self::text::{OverflowWrap, TextEmphasisPosition, TextEmphasisStyle, WordBreak};
pub use self::text::{TextAlignKeyword, TextDecorationLine, TextOverflow, WordSpacing};
pub use self::text::{TextDecorationLength, TextDecorationSkipInk, TextTransform};
pub use self::text::TextUnderlinePosition;
pub use self::time::Time;
pub use self::transform::{Rotate, Scale, Transform};
pub use self::transform::{TransformOrigin, TransformStyle, Translate};