[csswg-drafts] [css-nesting][css-selectors] Behavior of & with a default namespace? (#9806)

Loirooriol has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-nesting][css-selectors] Behavior of & with a default namespace? ==
https://drafts.csswg.org/selectors/#type-nmsp

> If a [default namespace](https://drafts.csswg.org/css-namespaces-3/#default-namespace) is declared, [compound selectors](https://drafts.csswg.org/selectors/#compound) without [type selectors](https://drafts.csswg.org/selectors/#type-selector) in them still only match elements in that default namespace.

https://drafts.csswg.org/css-nesting/#nest-selector defines a `&` selector (which is not a type selector).

Then, consider

```css
@namespace url("http://example.com/foo");
svg|a {
  &:hover {}
}
```

`&:hover` has no type selector, so as per Selectors, it won't match a `svg|a:hover`.

But I think it's supposed to match to be consistent with what @tabatkins is saying in https://github.com/w3c/csswg-drafts/issues/5684 and https://github.com/w3c/csswg-drafts/issues/9804

Possibly, Selectors should say something like

> If a [default namespace](https://drafts.csswg.org/css-namespaces-3/#default-namespace) is declared, [compound selectors](https://drafts.csswg.org/selectors/#compound) without [type selectors](https://drafts.csswg.org/selectors/#type-selector) <ins>nor `&` selectors</ins> in them still only match elements in that default namespace.

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/9806 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Wednesday, 17 January 2024 00:00:26 UTC