diff --git a/components/style/values/specified/length.rs b/components/style/values/specified/length.rs index 26eb45e9201..1abc5e36c23 100644 --- a/components/style/values/specified/length.rs +++ b/components/style/values/specified/length.rs @@ -343,6 +343,13 @@ impl Parse for Length { } } +impl Either { + #[inline] + pub fn parse_non_negative_length(input: &mut Parser) -> Result, ()> { + Length::parse_internal(input, AllowedNumericType::NonNegative).map(Either::First) + } +} + #[derive(Clone, Debug)] pub struct CalcSumNode { pub products: Vec, @@ -946,13 +953,6 @@ impl Parse for LengthOrPercentageOrNone { pub type LengthOrNone = Either; -impl LengthOrNone { - #[inline] - pub fn parse_non_negative(input: &mut Parser) -> Result { - Length::parse_internal(input, AllowedNumericType::NonNegative).map(Either::First) - } -} - #[derive(Clone, PartialEq, Copy, Debug)] #[cfg_attr(feature = "servo", derive(HeapSizeOf))] pub enum LengthOrPercentageOrAutoOrContent {