Bug 12701 - REGRESSION: After javascript, onChange not triggered when selecting same option
Summary: REGRESSION: After javascript, onChange not triggered when selecting same option
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Forms (show other bugs)
Version: 420+
Hardware: Macintosh OS X 10.4
: P1 Normal
Assignee: Alexey Proskuryakov
URL:
Keywords: HasReduction, Regression
Depends on:
Blocks:
 
Reported: 2007-02-08 13:44 PST by Kevin M. Dean
Modified: 2007-02-11 00:38 PST (History)
2 users (show)

See Also:


Attachments
sample code (1.18 KB, text/html)
2007-02-08 13:45 PST, Kevin M. Dean
no flags Details
Sample Code (1.18 KB, text/html)
2007-02-08 13:50 PST, Kevin M. Dean
no flags Details
proposed fix (4.79 KB, patch)
2007-02-09 12:12 PST, Alexey Proskuryakov
aroben: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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?