mirror of
https://github.com/servo/servo.git
synced 2025-08-16 10:55:34 +01:00
Bug 1374233 - Part 7: Add NonNegativeLengthOrPercentage.
For padding-{*} and grid-{*}-gap. MozReview-Commit-ID: 81G0b1k6JnD
This commit is contained in:
parent
9d69cb2866
commit
e72a0f126e
14 changed files with 123 additions and 20 deletions
|
@ -19,6 +19,7 @@ use values::{Auto, Either, ExtremumLength, None_, Normal};
|
|||
use values::computed::{Angle, LengthOrPercentage, LengthOrPercentageOrAuto};
|
||||
use values::computed::{LengthOrPercentageOrNone, Number, NumberOrPercentage, NonNegativeAu};
|
||||
use values::computed::{MaxLength, MozLength, Percentage};
|
||||
use values::computed::NonNegativeLengthOrPercentage;
|
||||
use values::computed::basic_shape::ShapeRadius as ComputedShapeRadius;
|
||||
use values::generics::{CounterStyleOrNone, NonNegative};
|
||||
use values::generics::basic_shape::ShapeRadius;
|
||||
|
@ -121,6 +122,16 @@ impl GeckoStyleCoordConvertible for LengthOrPercentage {
|
|||
}
|
||||
}
|
||||
|
||||
impl GeckoStyleCoordConvertible for NonNegativeLengthOrPercentage {
|
||||
fn to_gecko_style_coord<T: CoordDataMut>(&self, coord: &mut T) {
|
||||
self.0.to_gecko_style_coord(coord);
|
||||
}
|
||||
|
||||
fn from_gecko_style_coord<T: CoordData>(coord: &T) -> Option<Self> {
|
||||
LengthOrPercentage::from_gecko_style_coord(coord).map(NonNegative::<LengthOrPercentage>)
|
||||
}
|
||||
}
|
||||
|
||||
impl GeckoStyleCoordConvertible for Au {
|
||||
fn to_gecko_style_coord<T: CoordDataMut>(&self, coord: &mut T) {
|
||||
coord.set_value(CoordDataValue::Coord(self.0));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue