[whatwg] namespaces in html5

Aryeh Gregor Simetrical+w3c at gmail.com
Mon Jul 18 12:20:21 PDT 2011


On Mon, Jul 18, 2011 at 10:33 AM, David Karger <karger at mit.edu> wrote:
> Yes, we could,  but it doesn't address the two objections I raised to data-
> prefix:
> 1.  it isn't actually a data attribute, so prefixing with data seems odd
> (appearance; minor)

It's "data" in the sense that it's being used to just store some info
in the DOM without asking the browser to do anything extra with it.

> 2.  there's no way to guarantee someone else won't use the same data-exhibit
> prefix, causing incompatibilities (functionality; major)

There's also no way to guarantee someone else won't use the same URL
for their namespace.  But in either case, they almost certainly won't.
 If you're really paranoid, feel free to stick a GUID or domain name
or something inside the names of all your data attributes.  But the
probability data-exhibit-* will ever collide with anything is already
negligible.

On Mon, Jul 18, 2011 at 2:23 PM, David Karger <karger at mit.edu> wrote:
> As I interpret these words, data- attributes are intended to be delivered by
> a server for use by the javascript code that server delivers with the page.
>
> The exhibit attributes are not associated with any server, and are not
> associated with any particular data items being delivered by any server.
>  Rather, they are part of  "generic software not associated with" the server
> (see quote above)  and handle _presentation_ of the content on the page.
>
> So, while it might be technically valid to use data- prefixes, it doesn't
> seem to fit the intention.

I don't get how you're using these attributes.  Do you expect
browsers, search engines, or other consumers of HTML to treat them
differently from any unrecognized attribute?  Or do you intend that
the attributes only be used by the scripts/stylesheets/etc. provided
by your own site?  If your use-case is the former, then you should
propose the attributes for standardization.  If the latter, it's
exactly what data-* was designed for.



More information about the whatwg mailing list