Re: [selectors4] Proposal for extending Selectors Level 4 with possibility to select attributes

On Tue, 2013-11-05 at 07:40 +0100, Daniel Glazman wrote:
[...]
> Even if we already think of future extensions to your ::attr(),
> I still think that we could, for once, harmonize our syntax better with
> what all other languages do. And using @ to note or select an attribute
> became something rather universal... Again, for once, it's probably
> worth consuming that extra delimitor.

I expect that as CSS selectors become more pervasive people will need to
select the other DOM node types too, not only elements and attributes
but e.g. processing instructions, comments, text nodes, entities...

So maybe select(text, _selector_), or maybe just add text(), node(),
processng-instruction() etc.; the @foo as shorthand for attribute(foo)
is popular.

Of course, people also want the ability to do "joins", find me the first
div.order that contains a span element whose "id" attribute is the same
as the current div element's first span.customer-id child's data-ref
attribute...Maybe CSS doesn't need to go that far.

Liam

-- 
Liam Quin - XML Activity Lead, W3C, http://www.w3.org/People/Quin/
Pictures from old books: http://fromoldbooks.org/
Ankh: irc.sorcery.net irc.gnome.org freenode/#xml

Received on Tuesday, 5 November 2013 07:53:29 UTC