Re: [webcomponents] Use x:: instead of x-?

On Wed, 09 May 2012 22:25:29 +0200, Kornel Lesiński <kornel@geekhood.net>  
wrote:

> <x-bikeshed>
>
>
> Would it be possible to use "::" instead of the "x-" prefix in custom  
> element names? i.e. allow any name as long as it contains "::" somewhere:
>
> <foo::bar>

This isn't namespace-well-formed XML.

> or
>
> <button is="foo::bar">
>
>
> 1. The "::" is used for pseudo-elements in CSS, and for namespaces in  
> C++, both of which seem somewhat related.

This means that you can't target it without escaping in selectors.

foo\:\:bar

> 2. "x-" is (subjectively) ugly, and has been used for experimental  
> extensions elsewhere. IMHO it's a bit of an eye-sore in the otherwise  
> elegant design.

I agree that "x-" is not awesome.

> 3. document.createElement('::foo') works.

With createElementNS it doesn't.

> <foo::> parses (unfortunately <::foo> doesn't).
>
>
> Use of "::" would naturally allow some namespacing of reusable  
> components:
>
> <jqueryui::widget>
> </jqueryui::widget>
>
> (not True Namespaces in the XML sense, but IMHO that's also a good  
> thing). If I understand correctly, serialisation of "::" in XML isn't a  
> problem, as XML documents could use the is="" attribute instead.

This violates the DOM Consistency design principle.

The colon in element and attribute names is trouble. We should try hard to  
avoid it.

-- 
Simon Pieters
Opera Software

Received on Thursday, 10 May 2012 07:18:26 UTC