mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
style: Derive more stuff for clip rects.
I feel a bit weird for using LenghtPercentageOrAuto to implement LengthOrAuto, but I don't think much other code will use it so it seemed a bit better to me. Differential Revision: https://phabricator.services.mozilla.com/D21863
This commit is contained in:
parent
e723a5b7d6
commit
e0b3e5f691
8 changed files with 143 additions and 254 deletions
|
@ -15,7 +15,7 @@ use crate::values::generics::length::{
|
|||
use crate::values::generics::NonNegative;
|
||||
use crate::values::specified::length::ViewportPercentageLength;
|
||||
use crate::values::specified::length::{AbsoluteLength, FontBaseSize, FontRelativeLength};
|
||||
use crate::values::{specified, Auto, CSSFloat, Either, Normal};
|
||||
use crate::values::{specified, CSSFloat, Either, Normal};
|
||||
use crate::Zero;
|
||||
use app_units::Au;
|
||||
use ordered_float::NotNan;
|
||||
|
@ -701,7 +701,10 @@ impl From<Au> for CSSPixelLength {
|
|||
pub type Length = CSSPixelLength;
|
||||
|
||||
/// Either a computed `<length>` or the `auto` keyword.
|
||||
pub type LengthOrAuto = Either<Length, Auto>;
|
||||
pub type LengthOrAuto = generics::GenericLengthPercentageOrAuto<Length>;
|
||||
|
||||
/// Either a non-negative `<length>` or the `auto` keyword.
|
||||
pub type NonNegativeLengthOrAuto = generics::GenericLengthPercentageOrAuto<NonNegativeLength>;
|
||||
|
||||
/// Either a computed `<length>` or a `<number>` value.
|
||||
pub type LengthOrNumber = GenericLengthOrNumber<Length, Number>;
|
||||
|
@ -779,9 +782,6 @@ impl From<NonNegativeLength> for Au {
|
|||
}
|
||||
}
|
||||
|
||||
/// Either a computed NonNegativeLength or the `auto` keyword.
|
||||
pub type NonNegativeLengthOrAuto = Either<NonNegativeLength, Auto>;
|
||||
|
||||
/// Either a computed NonNegativeLength or the `normal` keyword.
|
||||
pub type NonNegativeLengthOrNormal = Either<NonNegativeLength, Normal>;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue