mirror of
https://github.com/servo/servo.git
synced 2025-08-12 08:55:32 +01:00
Bug 1374233 - Part 6: Add PositiveInteger and PositiveIntegerOrAuto for column-count.
column-count should be a positive integer or auto. MozReview-Commit-ID: 9LFvrYo8De5
This commit is contained in:
parent
190cd5b952
commit
9d69cb2866
7 changed files with 49 additions and 9 deletions
|
@ -717,6 +717,19 @@ impl IntegerOrAuto {
|
|||
}
|
||||
}
|
||||
|
||||
/// A wrapper of Integer, with value >= 1.
|
||||
pub type PositiveInteger = GreaterThanOrEqualToOne<Integer>;
|
||||
|
||||
impl Parse for PositiveInteger {
|
||||
#[inline]
|
||||
fn parse<'i, 't>(context: &ParserContext, input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i>> {
|
||||
Integer::parse_positive(context, input).map(GreaterThanOrEqualToOne::<Integer>)
|
||||
}
|
||||
}
|
||||
|
||||
/// PositiveInteger | auto
|
||||
pub type PositiveIntegerOrAuto = Either<PositiveInteger, Auto>;
|
||||
|
||||
#[allow(missing_docs)]
|
||||
pub type UrlOrNone = Either<SpecifiedUrl, None_>;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue