W3C home > Mailing lists > Public > www-dom@w3.org > October to December 2012

[Bug 19431] Namespace of elements made via .createElement() in XML documents must be null

From: <bugzilla@jessica.w3.org>
Date: Thu, 11 Oct 2012 19:25:25 +0000
To: www-dom@w3.org
Message-ID: <bug-19431-4009-XlWSSODwBy@http.www.w3.org/Bugs/Public/>
https://www.w3.org/Bugs/Public/show_bug.cgi?id=19431

Aryeh Gregor <ayg@aryeh.name> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|WONTFIX                     |---

--- Comment #6 from Aryeh Gregor <ayg@aryeh.name> ---
Testing in IE 10 Developer Preview, Firefox 19.0a1, Chrome 23ish dev, Opera
Next 12.50 internal.  Tests in IE actually use a simple PHP script that sets
the header, since it doesn't support data URLs for this.  I tested IE in both
IE10 browser/document mode, and IE9 browser/document mode (not actual IE9).


This is "string http://www.w3.org/1999/xhtml" in all browsers:

data:text/html,<!DOCTYPE html>
<script>
var s = document.createElement("x").namespaceURI;
document.documentElement.textContent = 
typeof s + " " + s;
</script>


This is the HTML namespace in all five as well:

data:application/xhtml+xml,<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head><script>
var s = document.createElement("x").namespaceURI;
document.documentElement.textContent =
typeof s + " " + s;
</script></head><body></body></html>

But if you change the MIME type to "application/xml", it becomes null in
IE9/Gecko/WebKit while staying the same in IE10/Opera.


This is still the HTML namespace in all five, removing the xmlns after the
fact:

data:application/xhtml+xml,<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head><script>
document.documentElement.removeAttribute("xmlns");
var s = document.createElement("x").namespaceURI;
document.documentElement.textContent =
typeof s + " " + s;
</script></head><body></body></html>


This is the HTML namespace in IE10, but null in IE9/Gecko/WebKit/Opera:

data:application/xml,<!DOCTYPE html>
<html>
<head><script xmlns="http://www.w3.org/1999/xhtml">
var s = document.createElement("x").namespaceURI;
document.documentElement.textContent =
typeof s + " " + s;
</script></head><body></body></html>

But if I change the MIME type to application/xhtml+xml, it changes to the HTML
namespace in IE9/Gecko/WebKit as well, while remaining null in Opera.


So it looks to me like in IE10 standards mode, the HTML namespace is always
returned in every case I tested.  In IE9/Gecko/WebKit, the default namespace is
determined by the MIME type that the page is served with.  In Opera it's
dependent on the namespace of the initial root element, regardless of MIME
type.  IE10 and Opera are not as likely to be web-compatible as the other
three.  I move we standardize IE9/Gecko/WebKit -- it's the dominant behavior,
and not really so much more complicated than what we have now, and what we have
now matches no one but IE10 (probably because they changed to follow the spec).


Sill to be determined before we can write a spec: what happens if the document
is created with document.implementation.createDocument?

-- 
You are receiving this mail because:
You are on the CC list for the bug.
Received on Thursday, 11 October 2012 19:25:27 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Thursday, 11 October 2012 19:25:29 GMT