Closed
Bug 816012
Opened 13 years ago
Closed 13 years ago
Some JavaScript functions do not work properly on namespace-prefixed XHTML
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
RESOLVED
DUPLICATE
of bug 492933
People
(Reporter: development, Unassigned)
References
()
Details
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20100101 Firefox/16.0
Build ID: 20121026114414
Steps to reproduce:
I created the following two test snippets showing the problem clearly. Both use an equivalent DOM and the onload-Javascript is supposed to show the amount of p elements in the document. However, Firefox 16 does not get it right. The only difference is that (b) uses a namespace prefix to designate the XHTML namespace instead of declaring it as default namespace as in (a).
(a) http://sotecware.net/files/persistent/so-lxml-xhtml/js-test.xhtml
(b) http://sotecware.net/files/persistent/so-lxml-xhtml/js-test-prefixed.xhtml
Actual results:
in (a), the correct result (“1”) is shown, in (b), “0” is shown. This breaks a _lot_ of scripts, including jQuery and MathJax.
Expected results:
Both results should be the same, as the DOM is equivalent.
| Reporter | ||
Updated•13 years ago
|
Comment 1•13 years ago
|
||
http://www.w3.org/TR/DOM-Level-3-Core/
So Gecko does the correct thing per DOM 3 core. getElementsByTagName uses .tagName which
includes the prefix.
http://dom.spec.whatwg.org
DOM spec say .localName should be used.
Updated•13 years ago
|
Status: UNCONFIRMED → RESOLVED
Closed: 13 years ago
Resolution: --- → DUPLICATE
| Reporter | ||
Comment 3•13 years ago
|
||
I'm not sure you actually had a look on my example. I am expecting getElementsByTagName to match the localpart, as said in the referenced DOM spec:
> Thus, in an HTML document, document.getElementsByTagName("FOO") will match FOO elements that are not in the HTML namespace, and foo elements that are in the HTML namespace, but not FOO elements that are in the HTML namespace.
This is certainly not the case in Firefox, otherwise my example would work. Am I totally misreading the proposed Duplicate and the spec?
| Reporter | ||
Comment 4•13 years ago
|
||
Uhm, I'm sorry, didn't see the duplicate bug wasn't resolved yet. Ignore my comment and thanks for finding the dupe for me.
| Assignee | ||
Updated•12 years ago
|
Component: DOM: Other → DOM
| Assignee | ||
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•