mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
style: Move border-image-repeat outside of mako.
This commit is contained in:
parent
b4339ab5c8
commit
50b517d0db
7 changed files with 95 additions and 59 deletions
|
@ -171,3 +171,39 @@ impl Parse for BorderSpacing {
|
|||
}).map(GenericBorderSpacing)
|
||||
}
|
||||
}
|
||||
|
||||
/// A single border-image-repeat keyword.
|
||||
#[allow(missing_docs)]
|
||||
#[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
|
||||
#[derive(Clone, Copy, Debug, Eq, MallocSizeOf, Parse, PartialEq, ToCss)]
|
||||
pub enum RepeatKeyword {
|
||||
Stretch,
|
||||
Repeat,
|
||||
Round,
|
||||
Space,
|
||||
}
|
||||
|
||||
/// The specified value for the `border-image-repeat` property.
|
||||
///
|
||||
/// https://drafts.csswg.org/css-backgrounds/#the-border-image-repeat
|
||||
#[derive(Clone, Debug, MallocSizeOf, PartialEq, ToCss)]
|
||||
pub struct BorderImageRepeat(pub RepeatKeyword, pub Option<RepeatKeyword>);
|
||||
|
||||
impl BorderImageRepeat {
|
||||
/// Returns the `stretch` value.
|
||||
#[inline]
|
||||
pub fn stretch() -> Self {
|
||||
BorderImageRepeat(RepeatKeyword::Stretch, None)
|
||||
}
|
||||
}
|
||||
|
||||
impl Parse for BorderImageRepeat {
|
||||
fn parse<'i, 't>(
|
||||
_context: &ParserContext,
|
||||
input: &mut Parser<'i, 't>,
|
||||
) -> Result<Self, ParseError<'i>> {
|
||||
let horizontal = RepeatKeyword::parse(input)?;
|
||||
let vertical = input.try(RepeatKeyword::parse).ok();
|
||||
Ok(BorderImageRepeat(horizontal, vertical))
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ pub use self::align::{AlignContent, JustifyContent, AlignItems, ContentDistribut
|
|||
pub use self::align::{AlignSelf, JustifySelf};
|
||||
pub use self::background::{BackgroundRepeat, BackgroundSize};
|
||||
pub use self::border::{BorderCornerRadius, BorderImageSlice, BorderImageWidth};
|
||||
pub use self::border::{BorderImageSideWidth, BorderRadius, BorderSideWidth, BorderSpacing};
|
||||
pub use self::border::{BorderImageRepeat, BorderImageSideWidth, BorderRadius, BorderSideWidth, BorderSpacing};
|
||||
pub use self::font::{FontSize, FontSizeAdjust, FontSynthesis, FontWeight, FontVariantAlternates};
|
||||
pub use self::font::{FontFamily, FontLanguageOverride, FontVariantSettings, FontVariantEastAsian};
|
||||
pub use self::font::{FontVariantLigatures, FontVariantNumeric, FontFeatureSettings};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue