W3C home > Mailing lists > Public > public-webapps@w3.org > April to June 2014

Re: Custom Elements: 'data-' attributes

From: Ian Hickson <ian@hixie.ch>
Date: Wed, 7 May 2014 19:03:34 +0000 (UTC)
To: Anne van Kesteren <annevk@annevk.nl>
cc: Wilson Page <wilsonpage@me.com>, Dimitri Glazkov <dglazkov@google.com>, public-webapps@w3c.org
Message-ID: <alpine.DEB.2.00.1405071856131.11724@ps20323.dreamhostps.com>
On Wed, 7 May 2014, Anne van Kesteren wrote:
> On Tue, May 6, 2014 at 7:19 PM, Wilson Page <wilsonpage@me.com> wrote:
> > I'm unsure whether or not it is safe to use custom attributes without 
> > the 'data-', I've heard mixed opinions. How do we know that chosen 
> > attributes won't someday be global attributes?
> Yeah, we should figure something out here. From one perspective you've 
> already namespaced your element by using a dash. However, given the 
> existence of an ever growing set of global attributes you probably do 
> not want to clash with those.
> Maybe we should allow any attribute as long as it contains a dash (and 
> does not match a set of existing names)? Still seems somewhat 
> suboptimal.

Requiring a dash is pretty ugly. I would allow any attribute, and we'll 
just have to be careful when introducing new global ones.

We only introduce them at the rate of ~one per year if you treat 
namespaced groups of attributes like event handlers, microdata, or ARIA as 
single units (which they more or less are, for this problem, I think).

Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Wednesday, 7 May 2014 19:03:57 UTC

This archive was generated by hypermail 2.3.1 : Friday, 27 October 2017 07:27:12 UTC