mirror of
https://github.com/servo/servo.git
synced 2025-08-09 15:35:34 +01:00
Replace IntegerOrAuto with ZIndex
It's its only use.
This commit is contained in:
parent
6a7ae3b12e
commit
b44ffcf498
9 changed files with 75 additions and 50 deletions
|
@ -61,7 +61,8 @@ pub use self::list::ListStyleType;
|
|||
pub use self::outline::OutlineStyle;
|
||||
pub use self::rect::LengthOrNumberRect;
|
||||
pub use self::percentage::Percentage;
|
||||
pub use self::position::{Position, PositionComponent, GridAutoFlow, GridTemplateAreas};
|
||||
pub use self::position::{GridAutoFlow, GridTemplateAreas, Position};
|
||||
pub use self::position::{PositionComponent, ZIndex};
|
||||
pub use self::pointing::Cursor;
|
||||
#[cfg(feature = "gecko")]
|
||||
pub use self::pointing::CursorImage;
|
||||
|
@ -518,24 +519,6 @@ impl ToCss for Integer {
|
|||
}
|
||||
}
|
||||
|
||||
/// <integer> | auto
|
||||
pub type IntegerOrAuto = Either<Integer, Auto>;
|
||||
|
||||
impl IntegerOrAuto {
|
||||
/// Parse `auto` or a positive integer.
|
||||
pub fn parse_positive<'i, 't>(
|
||||
context: &ParserContext,
|
||||
input: &mut Parser<'i, 't>,
|
||||
) -> Result<IntegerOrAuto, ParseError<'i>> {
|
||||
match IntegerOrAuto::parse(context, input) {
|
||||
Ok(Either::First(integer)) if integer.value() <= 0 => {
|
||||
Err(input.new_custom_error(StyleParseErrorKind::UnspecifiedError))
|
||||
}
|
||||
result => result,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// A wrapper of Integer, with value >= 1.
|
||||
pub type PositiveInteger = GreaterThanOrEqualToOne<Integer>;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue