W3C home > Mailing lists > Public > whatwg@whatwg.org > April 2007

[whatwg] Attribute for holding private data for scripting

From: Sam Ruby <rubys@intertwingly.net>
Date: Tue, 10 Apr 2007 16:41:12 -0400
Message-ID: <3d4032300704101341n398af8b3w704b8faa62b80b7e@mail.gmail.com>
On 4/10/07, Anne van Kesteren <annevk at opera.com> wrote:
> On Tue, 10 Apr 2007 20:21:27 +0200, Sam Ruby <rubys at intertwingly.net>
> wrote:
> >> Or allow any attribute that starts with "x_" or something (to prevent
> >> clashing with future revisions of HTML), as private attributes.
> >
> > Instead of "starts with x_", how about "contains a colon"?
> >
> > A conformance checker could ensure that there is a corresponding xmlns
> > declaration that applies here, and possibly even do additional
> > verification if it recognizes the namespace.
> >
> > An HTML5 parser would, of course, recover from references to
> > undeclared namespaces, placing the entire attribute name (including
> > the prefix and the colon) into the DOM in such situations.
>
> * That would be confusing to people familiar with XML;
> * It would hinder the ability to exchange scripts between HTML and XML;
> * It would create more differences between XML and HTML where less seems
>    to be desired (trailing slash allowed, etc.).

How so?

The idea is to place these attributes into the DOM the same way as
they would be when parsed with an xml parser, for the cases where the
data happens to be namespace valid.  And to do what you would expect
in the cases where, for example, attribute values aren't quoted.  And
to follow the html5 credo of "recover at all cost" in cases where what
the user entered doesn't conform.

This would of course need to be spec'ed, AND compared against common
usage, AND prototyped; I simply ask that it not be rejected out of
hand.

- Sam Ruby
Received on Tuesday, 10 April 2007 13:41:12 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:58:54 UTC