Ticket #3462 (closed task: worksforme)

Opened 22 months ago

Last modified 21 months ago

Format/XML.js tests fail in Chromium

Reported by: erilem Owned by:
Priority: major Milestone: 2.11 Release
Component: tests Version: 2.11 RC2
Keywords: Cc:
State:

Description

test_Format_XML_createElementNS planned 5 assertions but got 0; fail 0 ok 0
exception: : object: INVALID_CHARACTER_ERR: DOM Exception 5

It'd be good to know if other webkit-based browsers are also affected.

Change History

  Changed 21 months ago by ahocevar

Fails as well in Safari 5.1 on OSX.

  Changed 21 months ago by ahocevar

But it does not always fail. Strange.

  Changed 21 months ago by ahocevar

There seems to be a disagreement across the library whether to use createElementNS with prefix:localname as 2nd argument, or just localname. The proper use of both xmldom.createNode and document.createElementNS, which are called by Format.XML::createElementNS depending on which browser is used. The API docs of Format.XML::createElementNS demand prefix:localname.

follow-up: ↓ 5   Changed 21 months ago by ahocevar

The above comment misses a few words. Here is the correct version: There seems to be a disagreement across the library whether to use createElementNS with prefix:localname as 2nd argument, or just localname. Both is used. The proper use of xmldom.createNode and document.createElementNS, which are called by Format.XML::createElementNS depending on which browser is used, is just localname. The API docs of Format.XML::createElementNS demand prefix:localname.

in reply to: ↑ 4   Changed 21 months ago by tschaub

Replying to ahocevar:

The above comment misses a few words. Here is the correct version: There seems to be a disagreement across the library whether to use createElementNS with prefix:localname as 2nd argument, or just localname. Both is used. The proper use of xmldom.createNode and document.createElementNS, which are called by Format.XML::createElementNS depending on which browser is used, is just localname. The API docs of Format.XML::createElementNS demand prefix:localname.

I'm a bit confused by this comment. Our createElementNS method should be called with a qualified name (e.g. "alias:foo"). The  createElementNS docs say second arg is a qualified name (example uses "html:div") and the  MS docs say name should be qualified for ELEMENT_NODE (see remarks section).

I see that the GeoRSS, KML, ArcXML, and OSM formats use the default namespace - but I think that "foo" is still a legitimate qualified name. (And Google Earth demands the default namespace iirc.)

I'm still not seeing Format/XML.html test failures. But I'll try more browsers.

  Changed 21 months ago by ahocevar

Thanks Tim for the explanation on this. I was missing several pieces when I wrote this comment.

  1. I didn't see that GeoRSS, KML, ArcXML and OSM formats use the default namespace
  2. My sources of wisdom were the  W3Schools example (which seems to be incorrect) and the  MS docs example (which doesn't use a namespace).

Having said that, I just confirmed that Tim is right, by looking at the  DOM Level 2 Core Spec:

// Introduced in DOM Level 2:
  Element            createElementNS(in DOMString namespaceURI, 
                                     in DOMString qualifiedName)
                                        raises(DOMException);

Strangely enough, while I was able to get the above error message occasionally a few days ago in Safari 5.1, I wasn't able to get it again today. Which makes me think we should just close this issue and assume that it's a browser bug.

  Changed 21 months ago by erilem

  • status changed from new to closed
  • resolution set to worksforme

Tests pass for me again in Chromium. Not sure what has changed since the last time I ran the tests in Chromium. Thanks guys for looking at this.

Note: See TracTickets for help on using tickets.