style: Rustfmt recent changes.

This commit is contained in:
Emilio Cobos Álvarez 2019-10-09 12:54:35 +02:00
parent 112a68723e
commit 33d39d37a2
9 changed files with 61 additions and 50 deletions

View file

@ -398,14 +398,16 @@ impl Display {
// blockify both to "block".
#[cfg(feature = "gecko")]
DisplayOutside::XUL => {
if static_prefs::pref!("layout.css.xul-box-display-values.survive-blockification.enabled") {
match self.inside() {
DisplayInside::MozInlineBox | DisplayInside::MozBox => Display::MozBox,
_ => Display::Block,
if static_prefs::pref!(
"layout.css.xul-box-display-values.survive-blockification.enabled"
) {
match self.inside() {
DisplayInside::MozInlineBox | DisplayInside::MozBox => Display::MozBox,
_ => Display::Block,
}
} else {
Display::Block
}
} else {
Display::Block
}
},
DisplayOutside::Block | DisplayOutside::None => *self,
#[cfg(any(feature = "servo-layout-2013", feature = "gecko"))]
@ -1155,7 +1157,7 @@ fn change_bits_for_longhand(longhand: LonghandId) -> WillChangeBits {
LonghandId::Opacity => WillChangeBits::OPACITY,
LonghandId::Transform | LonghandId::Translate | LonghandId::Rotate | LonghandId::Scale => {
WillChangeBits::TRANSFORM
}
},
_ => WillChangeBits::empty(),
};

View file

@ -10,16 +10,18 @@
use crate::custom_properties::SpecifiedValue;
use crate::parser::{Parse, ParserContext};
use crate::stylesheets::CorsMode;
use crate::values::generics::NonNegative;
use crate::values::generics::image::PaintWorklet;
use crate::values::generics::image::{
self as generic, Circle, Ellipse, GradientCompatMode, ShapeExtent,
};
use crate::values::generics::position::Position as GenericPosition;
use crate::values::generics::NonNegative;
use crate::values::specified::position::{HorizontalPositionKeyword, VerticalPositionKeyword};
use crate::values::specified::position::{Position, PositionComponent, Side};
use crate::values::specified::url::SpecifiedImageUrl;
use crate::values::specified::{Angle, Color, Length, LengthPercentage, NonNegativeLength, NonNegativeLengthPercentage};
use crate::values::specified::{
Angle, Color, Length, LengthPercentage, NonNegativeLength, NonNegativeLengthPercentage,
};
use crate::values::specified::{Number, NumberOrPercentage, Percentage};
use crate::Atom;
use cssparser::{Delimiter, Parser, Token};
@ -88,7 +90,8 @@ impl SpecifiedValueInfo for Gradient {
}
/// A specified gradient kind.
pub type GradientKind = generic::GradientKind<LineDirection, NonNegativeLength, NonNegativeLengthPercentage, Position>;
pub type GradientKind =
generic::GradientKind<LineDirection, NonNegativeLength, NonNegativeLengthPercentage, Position>;
/// A specified gradient line direction.
///
@ -751,7 +754,10 @@ impl EndingShape {
}
NonNegativeLengthPercentage::parse(context, i)?
};
Ok(generic::EndingShape::Ellipse(Ellipse::Radii(NonNegative(LengthPercentage::from(x)), y)))
Ok(generic::EndingShape::Ellipse(Ellipse::Radii(
NonNegative(LengthPercentage::from(x)),
y,
)))
})
}
}

View file

@ -62,7 +62,9 @@ pub use self::length::{FontRelativeLength, Length, LengthOrNumber, NonNegativeLe
pub use self::length::{LengthOrAuto, LengthPercentage, LengthPercentageOrAuto};
pub use self::length::{MaxSize, Size};
pub use self::length::{NoCalcLength, ViewportPercentageLength};
pub use self::length::{NonNegativeLength, NonNegativeLengthPercentage, NonNegativeLengthPercentageOrAuto};
pub use self::length::{
NonNegativeLength, NonNegativeLengthPercentage, NonNegativeLengthPercentageOrAuto,
};
#[cfg(feature = "gecko")]
pub use self::list::ListStyleType;
pub use self::list::MozListReversed;

View file

@ -297,11 +297,7 @@ impl<S: Side> ToComputedValue for PositionComponent<S> {
let p = Percentage(1. - length.percentage());
let l = -length.unclamped_length();
// We represent `<end-side> <length>` as `calc(100% - <length>)`.
ComputedLengthPercentage::with_clamping_mode(
l,
Some(p),
length.clamping_mode,
)
ComputedLengthPercentage::with_clamping_mode(l, Some(p), length.clamping_mode)
},
PositionComponent::Side(_, Some(ref length)) |
PositionComponent::Length(ref length) => length.to_computed_value(context),