Making all elements and attributes that contain hyphens valid

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.

Thoughts?

[0] https://www.w3.org/Bugs/Public/show_bug.cgi?id=23254
[1] 
https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/custom/index.html#dfn-custom-element-type

-- 
Robin Berjon - http://berjon.com/ - @robinberjon

Received on Thursday, 19 September 2013 15:18:54 UTC