Can I take this one? I created a test in content/base/test from a similar one in the same directory. It triggers a bug and fails in two places now: 1. When removeAttributeNode() not throws exception when it called with 'foreign' attr object as argument. 2. When node was deleted after such call. Test checks removing of attribute with a same name in two elements. Would it be useful to check removing with different names? I can't find sources for removeAttributeNode() for now. I used ack/ag since 'hg grep' search through all commits. There are idl files dom/interfaces/core/nsIDOMElement.idl and dom/webidl/Element.webidl with metioned function, but it is just interface descriptions. Where can I find it?
RemoveAttributeNode is implemented at http://mxr.mozilla.org/mozilla-central/source/content/base/src/Element.cpp#1027.
@Boris: Use http://dxr.mozilla.org/mozilla-central/source/ to search for source.
So I made some investigation. Element::RemoveAttributeNode() takes Attr, use its NodeInfo to extract namespaceURI and LocalName, and pass this two nsAString's to nsDomAttributeMap::RemoveNamedItemNS(). Later calls do not use any other information about attribute except its name. I can't found any way to check if specific attribute belongs to element. Is there any method for this?
Created attachment 8554265 [details] [diff] [review] Patch to solve bug + mochitest With help of the user Ms2ger in IRC I found needed method and a way to throw error. Looks like this patch fixes problem.
@bz is a mentor for this bug, so I probably should set him as a reviewer from the beginning..
Comment on attachment 8554265 [details] [diff] [review] Patch to solve bug + mochitest This looks great, thanks!
Looks good, apart from things that were also broken on inbound on the parent of that push.