Re: Custom Elements: 'data-' attributes

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