Bug 1729289 - Fix layer statement with nested layer names. r=boris

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 2021-09-08 11:17:04 +00:00
Родитель f4095b3242
Коммит 1fc2475b41
3 изменённых файлов: 4 добавлений и 8 удалений

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

@ -2429,9 +2429,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();
}
}

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

@ -1,4 +1,2 @@
[layer-basic.html]
prefs: [layout.css.cascade-layers.enabled:true]
[E4 Statement syntax]
expected: FAIL

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

@ -1,8 +1,2 @@
[layer-import.html]
prefs: [layout.css.cascade-layers.enabled:true]
[D5 Layer statement with imports]
expected: FAIL
[D6 Layer statement with imports]
expected: FAIL