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
This commit is contained in:
Emilio Cobos Álvarez 2023-05-27 06:55:41 +02:00 committed by Oriol Brufau
parent a6f9a364db
commit 0cc049946e

View file

@ -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, &current_layer);
pushed += 1;
}
for _ in 0..pushed {
current_layer.0.pop();
}
}