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

The Scoping spec defined the :host pseudo-class and the concept of a
"host element" in a shadow tree.  The host element is *featureless*
which means it doesn't have a tagname/attributes/etc.  This means that
it doesn't match the * selector either.  (This is intentional - we
want targetting of the host element to always be purposeful and
require the :host pseudo-class.)

This implies that we changed the Selectors spec to no longer always
imply the universal selector; otherwise, :host would actually mean
*:host, and wouldn't match.  This was fine, but I hadn't made the
actual wording changes yet.

Now that I'm doing so, I notice a clash with CSS Namespaces - if
there's a default namespace defined, it applies to the universal
selector as well, *including the implied universal selector*. (And
Firefox and Chrome, at least, implement this
<http://software.hixie.ch/utilities/js/live-dom-viewer/?saved=3113>)

This means that, to get correct behavior wrt default namespaces, we
*do* need an implied universal selector.  There's no way to easily
resolve this conflict.

I have two suggestions for how to fix it. One requires a small change
to implementations, the other slightly complicates the spec's model. I
don't have a strong opinion on which to use.

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.)

Which solution does the WG prefer?

~TJ

Received on Saturday, 9 August 2014 00:26:45 UTC