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

Re: Custom Elements: 'data-' attributes

From: Anne van Kesteren <annevk@annevk.nl>
Date: Thu, 8 May 2014 10:37:05 +0100
Message-ID: <CADnb78iNwKUaHExjfzW2c58_4VXc8JF5HUXmvoOM04f7ytYL-w@mail.gmail.com>
To: Ryosuke Niwa <rniwa@apple.com>
Cc: Glenn Maynard <glenn@zewt.org>, Ian Hickson <ian@hixie.ch>, Wilson Page <wilsonpage@me.com>, Dimitri Glazkov <dglazkov@google.com>, "public-webapps@w3c.org" <public-webapps@w3c.org>
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

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