Re: Document.createElement: null or HTML namespace?

On Tue, 2014-10-07 at 14:57 -0400, Philippe Le Hegaret wrote:
> > 1) Are none of these tests specifically testing createElement on a 
> > non-HTML document?
> 
> I didn't find one indeed but will send a PR later today to fill the gap.

Here it is:
 https://github.com/w3c/web-platform-tests/pull/1276

But I ran into troubles...

The DOM spec says that createDocument creates XMLDocument, so I wrote 3
tests to look at namespaceURI.

1) createDocument(null, null, null).createElement("A")

everyone agrees it is null.

2) createDocument("http://www.w3.org/1999/xhtml", "html",
null).createElement("A")

firefox says null. chrome/safari and opera say
"http://www.w3.org/1999/xhtml". IE says NamespaceError.

3) createDocument("http://www.w3.org/2000/svg", "svg",
null).createElement("A")

firefox and chrome/safari say null. Opera says
"http://www.w3.org/2000/svg". IE says NamespaceError.

With that in mind, we know what 1) needs to say. What about 2 and 3?

Philippe

PS: Opera is the old presto engine.

Received on Tuesday, 7 October 2014 21:01:34 UTC