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
069c0b06de
commit
1af30fa0c9
9 changed files with 62 additions and 23 deletions
|
@ -35,7 +35,12 @@ impl nsStyleImage {
|
|||
|
||||
// Set CropRect
|
||||
let ref mut rect = *self.mCropRect.mPtr;
|
||||
*rect = Rect(image_rect.top, image_rect.right, image_rect.bottom, image_rect.left);
|
||||
*rect = Rect(
|
||||
image_rect.top,
|
||||
image_rect.right,
|
||||
image_rect.bottom,
|
||||
image_rect.left,
|
||||
);
|
||||
}
|
||||
},
|
||||
GenericImage::Element(ref element) => unsafe {
|
||||
|
|
|
@ -19,7 +19,8 @@ pub type AnimatedSimpleShadow = GenericSimpleShadow<Color, Length, Length>;
|
|||
|
||||
/// An animated value for a single `filter`.
|
||||
#[cfg(feature = "gecko")]
|
||||
pub type AnimatedFilter = GenericFilter<Angle, Number, Number, Length, AnimatedSimpleShadow, ComputedUrl>;
|
||||
pub type AnimatedFilter =
|
||||
GenericFilter<Angle, Number, Number, Length, AnimatedSimpleShadow, ComputedUrl>;
|
||||
|
||||
/// An animated value for a single `filter`.
|
||||
#[cfg(not(feature = "gecko"))]
|
||||
|
|
|
@ -8,7 +8,7 @@ use crate::values::computed::color::Color;
|
|||
use crate::values::computed::length::{Length, NonNegativeLength};
|
||||
#[cfg(feature = "gecko")]
|
||||
use crate::values::computed::url::ComputedUrl;
|
||||
use crate::values::computed::{Angle, ZeroToOneNumber, NonNegativeNumber};
|
||||
use crate::values::computed::{Angle, NonNegativeNumber, ZeroToOneNumber};
|
||||
use crate::values::generics::effects::BoxShadow as GenericBoxShadow;
|
||||
use crate::values::generics::effects::Filter as GenericFilter;
|
||||
use crate::values::generics::effects::SimpleShadow as GenericSimpleShadow;
|
||||
|
@ -20,13 +20,25 @@ pub type BoxShadow = GenericBoxShadow<Color, Length, NonNegativeLength, Length>;
|
|||
|
||||
/// A computed value for a single `filter`.
|
||||
#[cfg(feature = "gecko")]
|
||||
pub type Filter =
|
||||
GenericFilter<Angle, NonNegativeNumber, ZeroToOneNumber, NonNegativeLength, SimpleShadow, ComputedUrl>;
|
||||
pub type Filter = GenericFilter<
|
||||
Angle,
|
||||
NonNegativeNumber,
|
||||
ZeroToOneNumber,
|
||||
NonNegativeLength,
|
||||
SimpleShadow,
|
||||
ComputedUrl,
|
||||
>;
|
||||
|
||||
/// A computed value for a single `filter`.
|
||||
#[cfg(feature = "servo")]
|
||||
pub type Filter =
|
||||
GenericFilter<Angle, NonNegativeNumber, ZeroToOneNumber, NonNegativeLength, Impossible, Impossible>;
|
||||
pub type Filter = GenericFilter<
|
||||
Angle,
|
||||
NonNegativeNumber,
|
||||
ZeroToOneNumber,
|
||||
NonNegativeLength,
|
||||
Impossible,
|
||||
Impossible,
|
||||
>;
|
||||
|
||||
/// A computed value for the `drop-shadow()` filter.
|
||||
pub type SimpleShadow = GenericSimpleShadow<Color, Length, NonNegativeLength>;
|
||||
|
|
|
@ -8,7 +8,7 @@ use self::transform::DirectionVector;
|
|||
use super::animated::ToAnimatedValue;
|
||||
use super::generics::grid::GridTemplateComponent as GenericGridTemplateComponent;
|
||||
use super::generics::grid::{GenericGridLine, GenericTrackBreadth};
|
||||
use super::generics::grid::{TrackList as GenericTrackList, GenericTrackSize};
|
||||
use super::generics::grid::{GenericTrackSize, TrackList as GenericTrackList};
|
||||
use super::generics::transform::IsParallelTo;
|
||||
use super::generics::{self, GreaterThanOrEqualToOne, NonNegative, ZeroToOne};
|
||||
use super::specified;
|
||||
|
@ -75,10 +75,10 @@ pub use self::svg::MozContextProperties;
|
|||
pub use self::svg::{SVGLength, SVGOpacity, SVGPaint, SVGPaintKind};
|
||||
pub use self::svg::{SVGPaintOrder, SVGStrokeDashArray, SVGWidth};
|
||||
pub use self::table::XSpan;
|
||||
pub use self::text::TextDecorationSkipInk;
|
||||
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::TextDecorationSkipInk;
|
||||
pub use self::time::Time;
|
||||
pub use self::transform::{Rotate, Scale, Transform, TransformOperation};
|
||||
pub use self::transform::{TransformOrigin, TransformStyle, Translate};
|
||||
|
|
|
@ -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, TextDecorationSkipInk};
|
||||
pub use crate::values::specified::{LineBreak, OverflowWrap, WordBreak};
|
||||
pub use crate::values::specified::{TextDecorationLine, TextEmphasisPosition};
|
||||
pub use crate::values::specified::{TextDecorationSkipInk, TextTransform};
|
||||
|
||||
/// A computed value for the `initial-letter` property.
|
||||
pub type InitialLetter = GenericInitialLetter<CSSFloat, CSSInteger>;
|
||||
|
|
|
@ -5,17 +5,16 @@
|
|||
//! Generic types for the handling of
|
||||
//! [grids](https://drafts.csswg.org/css-grid/).
|
||||
|
||||
use crate::{Atom, Zero};
|
||||
use crate::parser::{Parse, ParserContext};
|
||||
use crate::values::specified;
|
||||
use crate::values::specified::grid::parse_line_names;
|
||||
use crate::values::{CSSFloat, CustomIdent};
|
||||
use crate::{Atom, Zero};
|
||||
use cssparser::Parser;
|
||||
use std::fmt::{self, Write};
|
||||
use std::{cmp, mem, usize};
|
||||
use style_traits::{CssWriter, ParseError, StyleParseErrorKind, ToCss};
|
||||
|
||||
|
||||
/// These are the limits that we choose to clamp grid line numbers to.
|
||||
/// http://drafts.csswg.org/css-grid/#overlarge-grids
|
||||
/// line_num is clamped to this range at parse time.
|
||||
|
@ -146,7 +145,10 @@ impl Parse for GridLine<specified::Integer> {
|
|||
return Err(location.new_custom_error(StyleParseErrorKind::UnspecifiedError));
|
||||
}
|
||||
|
||||
grid_line.line_num = specified::Integer::new(cmp::max(MIN_GRID_LINE, cmp::min(value, MAX_GRID_LINE)));
|
||||
grid_line.line_num = specified::Integer::new(cmp::max(
|
||||
MIN_GRID_LINE,
|
||||
cmp::min(value, MAX_GRID_LINE),
|
||||
));
|
||||
} else if let Ok(name) = input.try(|i| i.expect_ident_cloned()) {
|
||||
if val_before_span || grid_line.ident != atom!("") {
|
||||
return Err(location.new_custom_error(StyleParseErrorKind::UnspecifiedError));
|
||||
|
@ -230,7 +232,16 @@ impl<L> TrackBreadth<L> {
|
|||
/// <https://drafts.csswg.org/css-grid/#typedef-track-size>
|
||||
///
|
||||
/// cbindgen:derive-tagged-enum-copy-constructor=true
|
||||
#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToResolvedValue, ToShmem)]
|
||||
#[derive(
|
||||
Clone,
|
||||
Debug,
|
||||
MallocSizeOf,
|
||||
PartialEq,
|
||||
SpecifiedValueInfo,
|
||||
ToComputedValue,
|
||||
ToResolvedValue,
|
||||
ToShmem,
|
||||
)]
|
||||
#[repr(C, u8)]
|
||||
pub enum GenericTrackSize<L> {
|
||||
/// A flexible `<track-breadth>`
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
use crate::parser::{Parse, ParserContext};
|
||||
use crate::values::computed::effects::BoxShadow as ComputedBoxShadow;
|
||||
use crate::values::computed::effects::SimpleShadow as ComputedSimpleShadow;
|
||||
use crate::values::computed::ZeroToOneNumber as ComputedZeroToOneNumber;
|
||||
use crate::values::computed::NonNegativeNumber as ComputedNonNegativeNumber;
|
||||
use crate::values::computed::ZeroToOneNumber as ComputedZeroToOneNumber;
|
||||
use crate::values::computed::{Context, ToComputedValue};
|
||||
use crate::values::generics::effects::BoxShadow as GenericBoxShadow;
|
||||
use crate::values::generics::effects::Filter as GenericFilter;
|
||||
|
@ -31,13 +31,25 @@ pub type BoxShadow =
|
|||
|
||||
/// A specified value for a single `filter`.
|
||||
#[cfg(feature = "gecko")]
|
||||
pub type SpecifiedFilter =
|
||||
GenericFilter<Angle, NonNegativeFactor, ZeroToOneFactor, NonNegativeLength, SimpleShadow, SpecifiedUrl>;
|
||||
pub type SpecifiedFilter = GenericFilter<
|
||||
Angle,
|
||||
NonNegativeFactor,
|
||||
ZeroToOneFactor,
|
||||
NonNegativeLength,
|
||||
SimpleShadow,
|
||||
SpecifiedUrl,
|
||||
>;
|
||||
|
||||
/// A specified value for a single `filter`.
|
||||
#[cfg(feature = "servo")]
|
||||
pub type SpecifiedFilter =
|
||||
GenericFilter<Angle, NonNegativeFactor, ZeroToOneFactor, NonNegativeLength, Impossible, Impossible>;
|
||||
pub type SpecifiedFilter = GenericFilter<
|
||||
Angle,
|
||||
NonNegativeFactor,
|
||||
ZeroToOneFactor,
|
||||
NonNegativeLength,
|
||||
Impossible,
|
||||
Impossible,
|
||||
>;
|
||||
|
||||
pub use self::SpecifiedFilter as Filter;
|
||||
|
||||
|
|
|
@ -28,9 +28,7 @@ pub fn parse_flex<'i, 't>(input: &mut Parser<'i, 't>) -> Result<CSSFloat, ParseE
|
|||
}
|
||||
|
||||
impl<L> TrackBreadth<L> {
|
||||
fn parse_keyword<'i, 't>(
|
||||
input: &mut Parser<'i, 't>,
|
||||
) -> Result<Self, ParseError<'i>> {
|
||||
fn parse_keyword<'i, 't>(input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i>> {
|
||||
#[derive(Parse)]
|
||||
enum TrackKeyword {
|
||||
Auto,
|
||||
|
|
|
@ -78,10 +78,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, TextDecorationSkipInk};
|
||||
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::{TextDecorationSkipInk, TextTransform};
|
||||
pub use self::time::Time;
|
||||
pub use self::transform::{Rotate, Scale, Transform};
|
||||
pub use self::transform::{TransformOrigin, TransformStyle, Translate};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue