The default bug view has changed. See this FAQ.

setAttributeNS("unknown", "align") after setAttributeNS(null, "align") changes return value of getAttribute("align")

NEW
Unassigned

Status

()

Core
DOM
7 years ago
5 years ago

People

(Reporter: Gavin, Unassigned)

Tracking

({testcase})

Trunk
testcase
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(URL)

I don't know what the justification is for this test's expected results ("DOM L2 Core" is all that's listed), but apparently we're the only browser that fails it:

http://samples.msdn.microsoft.com/ietestcenter/#domcore
This only happens for "mapped attributes". DOM 2 Core doesn't actually define the correct behavior here.
Summary: setAttributeNS("unknown", "foo") after setAttributeNS(null, "foo") changes return value of getAttribute("foo") → setAttributeNS("unknown", "align") after setAttributeNS(null, "align") changes return value of getAttribute("align")
The second attribute of setAttributeNS (or createElementNS, for that matter) is a qualified name - prefix plus local name.

DOM 3 Core backs us up on this.
http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core.html#ID-ElSetAttrNS
Oh, I see... it's because they're using getAttribute() (DOM Level 1) with setAttributeNS() (DOM Level 2).  The getAttribute() method isn't particularly well suited to work with setAttributeNS, because the latter uses namespaces, and the former doesn't.

"Calling Element.getAttribute(name)  with that nodeName could then return any of those attributes. The result depends on the implementation."
http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core.html#Namespaces-Considerations
Yeah, this test is bogus, imo.  At least pending some sort of errata to the DOM specs defining the behavior.

Comment 5

7 years ago
So, if the conclusion is that the test is invalid, we should ask Microsoft to remove it, right?

Comment 6

7 years ago
I sent an email to my MS contact.
What this test is _actually_ testing is that a certain ordering is imposed on attributes with the same localname but different namespace URIs (at least in terms of the lookup order for getAttribute).  The DOM does not guarantee such an ordering.  So yes, we should ask Microsoft to remove the test.

Comment 8

7 years ago
I did send this information to Travis, and he promised to forward it to whoever
maintains that page.

Comment 9

7 years ago
It's still there... but of course that is expected. Every second of showing a faulty score to our disadvantage makes IE9 seem better.
That is unfortunate indeed, but what can we do if MS decides to put invalid
testcase to their web page, and not react too fast to comments to fix the pages.

Comment 11

5 years ago
The current DOM specification does impose some kind of ordering for what it's worth. setAttribute/setAttributeNS calls append attributes to an ordered list.
You need to log in before you can comment on or make changes to this bug.