Closed
Bug 96346
Opened 23 years ago
Closed 23 years ago
SelectElem.options does not return HTMLCollection
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
VERIFIED
FIXED
People
(Reporter: jwbaker, Assigned: jst)
Details
(Keywords: dom1, testcase)
Attachments
(1 file, 2 obsolete files)
957 bytes,
text/html
|
Details |
I will attach a testcase which causes the following exception in Mozilla 0.9.3: Error: uncaught exception: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIDOMHTMLOptionElement.selected]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: file:///home/jwb/select.html :: <TOP_LEVEL> :: line 24" data: no] In the 2001-08-20 Linux nightly build, I do not get this exception, but also the DOM code does not work as expected. The expected behavior is for the page to load and select "5" in the form element. In 0.9.3 and latest nightly, this does not happen. If I test for selected == false before setting selected to false, the exception does not occur. I postulate that the problem is that one cannot set selected == false when no option is selected. However that's just my guess. This is needed for DOM 1 and DOM 2 compliance.
Reporter | ||
Comment 1•23 years ago
|
||
Reporter | ||
Updated•23 years ago
|
Comment 2•23 years ago
|
||
I don't see the exception using a CVS build from the 08/30 on linux.
Comment 3•23 years ago
|
||
Comment 4•23 years ago
|
||
no exception was raised but SelectElem.options does not return HTMLCollection. Changing the summary accordingly. attached a testcase attachid 55970.
Summary: Uncaught exception when deselecting option → SelectElem.options does not return HTMLCollection
Reporter | ||
Comment 5•23 years ago
|
||
This seems to work fine for me in 0.9.5. What build did you test? I get: Should alert HTMLCollection [object HTMLOptionCollection] Should alert 1
Comment 6•23 years ago
|
||
i used 2001-10-30-12 build
Comment 7•23 years ago
|
||
This works for me Linux 2001103113. I see the same behavior as Jeffrey.
Comment 8•23 years ago
|
||
This is object, guys ... it doesn't matter what the string prints out, it matters whether it is actually that type of object. Since an object can inherit multiple interfaces, there's no way to guarantee that toString() print out the exact interface you want unless it prints them all. (Actually according to bz there's no requirement to print out *anything* in toString.) This testcase tests instanceof, and works.
Attachment #46674 -
Attachment is obsolete: true
Attachment #55970 -
Attachment is obsolete: true
Comment 9•23 years ago
|
||
OK bug 92071 fixed the remaining issues which was that HTMLOptionCollection didn't inherit from HTMLCollection but it's fixed now. Marking FIXED. Please reopen if you find yet another issue :-)
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
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
•