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

Re: [selectors] Assistance requested in figuring out the data model of pseudo-elements

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Tue, 25 Nov 2014 14:31:54 -0800
Message-ID: <CAAWBYDDWQwQXGwFQP4cewPtk40HU3kzVM=8eVeOpbQso5UGBtA@mail.gmail.com>
To: Benjamin Poulain <benjamin@webkit.org>
Cc: www-style list <www-style@w3.org>
On Tue, Nov 25, 2014 at 1:44 PM, Benjamin Poulain <benjamin@webkit.org> wrote:
>> If we do this, then my example of the just world would work, and I
>> wouldn't have to explain why one kinda-combinator is allowed in
>> :matches() but no other, and why the order of selectors matters if
>> :matches() contains a pseudo-element.
> I am confused with this last paragraph. Aren't all combinators already
> allowed in :matches()?
> The definition says the argument is simply a selector list. WebKit allows
> any combinator in :matches(). Using combinators in :matches() is super
> useful, we already use that a lot.

Yes, but the subject of the matches is the last thing in each complex
selector; in `a:matches(b > .foo)`, the ".foo" element has to be the
same as the "a" element; the "b" element is an ancestor.  In
`a:matches(::before)`, though, that's not the intent - the ::before is
*not* the same as the "a" element, it's a sub-element(ish).

This is why I'm talking about making :: actually a combinator, into
the pseudo-tree.  Then you can switch the match set to be the
pseudo-elements of an element, before trying to match :matches()
against it.

Received on Tuesday, 25 November 2014 22:32:41 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:51:49 UTC