W3C home > Mailing lists > Public > www-style@w3.org > March 2015

[selectors4] Not clear where pseudo-elements fit in

From: L. David Baron <dbaron@dbaron.org>
Date: Mon, 23 Mar 2015 15:40:17 -0700
To: www-style@w3.org
Message-ID: <20150323224017.GA1091@pescadero.dbaron.org>
I was trying to read selectors4 to determine whether a
pseudo-element inside of :host-context() [1] made the selector
invalid (or just never matched... I think).

I reached http://dev.w3.org/csswg/selectors-4/#structure , and found
that compound selectors do not include pseudo-elements, which I
believe answers my question to my satisfaction (and matches Gecko's
current implementation of :-moz-any()).

However, I then noticed that nothing in that section mentions
pseudo-elements at all, so it's not clear that my interpretation is

http://dev.w3.org/csswg/selectors-3/#selector-syntax , on the other
hand, does say that pseudo-elements fit in at the "complex selector"
level (level 3's "selector"), which makes it more clear that they're
intentionally not included as part of a "compound selector".

I think it would probably be good to have similar wording, and maybe
even something clearer, in Level 4, so that it's clear that
pseudo-elements are not part of a "compound selector" and thus their
presence in a <compound-selector> [2] is a parse error.

(Unless, of course, the opposite is intended, in which case that
should be clear.)


[1] http://dev.w3.org/csswg/css-scoping/#selectordef-host-context
    which links to [2]
[2] http://dev.w3.org/csswg/selectors-4/#typedef-compound-selector

𝄞   L. David Baron                         http://dbaron.org/   𝄂
𝄢   Mozilla                          https://www.mozilla.org/   𝄂
             Before I built a wall I'd ask to know
             What I was walling in or walling out,
             And to whom I was like to give offense.
               - Robert Frost, Mending Wall (1914)

Received on Monday, 23 March 2015 22:40:41 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:52:06 UTC