Skip to content

Commit

Permalink
stylo: Use prefixed values in ExtremumLength
Browse files Browse the repository at this point in the history
  • Loading branch information
Manishearth committed Apr 12, 2017
1 parent 7262270 commit 9dbbb97
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
9 changes: 8 additions & 1 deletion components/style/properties/longhand/position.mako.rs
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,14 @@ ${helpers.predefined_type("flex-basis",
${MinMax}Length::${initial}
}
fn parse(context: &ParserContext, input: &mut Parser) -> Result<SpecifiedValue, ()> {
${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 {
Expand Down
8 changes: 4 additions & 4 deletions components/style/values/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ impl<A: ToComputedValue, B: ToComputedValue> ToComputedValue for Either<A, B> {
// 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);

0 comments on commit 9dbbb97

Please sign in to comment.