style: Don't allow auto in grid line names.

See https://github.com/w3c/csswg-drafts/issues/2856.

Differential Revision: https://phabricator.services.mozilla.com/D9882
This commit is contained in:
Emilio Cobos Álvarez 2018-10-28 23:26:53 +00:00
parent 26040d1b00
commit a9af61e3be
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
2 changed files with 4 additions and 2 deletions

View file

@ -120,7 +120,9 @@ impl Parse for GridLine<specified::Integer> {
if val_before_span || grid_line.ident.is_some() { if val_before_span || grid_line.ident.is_some() {
return Err(location.new_custom_error(StyleParseErrorKind::UnspecifiedError)); return Err(location.new_custom_error(StyleParseErrorKind::UnspecifiedError));
} }
grid_line.ident = Some(CustomIdent::from_ident(location, &name, &[])?); // NOTE(emilio): `span` is consumed above, so we only need to
// reject `auto`.
grid_line.ident = Some(CustomIdent::from_ident(location, &name, &["auto"])?);
} else { } else {
break; break;
} }

View file

@ -95,7 +95,7 @@ pub fn parse_line_names<'i, 't>(
while let Ok((loc, ident)) = input.try(|i| -> Result<_, CssParseError<()>> { while let Ok((loc, ident)) = input.try(|i| -> Result<_, CssParseError<()>> {
Ok((i.current_source_location(), i.expect_ident_cloned()?)) Ok((i.current_source_location(), i.expect_ident_cloned()?))
}) { }) {
let ident = CustomIdent::from_ident(loc, &ident, &["span"])?; let ident = CustomIdent::from_ident(loc, &ident, &["span", "auto"])?;
values.push(ident); values.push(ident);
} }