From 0cc049946eb9f1554bd3f5db00d65419a35f2f9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Sat, 27 May 2023 06:55:41 +0200 Subject: [PATCH] style: Fix layer statement with nested layer names When we had: @layer A.B; We were registering "A" and "B", not "A" and "A.B", which was the intention. Fix is trivial. Depends on D124620 Differential Revision: https://phabricator.services.mozilla.com/D124621 --- components/style/stylist.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/components/style/stylist.rs b/components/style/stylist.rs index cd05ee42f76..4be6e035378 100644 --- a/components/style/stylist.rs +++ b/components/style/stylist.rs @@ -2404,9 +2404,13 @@ impl CascadeData { } LayerRuleKind::Statement { ref names } => { for name in &**names { + let mut pushed = 0; for name in name.layer_names() { current_layer.0.push(name.clone()); maybe_register_layer(self, ¤t_layer); + pushed += 1; + } + for _ in 0..pushed { current_layer.0.pop(); } }