Bug 60986

Summary: REGRESSION (r80808): Multiple <select> - Selection reset to first element from multiple selected ones
Product: WebKit Reporter: Cristian Vat <cristian.vat>
Component: FormsAssignee: Emil A Eklund <eae>
Status: RESOLVED FIXED    
Severity: Normal CC: ademar, ap, darin, dglazkov, eae
Priority: P1 Keywords: InRadar, Regression
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
reduced test case
none
Patch
none
Archive of layout-test-results from cr-jail-8
none
Patch for landing none

Description Cristian Vat 2011-05-17 14:16:32 PDT
Created attachment 93816 [details]
reduced test case

HTML/DOM: A <select> with multiple active and two or more <option>s already in selected state.

Action: selectElement.multiple=true

Behavior: Only the first <option> which is selected is kept as selected. The rest are displayed as not selected.
Expected: already selected elements should not be/appear deselected

Reduced test case attached. Tested on nightly WebKit-r86672, Windows 7 x64

Issue originally reported in chromium at http://code.google.com/p/chromium/issues/detail?id=80672
Comment 1 Alexey Proskuryakov 2011-05-17 22:40:10 PDT
Regressed between r80761 and r80833, meaning that it's almost certainly <http://trac.webkit.org/r80808>.
Comment 2 Emil A Eklund 2011-05-18 10:42:55 PDT
Thanks Alexey, I'll look into it.
Comment 3 Emil A Eklund 2011-05-18 14:05:29 PDT
Created attachment 93981 [details]
Patch
Comment 4 Alexey Proskuryakov 2011-05-18 14:58:53 PDT
<rdar://problem/9464161>
Comment 5 WebKit Commit Bot 2011-05-18 17:40:40 PDT
Comment on attachment 93981 [details]
Patch

Rejecting attachment 93981 [details] from commit-queue.

Failed to run "['./Tools/Scripts/webkit-patch', '--status-host=queues.webkit.org', '--bot-id=cr-jail-8', 'build-..." exit_code: 2

Last 500 characters of output:
tests/xmlhttprequest ................................................................................................................................................................................
http/tests/xmlhttprequest/web-apps ...............
http/tests/xmlhttprequest/workers ...........
http/tests/xmlviewer .
http/tests/xmlviewer/dumpAsText ...........
739.17s total testing time

23575 test cases (99%) succeeded
1 test case (<1%) had incorrect layout
14 test cases (<1%) had stderr output

Full output: http://queues.webkit.org/results/8710665
Comment 6 WebKit Commit Bot 2011-05-18 17:40:44 PDT
Created attachment 94011 [details]
Archive of layout-test-results from cr-jail-8

The attached test failures were seen while running run-webkit-tests on the commit-queue.
Bot: cr-jail-8  Port: Mac  Platform: Mac OS X 10.6.7
Comment 7 Emil A Eklund 2011-05-18 18:28:26 PDT
Created attachment 94022 [details]
Patch for landing
Comment 8 WebKit Commit Bot 2011-05-19 02:22:09 PDT
Comment on attachment 94022 [details]
Patch for landing

Clearing flags on attachment: 94022

Committed r86827: <http://trac.webkit.org/changeset/86827>
Comment 9 Cristian Vat 2011-05-19 07:29:53 PDT
Just tested with nightly WebKit-r86842 and it now works correctly for me.
Comment 10 Emil A Eklund 2011-05-19 09:46:58 PDT
Thanks for verifying.
Comment 11 Darin Adler 2011-05-19 10:15:15 PDT
It doesn’t make sense that setting multiple with the binding directly does something different than setting the multiple attribute; all the code to handle the change from single to multiple needs to be in the attribute handling/parsing code and none should be in the setMultiple function. I think all the code in setMultiple is probably wrong. We should test the behavior in other browsers to be sure but I think that is the way to go and this refinement of the code is not sufficient.
Comment 12 Emil A Eklund 2011-05-19 10:32:14 PDT
Alright, I'll see if I can move this logic to the attribute handling code. I'm fairly certain that the current behavior matches that of IE and Firefox but I'll verify that.
Comment 13 Ademar Reis 2011-05-19 13:39:25 PDT
Revision r86827 cherry-picked into qtwebkit-2.2 with commit f46a068 <http://gitorious.org/webkit/qtwebkit/commit/f46a068>
Comment 14 Emil A Eklund 2011-05-24 17:46:08 PDT
Filed bug 61406 to track cleanup suggested by Darin.