From b89c2be4bd35003a67e2183c61fe6f9feca4b522 Mon Sep 17 00:00:00 2001 From: Ziran Sun Date: Thu, 20 Oct 2022 13:54:33 +0000 Subject: [PATCH] style: @container rules should support not without parentheses We are currently detect 'not' as part of the container-name. Differential Revision: https://phabricator.services.mozilla.com/D159836 --- components/style/values/specified/box.rs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/components/style/values/specified/box.rs b/components/style/values/specified/box.rs index 9e8c3e85340..dba587cc99e 100644 --- a/components/style/values/specified/box.rs +++ b/components/style/values/specified/box.rs @@ -1499,7 +1499,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; @@ -1561,12 +1561,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())) }