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

On 06/11/13 21:28, Simon Pieters wrote:

> Can you please provide real examples where people select attributes in
> JS and would benefit from this proposal? Can you demonstrate that people
> are working around the lack of this feature (e.g. JS frameworks that use
> Selectors with an extension like this)?
> 
> I understand the ITS use case, but it's not clear to me that ITS is
> something that Selectors should be catering for at this point. I don't
> have anything against ITS per se, but I think it's useful to question if
> it's a need that is relevant for the Web at large or just a niche thing.

ITS has a mechanism called "global" rules that is quite similar to CSS
rules. It can associate ITS instructions to selected nodes. ITS define
two different selecting mechanisms, XPath and Selectors. The problem is
that Selectors do not offer the feature level of XPath, in particular
about attribute nodes' selection. For the time being, the whole set of
rules is defined in an XML instance but it makes little sense to keep
it like that if the selecting mechanism is CSS... Authors should be
able to use a CSS-like language with Selectors and ITS properties and
values. And since CSS is the preferred selecting mechanism for all web
developers, we need a way to select attribute nodes *not in CSS* but in
*Selectors*. CSS would use a profile of Selectors excluding attribute
nodes' selection while ITS would use it. QuerySelector is a different
issue since it does not rely on CSS as a whole but only on Selectors.
Since the CSS WG explicitely designed Selectors from level 3 to be used
by other specs but CSS (and that's *exactly* why we removed "CSS" from
the spec's title of Selectors, this makes sense.

</Daniel>

Received on Wednesday, 6 November 2013 20:44:09 UTC