INUSE_ATTRIBUTE_ERR expected when using setNamedItem()

RESOLVED FIXED in mozilla1.6alpha

Status

()

Core
DOM: Core & HTML
P3
normal
RESOLVED FIXED
17 years ago
9 years ago

People

(Reporter: Sivakiran Tummala, Assigned: peterv)

Tracking

({testcase})

Trunk
mozilla1.6alpha
testcase
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(2 attachments)

(Reporter)

Description

17 years ago
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
(Reporter)

Comment 1

17 years ago
Created attachment 38582 [details]
testcase
Not a show stopper, Future.
Target Milestone: --- → Future

Comment 3

16 years ago
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)

Updated

16 years ago
Keywords: testcase
Priority: -- → P5
Whiteboard: [invalid?]
Mass-reassigning bugs to dom_bugs@netscape.com
Assignee: jst → dom_bugs
(Assignee)

Comment 5

14 years ago
The testcase is valid, see bug 85776 comment 7.
Assignee: dom_bugs → peterv
Priority: P5 → P3
Target Milestone: Future → mozilla1.6alpha
(Assignee)

Comment 6

14 years ago
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.
Status: NEW → ASSIGNED
Whiteboard: [invalid?]
(Assignee)

Comment 7

14 years ago
Created attachment 131794 [details] [diff] [review]
v1
(Assignee)

Updated

14 years ago
Attachment #131794 - Flags: superreview?(jst)
Attachment #131794 - Flags: review?(bugmail)
(Assignee)

Updated

14 years ago
Blocks: 125665
Comment on attachment 131794 [details] [diff] [review]
v1

sr=jst
Attachment #131794 - Flags: superreview?(jst) → superreview+
Comment on attachment 131794 [details] [diff] [review]
v1

r=sicking
Attachment #131794 - Flags: review?(bugmail) → review+
(Assignee)

Comment 10

14 years ago
Checked in.
Status: ASSIGNED → RESOLVED
Last Resolved: 14 years ago
Resolution: --- → FIXED

Updated

9 years ago
Component: DOM: Core → DOM: Core & HTML
QA Contact: stummala → general
You need to log in before you can comment on or make changes to this bug.