style: Let logical height, block-size, accept keywords.

We should let block-size/min-block-size/max-block-size accept keywords as the
initial value, just like width in vertical writing mode or height in horizontal
writing mode.

Differential Revision: https://phabricator.services.mozilla.com/D14320
This commit is contained in:
Boris Chiou 2018-12-18 18:47:39 +00:00 committed by Emilio Cobos Álvarez
parent b7e728abd0
commit 627559546d
2 changed files with 0 additions and 33 deletions

View file

@ -244,21 +244,12 @@ ${helpers.predefined_type(
if logical: if logical:
spec = "https://drafts.csswg.org/css-logical-props/#propdef-%s" spec = "https://drafts.csswg.org/css-logical-props/#propdef-%s"
%> %>
// NOTE: Block-size doesn't support -moz-*-content keywords, since they make
// no sense on the block axis, but it simplifies things the have that it has
// the same type as the other properties, since otherwise we'd need to
// handle logical props where the types are different, which looks like a
// pain.
% if product == "gecko": % if product == "gecko":
<%
parse_function = "parse" if size != "block-size" else "parse_disallow_keyword"
%>
// width, height, block-size, inline-size // width, height, block-size, inline-size
${helpers.predefined_type( ${helpers.predefined_type(
size, size,
"MozLength", "MozLength",
"computed::MozLength::auto()", "computed::MozLength::auto()",
parse_function,
logical=logical, logical=logical,
logical_group="size", logical_group="size",
allow_quirks=not logical, allow_quirks=not logical,
@ -272,7 +263,6 @@ ${helpers.predefined_type(
"min-%s" % size, "min-%s" % size,
"MozLength", "MozLength",
"computed::MozLength::auto()", "computed::MozLength::auto()",
parse_function,
logical=logical, logical=logical,
logical_group="min-size", logical_group="min-size",
allow_quirks=not logical, allow_quirks=not logical,
@ -284,7 +274,6 @@ ${helpers.predefined_type(
"max-%s" % size, "max-%s" % size,
"MaxLength", "MaxLength",
"computed::MaxLength::none()", "computed::MaxLength::none()",
parse_function,
logical=logical, logical=logical,
logical_group="max-size", logical_group="max-size",
allow_quirks=not logical, allow_quirks=not logical,

View file

@ -1256,17 +1256,6 @@ impl Parse for MozLength {
} }
impl MozLength { impl MozLength {
/// Parses, without quirks, and disallowing ExtremumLength values.
///
/// Used for logical props in the block direction.
pub fn parse_disallow_keyword<'i, 't>(
context: &ParserContext,
input: &mut Parser<'i, 't>,
) -> Result<Self, ParseError<'i>> {
let length = LengthOrPercentageOrAuto::parse_non_negative(context, input)?;
Ok(GenericMozLength::LengthOrPercentageOrAuto(length))
}
/// Parses, with quirks. /// Parses, with quirks.
pub fn parse_quirky<'i, 't>( pub fn parse_quirky<'i, 't>(
context: &ParserContext, context: &ParserContext,
@ -1308,17 +1297,6 @@ impl Parse for MaxLength {
} }
impl MaxLength { impl MaxLength {
/// Parses, without quirks, and disallowing ExtremumLength values.
///
/// Used for logical props in the block direction.
pub fn parse_disallow_keyword<'i, 't>(
context: &ParserContext,
input: &mut Parser<'i, 't>,
) -> Result<Self, ParseError<'i>> {
let length = LengthOrPercentageOrNone::parse_non_negative(context, input)?;
Ok(GenericMaxLength::LengthOrPercentageOrNone(length))
}
/// Parses, with quirks. /// Parses, with quirks.
pub fn parse_quirky<'i, 't>( pub fn parse_quirky<'i, 't>(
context: &ParserContext, context: &ParserContext,