From 9dbbb97ddddd098a93f8fc91fbca37a0fe188e6d Mon Sep 17 00:00:00 2001 From: Manish Goregaokar Date: Tue, 11 Apr 2017 16:19:58 +0800 Subject: [PATCH] stylo: Use prefixed values in ExtremumLength --- components/style/properties/longhand/position.mako.rs | 9 ++++++++- components/style/values/mod.rs | 8 ++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/components/style/properties/longhand/position.mako.rs b/components/style/properties/longhand/position.mako.rs index cd42e56fcf2..6b0551fcc1a 100644 --- a/components/style/properties/longhand/position.mako.rs +++ b/components/style/properties/longhand/position.mako.rs @@ -201,7 +201,14 @@ ${helpers.predefined_type("flex-basis", ${MinMax}Length::${initial} } fn parse(context: &ParserContext, input: &mut Parser) -> Result { - ${MinMax}Length::parse(context, input).map(SpecifiedValue) + let ret = ${MinMax}Length::parse(context, input); + // Keyword values don't make sense in the block direction; don't parse them + % if "block" in size: + if let Ok(${MinMax}Length::ExtremumLength(..)) = ret { + return Err(()) + } + % endif + ret.map(SpecifiedValue) } impl ToCss for SpecifiedValue { diff --git a/components/style/values/mod.rs b/components/style/values/mod.rs index f5c5186ca5d..f3dd7089830 100644 --- a/components/style/values/mod.rs +++ b/components/style/values/mod.rs @@ -192,7 +192,7 @@ impl ToComputedValue for Either { // A type for possible values for min- and max- flavors of width, // height, block-size, and inline-size. define_css_keyword_enum!(ExtremumLength: - "max-content" => MaxContent, - "min-content" => MinContent, - "fit-content" => FitContent, - "fill-available" => FillAvailable); + "-moz-max-content" => MaxContent, + "-moz-min-content" => MinContent, + "-moz-fit-content" => FitContent, + "-moz-available" => FillAvailable);