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

On Mon, Nov 24, 2014 at 4:29 PM, Tab Atkins Jr. <jackalmage@gmail.com> wrote:
> Because of this confused identity, pseudo-elements don't work well
> with our abstractions.  If you want both the <a> and <b> children of
> an element, you can write `foo > *:matches(a,b)`.  But if you want the
> ::before and ::after pseudo-elements of an element, there's no real
> equivalent - it's impossible to first transform the match set into one
> that contains the pseudo-elements in question, and then write a
> :matches() argument that'll match them.

In a just world, I could write `foo :: *:matches(before, after)`,
because ::before and ::after would be normal elements in the
pseudo-tree, with tagnames and everything, and then all of this would
Just Work™.  Yet more evidence that this is not the best of all
possible worlds.

(Some of you might recall that I tried to make this happen a few years
ago, but the exceptions needed to make existing code like `::before
{...}` work were too much.)

~TJ

Received on Tuesday, 25 November 2014 00:34:07 UTC