From 731706041d770c36c295c942f9c75e88aa599a07 Mon Sep 17 00:00:00 2001 From: Nick Price Date: Fri, 9 Dec 2016 17:57:20 -0500 Subject: [PATCH] Add LengthOrNormal type aliases --- components/style/values/computed/length.rs | 4 +++- components/style/values/specified/length.rs | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/components/style/values/computed/length.rs b/components/style/values/computed/length.rs index 3ba131409f88..a7ec7f5ba22b 100644 --- a/components/style/values/computed/length.rs +++ b/components/style/values/computed/length.rs @@ -7,7 +7,7 @@ use ordered_float::NotNaN; use std::fmt; use style_traits::ToCss; use super::{Number, ToComputedValue, Context}; -use values::{Auto, CSSFloat, Either, None_, specified}; +use values::{Auto, CSSFloat, Either, None_, Normal, specified}; pub use cssparser::Color as CSSColor; pub use super::image::{EndingShape as GradientShape, Gradient, GradientKind, Image}; @@ -475,4 +475,6 @@ pub type LengthOrAuto = Either; pub type LengthOrNumber = Either; +pub type LengthOrNormal = Either; + pub type Length = Au; diff --git a/components/style/values/specified/length.rs b/components/style/values/specified/length.rs index f8f237ab4019..40fb57a4963a 100644 --- a/components/style/values/specified/length.rs +++ b/components/style/values/specified/length.rs @@ -14,7 +14,7 @@ use std::ops::Mul; use style_traits::ToCss; use style_traits::values::specified::AllowedNumericType; use super::{Angle, Number, SimplifiedValueNode, SimplifiedSumNode, Time}; -use values::{Auto, CSSFloat, Either, FONT_MEDIUM_PX, HasViewportPercentage, None_}; +use values::{Auto, CSSFloat, Either, FONT_MEDIUM_PX, HasViewportPercentage, None_, Normal}; use values::computed::Context; pub use super::image::{AngleOrCorner, ColorStop, EndingShape as GradientEndingShape, Gradient}; @@ -952,6 +952,8 @@ impl Parse for LengthOrPercentageOrNone { pub type LengthOrNone = Either; +pub type LengthOrNormal = Either; + pub type LengthOrAuto = Either; #[derive(Clone, PartialEq, Copy, Debug)]