W3C home > Mailing lists > Public > public-html@w3.org > July 2007

Re: Why HTML should be taught as HTML without pretending it is XML

From: Simon Pieters <simonp@opera.com>
Date: Mon, 23 Jul 2007 20:47:03 +0200
To: "Robert Burns" <rob@robburns.com>
Cc: "Jon Barnett" <jonbarnett@gmail.com>, public-html <public-html@w3.org>
Message-ID: <op.tvxk4pz5idj3kv@hp-a0a83fcd39d2>

On Mon, 23 Jul 2007 20:21:21 +0200, Robert Burns <rob@robburns.com> wrote:

>> Consistency is not an issue.
>>
>> The issue is that, per spec, createElement() creates an element *in no  
>> namespace*. Not in the HTML namespace. Only Safari follows the spec on  
>> this point. Firefox uses the HTML namespace if the Document node  
>> implements the HTMLDocument interface (which is when you use  
>> application/xhtml+xml). Opera uses the same namespace as the root  
>> element's namespace.
>>
>>    http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-2141741547
>>
>
> It certainly is a matter of consistency. If one sticks with only non- 
> namespace method calls, it will work with all three of those approaches

It won't. If you say e.g. document.createElement("input"), it will not be  
a form control in Safari (which is per spec). It will not implement the  
HTMLInputElement interface, nor the HTMLElement interface for that matter.  
It is equivalent to having <input xmlns=""/> in the markup. It does not  
matter if you only use non-namespeced methods through-out and only one  
namespace in the document -- createElement() will never create HTML  
elements in an XML context.

> [...]

-- 
Simon Pieters
Opera Software
Received on Monday, 23 July 2007 18:49:20 UTC

This archive was generated by hypermail 2.3.1 : Monday, 29 September 2014 09:38:47 UTC