mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Introduce style::values::generics::rect ▭
This defines a single type Rect<T> which allows us to abstract over CSS values made of four sides top, right, bottom and left.
This commit is contained in:
parent
e9c5860808
commit
7a214831f0
10 changed files with 169 additions and 105 deletions
|
@ -1180,6 +1180,12 @@ impl LengthOrNumber {
|
|||
|
||||
Length::parse_non_negative(context, input).map(Either::First)
|
||||
}
|
||||
|
||||
/// Returns `0`.
|
||||
#[inline]
|
||||
pub fn zero() -> Self {
|
||||
Either::Second(Number::new(0.))
|
||||
}
|
||||
}
|
||||
|
||||
/// A value suitable for a `min-width` or `min-height` property.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue