Re: Possible Compromise solution for namespaces in HTML5

On Sat, 21 Nov 2009 17:06:21 -0500, Sam Ruby wrote:
> Leif Halvard Silli wrote:
>> 
>> I just wondered if Maciej or anyone that have looked at that 
>> suggestion had any idea about what would happen if the <body> 
>> element was given a namespace. 
> 
> I took the page, modified it only to wrap the inline scripts as 
> CDATA, and make the results available here, served as 
> application/xhtml+xml:
> 
> http://intertwingly.net/stories/2009/11/21/chromium.html
> 
> Try it in your favorite browser.

It is interesting to see why/how it fails:

* the page's background color disappears. Namespace aware 
  text/HTML UAs should however wrap the jotspot <body> element in
  a <body> in XHTML namespace and bring back the background color.
* the layout table is in the jotspot namespace and needs direct  
  styling of the table elements to restores the layout.
* one of the <script> elements is lacking the XHTML namespace and 
  therefore becomes visible.
* the CSS class selector is linked to @class in XHTML/HTML, and so
  doesn't work for @class in the jotspot namespace.

An algorithm to avoid the problems of default namespaces on a <body> 
that is clearly meant to be a XHTML namespace body: 

If a <body> element lives in a default, foreign namespace and is the 
first child of the XHTML namespace <body> element, then ... disable the 
effect by one of these options: 

 - convert the element or its namespace in a predefined way. 
   E.g. delete the namespace and concatenate the foreign namespace
   <body> and the XHTML <body> into one XHTML <body> element. 
   That way any possible ID or CLASS in the foreign <body>
   would be transferred to the DOM created HTML <body>.
 - Or e.g convert the second body element to a prefixed element
   in the XHTML namespace.
 - Or, don't touch the namespace, but make unknown namespaces 
   work differently from in XML by e.g. letting an element which
   has the same name as an element in HTML, default to the same 
   CSS styling. Also, in CSS, react to the class selector 
   for these elements. Authors would be able to overrule
   these CSS rules. I guess this approach could fail for 
   JavaScript, though.

Are there others than Google Sites that does the same thing that makes 
this worthwhile?
-- 
leif halvard silli

Received on Monday, 23 November 2009 01:55:13 UTC