Convert column-width to use Either

Fixes #14350
This commit is contained in:
J. Cliff Dyer 2016-11-28 07:21:11 -05:00 committed by Ravi Shankar
parent f159b5cb10
commit 5821ff77db
8 changed files with 38 additions and 97 deletions

View file

@ -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::{CSSFloat, Either, FONT_MEDIUM_PX, HasViewportPercentage, None_};
use values::{Auto, CSSFloat, Either, FONT_MEDIUM_PX, HasViewportPercentage, None_};
use values::computed::Context;
pub use super::image::{AngleOrCorner, ColorStop, EndingShape as GradientEndingShape, Gradient};
@ -345,7 +345,7 @@ impl Parse for Length {
impl<T> Either<Length, T> {
#[inline]
pub fn parse_non_negative_length(input: &mut Parser) -> Result<Either<Length, T>, ()> {
pub fn parse_non_negative_length(_context: &ParserContext, input: &mut Parser) -> Result<Self, ()> {
Length::parse_internal(input, AllowedNumericType::NonNegative).map(Either::First)
}
}
@ -953,6 +953,8 @@ impl Parse for LengthOrPercentageOrNone {
pub type LengthOrNone = Either<Length, None_>;
pub type LengthOrAuto = Either<Length, Auto>;
#[derive(Clone, PartialEq, Copy, Debug)]
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
pub enum LengthOrPercentageOrAutoOrContent {