style: Use Rust sizes for flex-basis, width, height, and their min/max properties.

Really sorry for the size of the patch :(

Only intentional behavior change is in the uses of HasLengthAndPercentage(),
where it's easier to do the right thing. The checks that used to check for
(IsCalcUnit() && CalcHasPercentage()) are wrong since bug 957915.

Differential Revision: https://phabricator.services.mozilla.com/D19553
This commit is contained in:
Emilio Cobos Álvarez 2019-02-10 13:55:16 +01:00
parent e12c76982d
commit f7a59bf0ee
9 changed files with 70 additions and 106 deletions

View file

@ -96,14 +96,17 @@ impl<LengthPercentage: Parse> Parse for LengthPercentageOrAuto<LengthPercentage>
ToComputedValue,
ToCss,
)]
pub enum Size<LengthPercentage> {
LengthPercentage(LengthPercentage),
#[repr(C, u8)]
pub enum GenericSize<LengthPercent> {
LengthPercentage(LengthPercent),
Auto,
#[cfg(feature = "gecko")]
#[animation(error)]
ExtremumLength(ExtremumLength),
}
pub use self::GenericSize as Size;
impl<LengthPercentage> Size<LengthPercentage> {
/// `auto` value.
#[inline]
@ -134,14 +137,17 @@ impl<LengthPercentage> Size<LengthPercentage> {
ToComputedValue,
ToCss,
)]
pub enum MaxSize<LengthPercentage> {
LengthPercentage(LengthPercentage),
#[repr(C, u8)]
pub enum GenericMaxSize<LengthPercent> {
LengthPercentage(LengthPercent),
None,
#[cfg(feature = "gecko")]
#[animation(error)]
ExtremumLength(ExtremumLength),
}
pub use self::GenericMaxSize as MaxSize;
impl<LengthPercentage> MaxSize<LengthPercentage> {
/// `none` value.
#[inline]