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

Re: Custom Elements: 'data-' attributes

From: Ryosuke Niwa <rniwa@apple.com>
Date: Wed, 07 May 2014 16:53:32 -0700
Cc: Ian Hickson <ian@hixie.ch>, Anne van Kesteren <annevk@annevk.nl>, Wilson Page <wilsonpage@me.com>, Dimitri Glazkov <dglazkov@google.com>, "public-webapps@w3c.org" <public-webapps@w3c.org>
Message-id: <44988CC0-F3A0-4913-A8F8-C0B58F03D291@apple.com>
To: Glenn Maynard <glenn@zewt.org>
On May 7, 2014, at 4:30 PM, Glenn Maynard <glenn@zewt.org> wrote:

> On Wed, May 7, 2014 at 5:07 PM, Ryosuke Niwa <rniwa@apple.com> wrote:
> There is a difference in people not caring about forward compatibility and polluting the global namespace, and not providing a mechanism to do it right in the first place.
> You'll always need to be able to declare attributes that the browser doesn't know about, for polyfills.

Sorry, I don't follow how that is relevant to this discussion.  Could you clarify what you mean?

> If we're encouraging authors to define their own attributes, then we should provide a mechanism or a guideline to do so in a forward compatible manner.
> Allowing isn't necessarily encouraging, and we do have a guideline: use data-*.  Be careful of falling into the trap of adding complexity to fix something that isn't actually a serious problem...

I mean... we can't disallow anyone from using arbitrary attribute name just the same way we can't disallow people to use arbitrary element name.
However, we specifically say authors shouldn't do that and use data-* instead now.

If you're proposing that we don't change that and we should continue to encourage authors to always use data-* attributes, then I'm fine with that.

However, I don't think that's being discussed here.  I think what's being discussed here is "whether or not it is safe to use custom attributes without the 'data-'".
The answer to that question, IMO, is no.  It's not safe to use custom attributes without 'data-' if one wanted to write a forward compatible HTML document.

- R. Niwa

Received on Wednesday, 7 May 2014 23:53:38 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 18:14:24 UTC