W3C home > Mailing lists > Public > www-style@w3.org > October 2008

Re: pseudo-attributes

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Thu, 30 Oct 2008 14:17:33 -0700
Message-ID: <490A246D.30609@mit.edu>
To: "Tab Atkins Jr." <jackalmage@gmail.com>
CC: www-style@w3.org

Tab Atkins Jr. wrote:
> If I'm reading it right, all of the data-* attributes are there, and 
> dataset is merely a convenience attribute.  Without it, you'd always 
> have to use array notation to access those properties, due to the hyphen 
> in the names..  Frex, elem["data-id"] vs elem.dataset.id 
> <http://elem.dataset.id>.

As far as I can tell, elem.dataset.id is elem.getAttributeNS(null, 
"data-id"), but elem["data-id"] is undefined unless the page sets it or 

> Can arbitrary DOM properties be matched against efficiently?

Hard to say, and introduces weird circularity issues:

   div[offsetWidth=25] { width: 50 }

and so forth...

Received on Thursday, 30 October 2008 21:18:19 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:27:40 UTC