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

Re: [selectors-nonelement] First draft of a new spec for selecting non-element nodes

From: Andrew Fedoniouk <news@terrainformatica.com>
Date: Sat, 15 Feb 2014 20:47:20 -0800
Message-ID: <CALRQH7874R6Kgr7SRBPgB+-5OGt_cn7gtUd_os1UNuf60Pc4vQ@mail.gmail.com>
To: Brad Kemper <brad.kemper@gmail.com>
Cc: "Tab Atkins Jr." <jackalmage@gmail.com>, Daniel Glazman <daniel.glazman@disruptive-innovations.com>, www-style list <www-style@w3.org>
On Sat, Feb 15, 2014 at 4:00 PM, Brad Kemper <brad.kemper@gmail.com> wrote:
> On Feb 14, 2014, at 4:40 PM, "Tab Atkins Jr." <jackalmage@gmail.com> wrote:
>
>>> Although entirely valid in Selectors used in the scope of CSS,
>>>  attribute node pseudo-elements never generate boxes.
>
> Doesn't that have more to do with the restrictions of HTML than of CSS? Some other theoretical XML-based document language could use CSS to create boxes out of attributes, couldn't it?

Pseudo-elements in CSS always select, well, pseudo-elements, with
the purpose to define some properties of them. By introducing ::attr() we
create precedent of defining selectors not for CSS realm.

If someone need to select attributes (why not text/comment nodes
too by the way?) then it is matter of writing trivial functions like:
document.queryAttribute = function(elselector,attribute) { .. }

Otherwise we need to mention cases like this:

  input[type="number"]::attr(type) { content:"text" }

etc.  Either we need to treat ::attr() as first-class pseudo-elements
or left them shine in DOM methods or libraries like jquery.

-- 
Andrew Fedoniouk.

http://terrainformatica.com
Received on Sunday, 16 February 2014 04:47:47 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:39:19 UTC