Re: Custom Elements: 'data-' attributes

On Thu, May 8, 2014 at 12:53 AM, Ryosuke Niwa <rniwa@apple.com> wrote:
> 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.

Note that the question is scoped to custom elements, not elements in general.

It seems kind of sucky that if you have already minted a custom
element name, you still need to prefix all your attributes too.

<j-details open="">

reads a lot better than

<j-details data-open="">

The clashes are also likely to happen on the API side. E.g. if I mint
a custom element and support a property named selectable. If that gets
traction that might prevent us from introducing selectable as a global
attribute going forward.


-- 
http://annevankesteren.nl/

Received on Thursday, 8 May 2014 09:37:33 UTC