Closed
Bug 80627
Opened 24 years ago
Closed 24 years ago
<form>.elements.namedItem() returns NodeList instead of a single node
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
VERIFIED
FIXED
mozilla0.9.4
People
(Reporter: c, Assigned: jst)
Details
(Keywords: dom1, Whiteboard: [HAVE FIX])
Attachments
(1 file)
|
2.65 KB,
text/html
|
Details |
<form>.elements.namedItem() returns a NodeList (HTMLCollection). It should
return a single node.
DOM1 says in
http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-html.html#ID-75708506
namedItem
This method retrieves a Node using a name. It first searches for a Node
with a matching id attribute. If it doesn't find one, it then searches for
a Node with a matching name attribute, but only on those elements that are
allowed a name attribute.
namedItem() works as expected when used with document.images, but with
<form>.elements it behaves like document.getElementsByName().
| Reporter | ||
Comment 1•24 years ago
|
||
| Reporter | ||
Comment 2•24 years ago
|
||
Additional note: This works, if only 1 element with the given name exists.
Nominating for 1.0. We should not introduce a wrong DOM with our product.
Keywords: mozilla1.0
| Assignee | ||
Comment 3•24 years ago
|
||
This patch fixes this problem.
Index: content/html/content/src/nsHTMLFormElement.cpp
===================================================================
RCS file: /cvsroot/mozilla/content/html/content/src/nsHTMLFormElement.cpp,v
retrieving revision 1.72
diff -u -r1.72 nsHTMLFormElement.cpp
--- nsHTMLFormElement.cpp 2001/05/08 16:44:47 1.72
+++ nsHTMLFormElement.cpp 2001/05/14 04:24:20
@@ -695,8 +695,8 @@
// XPConnect interface list for nsFormControlList
NS_CLASSINFO_MAP_BEGIN(HTMLFormControlCollection)
- NS_CLASSINFO_MAP_ENTRY(nsIDOMNSHTMLFormControlList)
NS_CLASSINFO_MAP_ENTRY(nsIDOMHTMLCollection)
+ NS_CLASSINFO_MAP_ENTRY(nsIDOMNSHTMLFormControlList)
NS_CLASSINFO_MAP_END
Status: NEW → ASSIGNED
OS: Windows NT → All
Hardware: PC → All
Whiteboard: [HAVE FIX]
Target Milestone: --- → mozilla0.9.2
Comment 4•24 years ago
|
||
Tested the patch, it does fix the problem. Peter, want to r= ?
Comment 5•24 years ago
|
||
r=peterv.
| Assignee | ||
Comment 7•24 years ago
|
||
Moving to mozilla0.9.3
Target Milestone: mozilla0.9.2 → mozilla0.9.3
Comment 8•24 years ago
|
||
er come on let's get this in, this is getting silly (/me hates rotting patches)
| Assignee | ||
Comment 9•24 years ago
|
||
No worries my friend, this will be fixed soon. :-)
Updated•24 years ago
|
Target Milestone: mozilla0.9.3 → mozilla0.9.4
| Assignee | ||
Comment 10•24 years ago
|
||
This was fixed a while back, marking so...
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
| Reporter | ||
Comment 11•24 years ago
|
||
Yes, works with 2001-08-14-03, Win NT.
Status: RESOLVED → VERIFIED
Component: DOM: HTML → DOM: Core & HTML
QA Contact: stummala → general
You need to log in
before you can comment on or make changes to this bug.
Description
•