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

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.

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.

Alternately, back to #1, just don't apply default namespaces when
there's no type selector.

~TJ

Received on Saturday, 9 August 2014 00:58:24 UTC