stylo: Use prefixed values in ExtremumLength

This commit is contained in:
Manish Goregaokar 2017-04-11 16:19:58 +08:00 committed by Manish Goregaokar
parent 7262270990
commit 9dbbb97ddd
2 changed files with 12 additions and 5 deletions

View file

@ -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 {