Closed
Bug 471741
Opened 16 years ago
Closed 16 years ago
Setting selectedIndex to an out-of-bounds value should have the same effect as setting it to -1
Categories
(Core :: Layout: Form Controls, defect)
Core
Layout: Form Controls
Tracking
()
RESOLVED
FIXED
People
(Reporter: MatsPalmgren_bugz, Assigned: MatsPalmgren_bugz)
Details
(Keywords: html5, testcase)
Attachments
(1 file, 1 obsolete file)
9.27 KB,
patch
|
roc
:
review+
roc
:
superreview+
|
Details | Diff | Splinter Review |
Setting selectedIndex to an out-of-bounds value should have the same effect as setting it to -1.
http://www.whatwg.org/specs/web-apps/current-work/#the-select-element/selec/
"The selectedIndex DOM attribute, on getting, must return the index of the first option element in the list of options in tree order that has its selectedness set to true, if any. If there isn't one, then it must return -1.
On setting, the selectedIndex attribute must set the selectedness of all the option elements in the list of options to false, and then the option element in the list of options whose index is the given new value, if any, must have its selectedness set to true."
This is what Opera 9.51, Safari 3.2.1 and IE8b2 does.
Firefox throws an exception:
Error: uncaught exception: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIDOMHTMLSelectElement.selectedIndex]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: file:///usr/local/test/selectedIndex.html :: sel :: line 7" data: no]
Assignee | ||
Comment 1•16 years ago
|
||
Attachment #354997 -
Flags: superreview?(roc)
Attachment #354997 -
Flags: review?(roc)
Assignee | ||
Comment 2•16 years ago
|
||
Corrected HTML5 url:
http://www.whatwg.org/specs/web-apps/current-work/#dom-select-selectedindex
Assignee | ||
Comment 3•16 years ago
|
||
With slightly updated testcase.
Attachment #354997 -
Attachment is obsolete: true
Attachment #354998 -
Flags: superreview?(roc)
Attachment #354998 -
Flags: review?(roc)
Attachment #354997 -
Flags: superreview?(roc)
Attachment #354997 -
Flags: review?(roc)
Attachment #354998 -
Flags: superreview?(roc)
Attachment #354998 -
Flags: superreview+
Attachment #354998 -
Flags: review?(roc)
Attachment #354998 -
Flags: review+
Assignee | ||
Comment 4•16 years ago
|
||
Status: NEW → RESOLVED
Closed: 16 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•