W3C home > Mailing lists > Public > public-html@w3.org > September 2013

Making all elements and attributes that contain hyphens valid

From: Robin Berjon <robin@w3.org>
Date: Thu, 19 Sep 2013 17:18:46 +0200
Message-ID: <523B15D6.6000403@w3.org>
To: "HTML WG (public-html@w3.org)" <public-html@w3.org>
Hi all,

I opened a bug about this[0] but I'd like it to see broader discussion.

As per Web Components today[1], elements that contain a hyphen in their 
names are clearly laid open for third-party extensibility (a few 
exceptions are listed, grandfathered from MathML and SVG).

I'd be more comfortable if HTML were the one to make that promise, and 
also if it made it more explicitly. Furthermore, I think that the 
logical conclusion from that is that where validators are concerned, 
elements containing hyphens ought to always just be considered valid.

Additionally, I believe we should make the same commitment for 
attributes. Currently we have data-* attributes, but those are not meant 
for software that's distinct from the site or application that uses them 
(i.e. they're not usable for general purpose extensions, and that's a 
good thing).

Making hyphen attributes valid in all cases (minus existing ones such as 
aria-* and those from SVG/MathML) would allow third parties to produce 
their own using weak (but sufficient) namespacing (e.g. epub-*). It 
won't hurt HTML since we're already committed to not use hyphens in 
names anyway.

Naturally, it would be useful to advise such third parties that they 
would be better off getting any generally useful such attribute 
standardised. But it provides a valuable escape hatch for when there is 
no agreement to introduce such features into HTML. Right now the 
alternatives are:

     1) Use namespaces; bad idea, forces XHTML.
     2) Use data-$prefix-*; bad idea, not meant for that.

The impact on user agents is zero, only validators are impacted.


[0] https://www.w3.org/Bugs/Public/show_bug.cgi?id=23254

Robin Berjon - http://berjon.com/ - @robinberjon
Received on Thursday, 19 September 2013 15:18:54 UTC

This archive was generated by hypermail 2.4.0 : Saturday, 9 October 2021 18:46:05 UTC