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

On Thu, 07 Nov 2013 15:59:29 +0100, Jirka Kosek <jirka@kosek.cz> wrote:

> On 7.11.2013 13:35, Simon Pieters wrote:
>> Nobody suggested it would be a solution. What was under discussion was
>> trying to demonstrate that there is a problem that needs a solution in
>> the first place. For the Selectors API, I think it hasn't been
>> demonstrated yet.
>
> For ITS implementation it's necessary to have ability to select
> attributes because attributes are part of HTML/XML documents and can
> contain text for translation. ITS tools running in a browser are using
> Selectors API to evaluate ITS rules that are using Selectors as a query
> language.

OK, that seems reasonable. Thank you.

So the stated use case for selecting attributes with the Selectors API is  
an ITS implementation in JS that uses Selectors API, and you want to  
select alt/title/data-* etc attributes with Selectors instead of XPath. Is  
that correct?

Are there ITS implementations in JS intended to be used in a browser?

> As Selectors and thus Selectors API currently doesn't support
> selection of attributes there is a problem which needs solution.
>
> If you don't see problem here then please be prepared to explain to
> "average Joe webdeveloper" why he can't use familiar selectors and has
> to learn another and more complex query language called XPath.
>
> Success of CSS and selectors was great. Selectors became query language
> of web pages -- approach pioneered by some JS libraries and later on
> standardized by Selectors API. But such success also means
> responsibility of maintainers of Selectors to cater for those non-CSS
> usages of Selectors.
>
> I think it has been clearly demonstrated that there is a need and
> use-cases for Selectors to support selection of attribute nodes in a
> document. I'm happy to discuss about concrete syntax for this feature or
> technical problems that implementation might cause. But simply stating
> that you personally don't see problem when others have it is not a
> productive way forward.

I think it is useful to get a common understanding of the problems we're  
trying to solve.

-- 
Simon Pieters
Opera Software

Received on Friday, 8 November 2013 13:50:33 UTC