Bug 12701

Summary: REGRESSION: After javascript, onChange not triggered when selecting same option
Product: WebKit Reporter: Kevin M. Dean <kevin>
Component: FormsAssignee: Alexey Proskuryakov <ap>
Status: RESOLVED FIXED    
Severity: Normal CC: ap, sam
Priority: P1 Keywords: HasReduction, Regression
Version: 420+   
Hardware: Mac   
OS: OS X 10.4   
Attachments:
Description Flags
sample code
none
Sample Code
none
proposed fix aroben: review+

Description Kevin M. Dean 2007-02-08 13:44:37 PST
If you have a form select and you choose and option, then use javascript to reset it's value or change the selected option to another option, the next time you use that select to choose the original option it doesn't detect and fire an onChange.

Works in Safari, Firefox, IE.
Comment 1 Kevin M. Dean 2007-02-08 13:45:29 PST
Created attachment 13064 [details]
sample code
Comment 2 Kevin M. Dean 2007-02-08 13:50:25 PST
Created attachment 13065 [details]
Sample Code
Comment 3 Alexey Proskuryakov 2007-02-09 12:12:21 PST
Created attachment 13089 [details]
proposed fix

I'm not sure if I understood this code well enough, but this fixes the bug and passes existing tests.

When testing this, I noticed a separate regression with list boxes - an onchange event gets dispatched when clicking on an already selected element, if it was selected from JS. Going to file a new bug.
Comment 4 Alexey Proskuryakov 2007-02-10 07:27:57 PST
Filed bug 12725 for listbox issues.
Comment 5 Adam Roben (:aroben) 2007-02-10 14:02:35 PST
Comment on attachment 13089 [details]
proposed fix

r=me
Comment 6 Sam Weinig 2007-02-10 15:39:03 PST
Regressions are P1.
Comment 7 Sam Weinig 2007-02-10 17:55:02 PST
Alexey, can this be tested in DRT?  If not, please add a test to the manuel-tests directory instead. 
Comment 8 Alexey Proskuryakov 2007-02-11 00:38:44 PST
Committed revision 19563.

(In reply to comment #7)
> Alexey, can this be tested in DRT?  If not, please add a test to the
> manuel-tests directory instead. 

  It cannot be tested in DRT - but the test is already in manual-tests. Or did I misunderstand you?