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

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

From: Simon Pieters <simonp@opera.com>
Date: Thu, 10 May 2012 09:17:46 +0200
To: public-webapps@w3.org, Kornel Lesiński <kornel@geekhood.net>
Message-ID: <op.wd2zvwckidj3kv@simons-macbook-pro.local>
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 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:52 GMT