W3C home > Mailing lists > Public > www-style@w3.org > August 2014

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

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Fri, 8 Aug 2014 17:57:36 -0700
Message-ID: <CAAWBYDDJ8pxhWDmU351b0oWFeUOzu36AhMnXnd9y8Ch_N4Q1ig@mail.gmail.com>
To: www-style list <www-style@w3.org>
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

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:45 UTC