Closed
Bug 85798
Opened 24 years ago
Closed 21 years ago
INUSE_ATTRIBUTE_ERR expected when using setNamedItem()
Categories
(Core :: DOM: Core & HTML, defect, P3)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla1.6alpha
People
(Reporter: stummala, Assigned: peterv)
References
()
Details
(Keywords: testcase)
Attachments
(2 files)
2.18 KB,
text/html
|
Details | |
3.51 KB,
patch
|
sicking
:
review+
jst
:
superreview+
|
Details | Diff | Splinter Review |
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•24 years ago
|
||
Comment 3•23 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•23 years ago
|
Assignee | ||
Comment 5•21 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•21 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•21 years ago
|
||
Assignee | ||
Updated•21 years ago
|
Attachment #131794 -
Flags: superreview?(jst)
Attachment #131794 -
Flags: review?(bugmail)
Comment 8•21 years ago
|
||
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•21 years ago
|
||
Checked in.
Status: ASSIGNED → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
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.
Description
•