isDefaultNamespace and lookupNamespaceURI fail on XHTML element before it is inserted into the XHTML DOM tree

RESOLVED DUPLICATE of bug 312019

Status

()

Core
DOM: Core & HTML
RESOLVED DUPLICATE of bug 312019
7 years ago
6 years ago

People

(Reporter: Martin Honnen, Unassigned)

Tracking

Trunk
x86
Windows 7
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(1 attachment)

1.57 KB, application/xhtml+xml
Details
(Reporter)

Description

7 years ago
Created attachment 546310 [details]
test case

The test I am going to attach is an XHTML (application/xhtml+xml) document that uses document.createElementNS('http://www.w3.org/1999/xhtml', 'div') to create a new XHTML div element.

It then tests element.isDefaultNamespace(element.namespaceURI) and element.lookupNamespaceURI(element.prefix) twice, once before appending the element to the document's body, once after appending the element.

With Safari 5, Opera 11.5, Chrome 12 the result of those two function calls are "true" and "http://www.w3.org/1999/xhtml" both before and after inserting the element into the DOM tree.

With Firefox (tested with latest release version 5 as well as with a current nightly 8.0a1 (2011-07-15)) the results differ, before the element is inserted isDefaultNamespace returns "false", lookupNamespaceURI returns "null". After the insertion into the DOM tree the results with Mozilla are the same as with other browsers.

Looking at http://www.w3.org/TR/DOM-Level-3-Core/namespaces-algorithms.html#lookupNamespaceURIAlgo it seems that element.lookupNamespaceURI(element.prefix) where prefix is "null" should return the element's namespace, independent of the element having any ancestor nodes or not.

So this looks like a bug in Mozilla's DOM implementation.
(Reporter)

Comment 1

7 years ago
I have also now tested with IE 9, it behaves the same as Safari, Opera and Chrome.

Updated

7 years ago
Is this a duplicate of bug 312019?
Depends on: 312019
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 312019
You need to log in before you can comment on or make changes to this bug.