style: Use rust lengths for row-gap / column-gap.

Differential Revision: https://phabricator.services.mozilla.com/D26915
This commit is contained in:
Emilio Cobos Álvarez 2019-04-10 16:00:03 +00:00
parent 0f57b7b833
commit 0a84073767
8 changed files with 48 additions and 72 deletions

View file

@ -219,3 +219,38 @@ impl<L, N: Zero> Zero for LengthOrNumber<L, N> {
}
}
}
/// A generic `<length-percentage>` | normal` value.
#[derive(
Animate,
Clone,
ComputeSquaredDistance,
Copy,
Debug,
MallocSizeOf,
Parse,
PartialEq,
SpecifiedValueInfo,
ToAnimatedValue,
ToAnimatedZero,
ToComputedValue,
ToCss,
ToResolvedValue,
ToShmem,
)]
#[repr(C, u8)]
#[allow(missing_docs)]
pub enum GenericLengthPercentageOrNormal<LengthPercent> {
LengthPercentage(LengthPercent),
Normal,
}
pub use self::GenericLengthPercentageOrNormal as LengthPercentageOrNormal;
impl<LengthPercent> LengthPercentageOrNormal<LengthPercent> {
/// Returns the normal value.
#[inline]
pub fn normal() -> Self {
LengthPercentageOrNormal::Normal
}
}