Bug 1374233 - Part 1: Add NonNegativeNumber and GreaterThanOrEqualToOneNumber.

NonNegativeNumber: for -moz-box-flex, flex-grow, and flex-shrink.
GreaterThanOrEqualToOneNumber: for stroke-miterlimit.

MozReview-Commit-ID: Kgbt99BPdVA
This commit is contained in:
Boris Chiou 2017-07-19 19:45:24 +08:00
parent 50c9797ddd
commit 4cc97746f2
12 changed files with 181 additions and 26 deletions

View file

@ -252,3 +252,13 @@ impl ToCss for FontSettingTagFloat {
self.0.to_css(dest)
}
}
/// A wrapper of Non-negative values.
#[derive(Clone, Copy, Debug, HasViewportPercentage, PartialEq, PartialOrd, ToComputedValue, ToCss)]
#[cfg_attr(feature = "servo", derive(HeapSizeOf, Deserialize, Serialize))]
pub struct NonNegative<T>(pub T);
/// A wrapper of greater-than-or-equal-to-one values.
#[derive(Clone, Copy, Debug, HasViewportPercentage, PartialEq, PartialOrd, ToComputedValue, ToCss)]
#[cfg_attr(feature = "servo", derive(HeapSizeOf, Deserialize, Serialize))]
pub struct GreaterThanOrEqualToOne<T>(pub T);