mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Run rustfmt on selectors, servo_arc, and style.
This was generated with: ./mach cargo fmt --package selectors && ./mach cargo fmt --package servo_arc && ./mach cargo fmt --package style Using rustfmt 0.4.1-nightly (a4462d1 2018-03-26)
This commit is contained in:
parent
f7ae1a37e3
commit
c99bcdd4b8
181 changed files with 9981 additions and 7933 deletions
|
@ -64,7 +64,11 @@ pub enum GradientKind<LineDirection, Length, LengthOrPercentage, Position, Angle
|
|||
/// A linear gradient.
|
||||
Linear(LineDirection),
|
||||
/// A radial gradient.
|
||||
Radial(EndingShape<Length, LengthOrPercentage>, Position, Option<Angle>),
|
||||
Radial(
|
||||
EndingShape<Length, LengthOrPercentage>,
|
||||
Position,
|
||||
Option<Angle>,
|
||||
),
|
||||
}
|
||||
|
||||
/// A radial gradient's ending shape.
|
||||
|
@ -97,8 +101,7 @@ pub enum Ellipse<LengthOrPercentage> {
|
|||
/// <https://drafts.csswg.org/css-images/#typedef-extent-keyword>
|
||||
#[allow(missing_docs)]
|
||||
#[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
|
||||
#[derive(Clone, Copy, Debug, Eq, MallocSizeOf, Parse, PartialEq)]
|
||||
#[derive(ToComputedValue, ToCss)]
|
||||
#[derive(Clone, Copy, Debug, Eq, MallocSizeOf, Parse, PartialEq, ToComputedValue, ToCss)]
|
||||
pub enum ShapeExtent {
|
||||
ClosestSide,
|
||||
FarthestSide,
|
||||
|
@ -182,7 +185,10 @@ where
|
|||
}
|
||||
|
||||
impl<G, R, U> ToCss for Image<G, R, U>
|
||||
where G: ToCss, R: ToCss, U: ToCss
|
||||
where
|
||||
G: ToCss,
|
||||
R: ToCss,
|
||||
U: ToCss,
|
||||
{
|
||||
fn to_css<W>(&self, dest: &mut CssWriter<W>) -> fmt::Result
|
||||
where
|
||||
|
@ -204,7 +210,13 @@ impl<G, R, U> ToCss for Image<G, R, U>
|
|||
}
|
||||
|
||||
impl<D, L, LoP, P, C, A> ToCss for Gradient<D, L, LoP, P, C, A>
|
||||
where D: LineDirection, L: ToCss, LoP: ToCss, P: ToCss, C: ToCss, A: ToCss
|
||||
where
|
||||
D: LineDirection,
|
||||
L: ToCss,
|
||||
LoP: ToCss,
|
||||
P: ToCss,
|
||||
C: ToCss,
|
||||
A: ToCss,
|
||||
{
|
||||
fn to_css<W>(&self, dest: &mut CssWriter<W>) -> fmt::Result
|
||||
where
|
||||
|
@ -222,8 +234,9 @@ impl<D, L, LoP, P, C, A> ToCss for Gradient<D, L, LoP, P, C, A>
|
|||
dest.write_str(self.kind.label())?;
|
||||
dest.write_str("-gradient(")?;
|
||||
let mut skip_comma = match self.kind {
|
||||
GradientKind::Linear(ref direction)
|
||||
if direction.points_downwards(self.compat_mode) => true,
|
||||
GradientKind::Linear(ref direction) if direction.points_downwards(self.compat_mode) => {
|
||||
true
|
||||
},
|
||||
GradientKind::Linear(ref direction) => {
|
||||
direction.to_css(dest, self.compat_mode)?;
|
||||
false
|
||||
|
@ -231,9 +244,7 @@ impl<D, L, LoP, P, C, A> ToCss for Gradient<D, L, LoP, P, C, A>
|
|||
GradientKind::Radial(ref shape, ref position, ref angle) => {
|
||||
let omit_shape = match *shape {
|
||||
EndingShape::Ellipse(Ellipse::Extent(ShapeExtent::Cover)) |
|
||||
EndingShape::Ellipse(Ellipse::Extent(ShapeExtent::FarthestCorner)) => {
|
||||
true
|
||||
},
|
||||
EndingShape::Ellipse(Ellipse::Extent(ShapeExtent::FarthestCorner)) => true,
|
||||
_ => false,
|
||||
};
|
||||
if self.compat_mode == CompatMode::Modern {
|
||||
|
@ -284,7 +295,8 @@ pub trait LineDirection {
|
|||
|
||||
/// Serialises this direction according to the compatibility mode.
|
||||
fn to_css<W>(&self, dest: &mut CssWriter<W>, compat_mode: CompatMode) -> fmt::Result
|
||||
where W: Write;
|
||||
where
|
||||
W: Write;
|
||||
}
|
||||
|
||||
impl<L> ToCss for Circle<L>
|
||||
|
@ -296,17 +308,14 @@ where
|
|||
W: Write,
|
||||
{
|
||||
match *self {
|
||||
Circle::Extent(ShapeExtent::FarthestCorner) |
|
||||
Circle::Extent(ShapeExtent::Cover) => {
|
||||
Circle::Extent(ShapeExtent::FarthestCorner) | Circle::Extent(ShapeExtent::Cover) => {
|
||||
dest.write_str("circle")
|
||||
},
|
||||
Circle::Extent(keyword) => {
|
||||
dest.write_str("circle ")?;
|
||||
keyword.to_css(dest)
|
||||
},
|
||||
Circle::Radius(ref length) => {
|
||||
length.to_css(dest)
|
||||
},
|
||||
Circle::Radius(ref length) => length.to_css(dest),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue