WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
11681
REGRESSION: Resetting a multiple-select control selects first item rather than none
https://bugs.webkit.org/show_bug.cgi?id=11681
Summary
REGRESSION: Resetting a multiple-select control selects first item rather tha...
Kirby White
Reported
2006-11-22 14:13:46 PST
Multiple-select form controls default to having nothing selected when the page is loaded, but when the form is reset with an <input type="reset"> or <button type="reset"> control they have the first item selected instead.
Attachments
Checks for multiple-select before setting option on reset
(1.12 KB, patch)
2006-11-22 14:32 PST
,
Kirby White
mitz: review-
Details
Formatted Diff
Diff
Adding testcase
(3.37 KB, patch)
2006-11-27 17:45 PST
,
Kirby White
adele
: review-
Details
Formatted Diff
Diff
Apply change to all listbox <select> controls
(3.81 KB, patch)
2006-11-28 13:46 PST
,
Kirby White
ap
: review+
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
Kirby White
Comment 1
2006-11-22 14:32:25 PST
Created
attachment 11616
[details]
Checks for multiple-select before setting option on reset
mitz
Comment 2
2006-11-22 23:16:57 PST
Comment on
attachment 11616
[details]
Checks for multiple-select before setting option on reset The code change looks good, but shouldn't the same logic apply also to single-choice listboxes (e.g. <select size="5">)? It would be nice to fix this case as well. + WARNING: NO TEST CASES ADDED OR CHANGED You should indeed add a layout test. r- due to the missing test.
Kirby White
Comment 3
2006-11-27 17:45:44 PST
Created
attachment 11647
[details]
Adding testcase As I understand the spec, single-choice <select> controls with no "selected" option properly default to the first option when reset, whereas multiple-choice ones reset to empty. That makes sense, at least to me, since otherwise the single-select's drop-down wouldn't have anything to show.
mitz
Comment 4
2006-11-27 21:59:27 PST
(In reply to
comment #3
)
> Created an attachment (id=11647) [edit] > Adding testcase > > As I understand the spec, single-choice <select> controls with no "selected" > option properly default to the first option when reset, whereas multiple-choice > ones reset to empty. That makes sense, at least to me, since otherwise the > single-select's drop-down wouldn't have anything to show. >
My comment was referring to single-select list boxes, not drop-downs. The behavior of the former in WebKit and Firefox is that initially they have no option selected. Furthermore, in Firefox, resetting the form deselects all options. So I was suggesting that WebKit do the same to be consistent both with itself and with Firefox.
Adele Peterson
Comment 5
2006-11-27 22:56:11 PST
Comment on
attachment 11647
[details]
Adding testcase I agree with Mitz's comments. You can use usesMenuList(), and only set the selection if that is true, instead of just checking m_multiple.
Kirby White
Comment 6
2006-11-28 13:46:06 PST
Created
attachment 11653
[details]
Apply change to all listbox <select> controls (In reply to
comment #4
)
> My comment was referring to single-select list boxes, not drop-downs.
Oh, of course. Sorry, I misunderstood. Here's the fix.
Alexey Proskuryakov
Comment 7
2006-12-05 01:35:22 PST
Comment on
attachment 11653
[details]
Apply change to all listbox <select> controls r=me
Alexey Proskuryakov
Comment 8
2006-12-05 02:36:00 PST
Committed revision 18019. I corrected formatting of the test, as it used tabs. This was a regression, marking as such.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug