mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +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
|
@ -511,6 +511,19 @@ impl IntegerOrAuto {
|
|||
}
|
||||
}
|
||||
|
||||
/// A wrapper of Integer, but only accept a value >= 1.
|
||||
pub type PositiveInteger = GreaterThanOrEqualToOne<CSSInteger>;
|
||||
|
||||
impl From<CSSInteger> for PositiveInteger {
|
||||
#[inline]
|
||||
fn from(int: CSSInteger) -> PositiveInteger {
|
||||
GreaterThanOrEqualToOne::<CSSInteger>(int)
|
||||
}
|
||||
}
|
||||
|
||||
/// PositiveInteger | auto
|
||||
pub type PositiveIntegerOrAuto = Either<PositiveInteger, Auto>;
|
||||
|
||||
/// <length> | <percentage> | <number>
|
||||
pub type LengthOrPercentageOrNumber = Either<Number, LengthOrPercentage>;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue