From Bugzilla Helper: User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9.1) Gecko/20010607 Netscape6/6.1b1 BuildID: 2001-06-07-13-0.9.1 no exception was thrown when using setNamedItem() . i attached testcase to demonstrate this bug. Reproducible: Always Steps to Reproduce: 1.load the page http://h-208-12-38-201/cdex049.html 2. 3. Actual Results: no exception thrown Expected Results: expected "INUSE_ATTRIBUTE_ERR" to be thrown
Not a show stopper, Future.
Here's why I think the testcase in this bug is invalid: SetNamedItem() (and SetNamedItemNS()) throw the following exceptions: * NO_MODIFICATION_ALLOWED_ERR: Raised if this map is readonly. * INUSE_ATTRIBUTE_ERR: Raised if arg is an Attr that is already an attribute of another Element object. The DOM user must explicitly clone Attr nodes to re-use them in other elements. Since the NamedNodeMap we are talking about is Node.attributes, which is readonly, we have to throw NO_MODIFICATION_ALLOWED_ERR (which is the subject of bug 85776), so we shouldn't throw INUSE_ATTRIBUTE_ERR. However this bug could be valid if we morphed it to be a bug about nsXMLNamedNodeMap which needs to throw this exception (and the patch I attached in bug 123232 doesn't do it)
Mass-reassigning bugs to email@example.com
The testcase is valid, see bug 85776 comment 7.
There's two problems in setNamedItem (and setNamedItemNS). The code doesn't check if the node that's passed in has an ownerElement and it doesn't set the ownerElement on the node after it's been added.
Comment on attachment 131794 [details] [diff] [review] v1 sr=jst
Comment on attachment 131794 [details] [diff] [review] v1 r=sicking