Bug 1790055 - @container rules should support not without parentheses. r=emilio

We are currently detect 'not' as part of the container-name.

Differential Revision: https://phabricator.services.mozilla.com/D159836
This commit is contained in:
Ziran Sun 2022-10-20 13:54:33 +00:00
Родитель d167696f69
Коммит a4248fe12c
2 изменённых файлов: 7 добавлений и 20 удалений

Просмотреть файл

@ -1525,7 +1525,7 @@ bitflags! {
/// TODO: block-size is on the spec but it seems it was removed? WPTs don't
/// support it, see https://github.com/w3c/csswg-drafts/issues/7179.
pub struct ContainerType: u8 {
/// The `none` variant.
/// The `normal` variant.
const NORMAL = 0;
/// The `inline-size` variant.
const INLINE_SIZE = 1 << 0;
@ -1587,12 +1587,11 @@ impl Parse for ContainerName {
first,
DISALLOWED_CONTAINER_NAMES,
)?);
while let Ok(ident) = input.try_parse(|input| input.expect_ident_cloned()) {
idents.push(CustomIdent::from_ident(
location,
&ident,
DISALLOWED_CONTAINER_NAMES,
)?);
while let Ok(name) = input.try_parse(|input| {
let ident = input.expect_ident()?;
CustomIdent::from_ident(location, &ident, DISALLOWED_CONTAINER_NAMES)
}) {
idents.push(name);
}
Ok(ContainerName(idents.into()))
}

Просмотреть файл

@ -94,17 +94,5 @@
[Container name: None]
expected: FAIL
[name not (width <= 500px)]
expected: FAIL
[Container name: foo]
expected: FAIL
[Container name: foo]
expected: FAIL
[Container name: foo ]
expected: FAIL
[not (width: 100px)]
[Container name: foo foo]
expected: FAIL