mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
style: Rustfmt recent changes.
This commit is contained in:
parent
deba73a528
commit
57874ae90a
10 changed files with 73 additions and 56 deletions
|
@ -86,8 +86,8 @@ pub use self::transform::{TransformOrigin, TransformStyle, Translate};
|
|||
#[cfg(feature = "gecko")]
|
||||
pub use self::ui::CursorImage;
|
||||
pub use self::ui::{Cursor, MozForceBrokenImageIcon, UserSelect};
|
||||
pub use super::specified::{BorderStyle, TextDecorationLine};
|
||||
pub use super::specified::TextTransform;
|
||||
pub use super::specified::{BorderStyle, TextDecorationLine};
|
||||
pub use super::{Auto, Either, None_};
|
||||
pub use app_units::Au;
|
||||
|
||||
|
|
|
@ -19,9 +19,9 @@ use std::fmt::{self, Write};
|
|||
use style_traits::{CssWriter, ToCss};
|
||||
|
||||
pub use crate::values::specified::TextAlignKeyword as TextAlign;
|
||||
pub use crate::values::specified::TextTransform;
|
||||
pub use crate::values::specified::{OverflowWrap, WordBreak};
|
||||
pub use crate::values::specified::{TextDecorationLine, TextEmphasisPosition};
|
||||
pub use crate::values::specified::TextTransform;
|
||||
|
||||
/// A computed value for the `initial-letter` property.
|
||||
pub type InitialLetter = GenericInitialLetter<CSSFloat, CSSInteger>;
|
||||
|
|
|
@ -280,7 +280,9 @@ impl Parse for VerticalAlign {
|
|||
return Ok(GenericVerticalAlign::Length(lp));
|
||||
}
|
||||
|
||||
Ok(GenericVerticalAlign::Keyword(VerticalAlignKeyword::parse(input)?))
|
||||
Ok(GenericVerticalAlign::Keyword(VerticalAlignKeyword::parse(
|
||||
input,
|
||||
)?))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -510,13 +510,16 @@ impl Gradient {
|
|||
items.sort_by(|a, b| {
|
||||
match (a, b) {
|
||||
(
|
||||
&generic::GradientItem::ComplexColorStop { position: ref a_position, .. },
|
||||
&generic::GradientItem::ComplexColorStop { position: ref b_position, .. },
|
||||
&generic::GradientItem::ComplexColorStop {
|
||||
position: ref a_position,
|
||||
..
|
||||
},
|
||||
&generic::GradientItem::ComplexColorStop {
|
||||
position: ref b_position,
|
||||
..
|
||||
},
|
||||
) => match (a_position, b_position) {
|
||||
(
|
||||
&LengthPercentage::Percentage(a),
|
||||
&LengthPercentage::Percentage(b),
|
||||
) => {
|
||||
(&LengthPercentage::Percentage(a), &LengthPercentage::Percentage(b)) => {
|
||||
return a.0.partial_cmp(&b.0).unwrap_or(Ordering::Equal);
|
||||
},
|
||||
_ => {},
|
||||
|
@ -786,7 +789,7 @@ impl LineDirection {
|
|||
#[cfg(feature = "gecko")]
|
||||
{
|
||||
// `-moz-` prefixed linear gradient can be both Angle and Position.
|
||||
if *compat_mode == CompatMode::Moz && !simple_moz_gradient(){
|
||||
if *compat_mode == CompatMode::Moz && !simple_moz_gradient() {
|
||||
let position = i.try(|i| LegacyPosition::parse(context, i)).ok();
|
||||
if _angle.is_none() {
|
||||
_angle = i.try(|i| Angle::parse(context, i)).ok();
|
||||
|
@ -961,10 +964,13 @@ impl GradientItem {
|
|||
if let Ok(multi_position) = input.try(|i| LengthPercentage::parse(context, i)) {
|
||||
let stop_color = stop.color.clone();
|
||||
items.push(stop.into_item());
|
||||
items.push(ColorStop {
|
||||
color: stop_color,
|
||||
position: Some(multi_position),
|
||||
}.into_item());
|
||||
items.push(
|
||||
ColorStop {
|
||||
color: stop_color,
|
||||
position: Some(multi_position),
|
||||
}
|
||||
.into_item(),
|
||||
);
|
||||
} else {
|
||||
items.push(stop.into_item());
|
||||
}
|
||||
|
|
|
@ -80,10 +80,10 @@ pub use self::svg::{SVGLength, SVGOpacity, SVGPaint, SVGPaintKind};
|
|||
pub use self::svg::{SVGPaintOrder, SVGStrokeDashArray, SVGWidth};
|
||||
pub use self::svg_path::SVGPathData;
|
||||
pub use self::table::XSpan;
|
||||
pub use self::text::TextTransform;
|
||||
pub use self::text::{InitialLetter, LetterSpacing, LineHeight, TextAlign};
|
||||
pub use self::text::{OverflowWrap, TextEmphasisPosition, TextEmphasisStyle, WordBreak};
|
||||
pub use self::text::{TextAlignKeyword, TextDecorationLine, TextOverflow, WordSpacing};
|
||||
pub use self::text::TextTransform;
|
||||
pub use self::time::Time;
|
||||
pub use self::transform::{Rotate, Scale, Transform};
|
||||
pub use self::transform::{TransformOrigin, TransformStyle, Translate};
|
||||
|
|
|
@ -361,7 +361,8 @@ impl TextDecorationLine {
|
|||
SpecifiedValueInfo,
|
||||
ToComputedValue,
|
||||
ToResolvedValue,
|
||||
ToShmem)]
|
||||
ToShmem,
|
||||
)]
|
||||
#[repr(C)]
|
||||
/// Specified value of the text-transform property, stored in two parts:
|
||||
/// the case-related transforms (mutually exclusive, only one may be in effect), and others (non-exclusive).
|
||||
|
@ -468,7 +469,8 @@ impl ToCss for TextTransform {
|
|||
ToComputedValue,
|
||||
ToCss,
|
||||
ToResolvedValue,
|
||||
ToShmem)]
|
||||
ToShmem,
|
||||
)]
|
||||
#[repr(C)]
|
||||
/// Specified keyword values for case transforms in the text-transform property. (These are exclusive.)
|
||||
pub enum TextTransformCase {
|
||||
|
@ -563,7 +565,9 @@ pub enum TextAlignKeyword {
|
|||
}
|
||||
|
||||
/// Specified value of text-align property.
|
||||
#[derive(Clone, Copy, Debug, Eq, Hash, MallocSizeOf, Parse, PartialEq, SpecifiedValueInfo, ToCss, ToShmem)]
|
||||
#[derive(
|
||||
Clone, Copy, Debug, Eq, Hash, MallocSizeOf, Parse, PartialEq, SpecifiedValueInfo, ToCss, ToShmem,
|
||||
)]
|
||||
pub enum TextAlign {
|
||||
/// Keyword value of text-align property.
|
||||
Keyword(TextAlignKeyword),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue