Bug 6908 - REGRESSION: Replacing existing <option> shuffles it to the end of the list
Summary: REGRESSION: Replacing existing <option> shuffles it to the end of the list
Status: VERIFIED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Forms (show other bugs)
Version: 420+
Hardware: Mac OS X 10.4
: P1 Major
Assignee: Darin Adler
URL: http://www.qantas.com.au
Keywords: EasyFix, HasReduction, Regression
Depends on: 6870
Blocks:
  Show dependency treegraph
 
Reported: 2006-01-29 02:51 PST by andrew
Modified: 2006-02-07 07:32 PST (History)
1 user (show)

See Also:


Attachments
test case (319 bytes, text/html)
2006-01-29 05:46 PST, Alexey Proskuryakov
no flags Details
patch to fix the problem, including change log and test (4.75 KB, patch)
2006-02-05 00:44 PST, Darin Adler
mjs: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description andrew 2006-01-29 02:51:41 PST
Go to www.qantas.com.au.
In the tab labelled "Domestic" choose a Month to depart from (choose March, for example).
Once you release the mouse button from choosing that month, notice that the month displayed is not what you selected.
Attempt to select another month from the same popup menu and notice that the order of items in the list is now very strange.

This does not occur with Apple's latest release of Safari.
Comment 1 Joost de Valk (AlthA) 2006-01-29 03:34:39 PST
Confirmed, this site is good for bugfinding. :)
Comment 2 David Kilzer (:ddkilzer) 2006-01-29 04:32:55 PST
Adding Regression keyword per reporter.  Regressions are P1.  Bug 6870 had to be fixed before this could be tested, therefore adding it as a dependency.
Comment 3 Alexey Proskuryakov 2006-01-29 05:46:22 PST
Created attachment 6070 [details]
test case

Safari 2.0.3 and Opera leave the first element selected; WinIE and Firefox select the second one. ToT replaces a wrong (third) element).
Comment 4 David Kilzer (:ddkilzer) 2006-01-29 05:51:48 PST
Actually ToT removes the element in the list then adds the new element to the end of the list.  It should simply replace the existing element in the list with the new element.
Comment 5 Darin Adler 2006-02-02 09:51:00 PST
The problem is caused by the fact that KJS::HTMLSelectCollection::put relies on the "options" collection, which is not implemented. In fact, the binding for "options" calls optionsHTMLCollection() instead of options().

This particular bug can almost certainly be fixed just by changing the function call inside KJS::HTMLSelectCollection::put from options() to optionsHTMLCollection(). I tried it and it seems to work.
Comment 6 Darin Adler 2006-02-05 00:44:41 PST
Created attachment 6262 [details]
patch to fix the problem, including change log and test
Comment 7 David Kilzer (:ddkilzer) 2006-02-07 07:32:19 PST
Verified fixed.