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:
Bobby Holley 2018-04-10 17:35:15 -07:00
parent f7ae1a37e3
commit c99bcdd4b8
181 changed files with 9981 additions and 7933 deletions

View file

@ -31,23 +31,12 @@ pub type Image = generic::Image<Gradient, MozImageRect, ComputedImageUrl>;
/// Computed values for a CSS gradient.
/// <https://drafts.csswg.org/css-images/#gradients>
pub type Gradient = generic::Gradient<
LineDirection,
Length,
LengthOrPercentage,
Position,
RGBA,
Angle,
>;
pub type Gradient =
generic::Gradient<LineDirection, Length, LengthOrPercentage, Position, RGBA, Angle>;
/// A computed gradient kind.
pub type GradientKind = generic::GradientKind<
LineDirection,
Length,
LengthOrPercentage,
Position,
Angle,
>;
pub type GradientKind =
generic::GradientKind<LineDirection, Length, LengthOrPercentage, Position, Angle>;
/// A computed gradient line direction.
#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq)]
@ -81,16 +70,17 @@ impl generic::LineDirection for LineDirection {
fn points_downwards(&self, compat_mode: CompatMode) -> bool {
match *self {
LineDirection::Angle(angle) => angle.radians() == PI,
LineDirection::Vertical(Y::Bottom)
if compat_mode == CompatMode::Modern => true,
LineDirection::Vertical(Y::Top)
if compat_mode != CompatMode::Modern => true,
LineDirection::Vertical(Y::Bottom) if compat_mode == CompatMode::Modern => true,
LineDirection::Vertical(Y::Top) if compat_mode != CompatMode::Modern => true,
LineDirection::Corner(..) => false,
#[cfg(feature = "gecko")]
LineDirection::MozPosition(Some(Position {
horizontal: LengthOrPercentage::Percentage(Percentage(x)),
vertical: LengthOrPercentage::Percentage(Percentage(y)),
}), None) => {
LineDirection::MozPosition(
Some(Position {
horizontal: LengthOrPercentage::Percentage(Percentage(x)),
vertical: LengthOrPercentage::Percentage(Percentage(y)),
}),
None,
) => {
// `50% 0%` is the default value for line direction.
x == 0.5 && y == 0.0
},
@ -98,11 +88,7 @@ impl generic::LineDirection for LineDirection {
}
}
fn to_css<W>(
&self,
dest: &mut CssWriter<W>,
compat_mode: CompatMode,
) -> fmt::Result
fn to_css<W>(&self, dest: &mut CssWriter<W>, compat_mode: CompatMode) -> fmt::Result
where
W: Write,
{
@ -142,7 +128,7 @@ impl generic::LineDirection for LineDirection {
angle.to_css(dest)?;
}
Ok(())
}
},
}
}
}
@ -155,19 +141,15 @@ impl ToComputedValue for SpecifiedLineDirection {
SpecifiedLineDirection::Angle(ref angle) => {
LineDirection::Angle(angle.to_computed_value(context))
},
SpecifiedLineDirection::Horizontal(x) => {
LineDirection::Horizontal(x)
},
SpecifiedLineDirection::Vertical(y) => {
LineDirection::Vertical(y)
},
SpecifiedLineDirection::Corner(x, y) => {
LineDirection::Corner(x, y)
},
SpecifiedLineDirection::Horizontal(x) => LineDirection::Horizontal(x),
SpecifiedLineDirection::Vertical(y) => LineDirection::Vertical(y),
SpecifiedLineDirection::Corner(x, y) => LineDirection::Corner(x, y),
#[cfg(feature = "gecko")]
SpecifiedLineDirection::MozPosition(ref position, ref angle) => {
LineDirection::MozPosition(position.to_computed_value(context),
angle.to_computed_value(context))
LineDirection::MozPosition(
position.to_computed_value(context),
angle.to_computed_value(context),
)
},
}
}
@ -177,19 +159,15 @@ impl ToComputedValue for SpecifiedLineDirection {
LineDirection::Angle(ref angle) => {
SpecifiedLineDirection::Angle(ToComputedValue::from_computed_value(angle))
},
LineDirection::Horizontal(x) => {
SpecifiedLineDirection::Horizontal(x)
},
LineDirection::Vertical(y) => {
SpecifiedLineDirection::Vertical(y)
},
LineDirection::Corner(x, y) => {
SpecifiedLineDirection::Corner(x, y)
},
LineDirection::Horizontal(x) => SpecifiedLineDirection::Horizontal(x),
LineDirection::Vertical(y) => SpecifiedLineDirection::Vertical(y),
LineDirection::Corner(x, y) => SpecifiedLineDirection::Corner(x, y),
#[cfg(feature = "gecko")]
LineDirection::MozPosition(ref position, ref angle) => {
SpecifiedLineDirection::MozPosition(ToComputedValue::from_computed_value(position),
ToComputedValue::from_computed_value(angle))
SpecifiedLineDirection::MozPosition(
ToComputedValue::from_computed_value(position),
ToComputedValue::from_computed_value(angle),
)
},
}
}