mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
stylo: Use prefixed values in ExtremumLength
This commit is contained in:
parent
7262270990
commit
9dbbb97ddd
2 changed files with 12 additions and 5 deletions
|
@ -201,7 +201,14 @@ ${helpers.predefined_type("flex-basis",
|
||||||
${MinMax}Length::${initial}
|
${MinMax}Length::${initial}
|
||||||
}
|
}
|
||||||
fn parse(context: &ParserContext, input: &mut Parser) -> Result<SpecifiedValue, ()> {
|
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 {
|
impl ToCss for SpecifiedValue {
|
||||||
|
|
|
@ -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,
|
// A type for possible values for min- and max- flavors of width,
|
||||||
// height, block-size, and inline-size.
|
// height, block-size, and inline-size.
|
||||||
define_css_keyword_enum!(ExtremumLength:
|
define_css_keyword_enum!(ExtremumLength:
|
||||||
"max-content" => MaxContent,
|
"-moz-max-content" => MaxContent,
|
||||||
"min-content" => MinContent,
|
"-moz-min-content" => MinContent,
|
||||||
"fit-content" => FitContent,
|
"-moz-fit-content" => FitContent,
|
||||||
"fill-available" => FillAvailable);
|
"-moz-available" => FillAvailable);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue