Re: [selectors][css-namespaces][css-scoping] Clash between Namespaces and Scoping regarding implied universal selector

On 08/08/2014 05:57 PM, Tab Atkins Jr. wrote:
> On Fri, Aug 8, 2014 at 5:25 PM, Tab Atkins Jr. <jackalmage@gmail.com> wrote:
>> 1. Change implementations so that they really don't imply the
>> universal selector, so that in the above example the elements will
>> disappear on hover.  This will only have an effect on pages that (a)
>> declare a default namespace in CSS, (b) use elements not in that
>> namespace, and (c) use selectors without type selectors.
>>
>> 2. Define that an element's namespace is *separate from* its type, and
>> that featureless elements match all namespaces.  (If the universal
>> selector isn't implied, then default namespaces become the sole way to
>> specify a namespace in a selector without also specifying a type, so
>> we don't have to worry about anything else changing meaning or getting
>> weird.)
>
> Ooh, came up with a third one that's maybe less weird.
>
> 3. Very slightly tweak the definition of default namespace, so that it
> instead says that, if a compound selector does not otherwise specify a
> namespace, that compound selector can only match elements withe the
> default namespace or that are featureless.

I'm looking over the wording in the spec, and I don't see why we
can't continue to imply the universal selector as before, as long
as we define featureless elements to match all namespaces?

Or alternately, define pseudos that match featureless elements to
inhibit the universal selector.

> Related to this, I note that :matches() explicitly says that the
> default namespace does not apply to its arguments, presumably so you
> can type something like "*|div:matches(:hover, :active)" rather than
> "*|div:matches(*|*:hover, *|*:active)".  Should we apply this to all
> selector arguments, so that default namespaces only apply to top-level
> selectors in style rules?  This isn't necessary in order to accept my
> #3 tweak; I'm just afraid we'll have inconsistent behavior otherwise.

Just fixed this. That statement was relying on the assumption that
:matches() can't accept a complex selector.

~fantasai

Received on Thursday, 20 August 2015 04:11:53 UTC