W3C home > Mailing lists > Public > public-html@w3.org > October 2009

Re: data-* attributes [was: Re: ISSUE-41/ACTION-97 decentralized-extensibility]

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Mon, 19 Oct 2009 12:11:12 -0500
Message-ID: <dd0fbad0910191011q6c47499bmbb0dbe6ad51a2828@mail.gmail.com>
To: Shelley Powers <shelley.just@gmail.com>
Cc: James Graham <jgraham@opera.com>, Leif Halvard Silli <xn--mlform-iua@xn--mlform-iua.no>, Anne van Kesteren <annevk@opera.com>, Adrian Bateman <adrianba@microsoft.com>, Jonas Sicking <jonas@sicking.cc>, Tony Ross <tross@microsoft.com>, "public-html@w3.org" <public-html@w3.org>
On Mon, Oct 19, 2009 at 11:31 AM, Shelley Powers <shelley.just@gmail.com> wrote:
> It is, but data-* does a poor job.
> SVGWeb can use a name, another JS library use the same name, and if a
> person wants to use both JS libraries together, they're screwed.
> The fact that data-* had no ability to enforce a consistent name clash
> prevention shows they're really not useful for decentralized
> extensibility.

I can't tell from searching around on the svgweb demos how it uses
data-* attributes, but this really shouldn't be a problem in practice.

If svgweb uses data-svgweb-* attributes, frex, then the chance of
clashing with another library is basically nil.  Before starting any
new library one should probably google for a bit to make sure that
one's preferred name for the project isn't already being used.

Before you can say that data-* is "really not useful for decentralized
extensibility", you'd have to show how, even with this basic friendly
practice of "self-namespacing", there were clashes in data-* attribute
naming in practice with half-significant libraries.  Preferably, you'd
show how this actually caused some authors some grief, such as through
bug reports or forum posts complaining.

I'll note that a similar practice is used in jQuery's plugin
architecture, and it generally works fine.  Even though everyone wants
their plugin to have a short name, there are just *so many* names to
choose from that it's pretty easy to find a good unique one.

I suspect that this style of self-policed namespacing is used widely
in this sort of space.  Have there been any notable failures?

Received on Monday, 19 October 2009 17:12:07 UTC

This archive was generated by hypermail 2.4.0 : Saturday, 9 October 2021 18:45:00 UTC