Re: pseudo-attributes

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 
something.

> Can arbitrary DOM properties be matched against efficiently?

Hard to say, and introduces weird circularity issues:

   div[offsetWidth=25] { width: 50 }

and so forth...

-Boris

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