RESOLVED FIXED 67697
Change event is not fired for input[type=number] when the user reverts a change made by script
https://bugs.webkit.org/show_bug.cgi?id=67697
Summary Change event is not fired for input[type=number] when the user reverts a chan...
Ryosuke Niwa
Reported 2011-09-06 22:59:49 PDT
Here's a test & fix for the following discussion on the bug 67360: Comment #2 From tkent@chromium.org (:tkent) (r) 2011-09-06 18:51:09 PST (-) [reply] (From update of attachment 106507 [details]) View in context: https://bugs.webkit.org/attachment.cgi?id=106507&action=review > Source/WebCore/html/TextInputType.cpp:53 > + // FIXME: should this be moved to TextFieldInputType? I think so. It looks a bug of the current code. Comment #3 From rniwa@webkit.org (:rniwa) (r) 2011-09-06 18:58:57 PST (-) [reply] (From update of attachment 106507 [details]) View in context: https://bugs.webkit.org/attachment.cgi?id=106507&action=review >> Source/WebCore/html/TextInputType.cpp:53 >> + // FIXME: should this be moved to TextFieldInputType? > > I think so. It looks a bug of the current code. Okay. Let me see if I can come up with a test.
Attachments
fixes the bug (4.41 KB, patch)
2011-09-06 23:06 PDT, Ryosuke Niwa
no flags
fixed the test failure (16.62 KB, patch)
2011-09-07 02:00 PDT, Ryosuke Niwa
no flags
Ryosuke Niwa
Comment 1 2011-09-06 23:06:19 PDT
Created attachment 106546 [details] fixes the bug
Kent Tamura
Comment 2 2011-09-06 23:17:05 PDT
Comment on attachment 106546 [details] fixes the bug Looks good. Thank you!
WebKit Review Bot
Comment 3 2011-09-06 23:44:42 PDT
Comment on attachment 106546 [details] fixes the bug Attachment 106546 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/9602458 New failing tests: fast/forms/input-number-events.html
Kent Tamura
Comment 4 2011-09-07 00:56:02 PDT
(In reply to comment #3) > New failing tests: > fast/forms/input-number-events.html The failure was: @@ -15,7 +15,7 @@ PASS changeEventCounter is 0 PASS inputEventCounter is 1 Focus on another field -PASS changeEventCounter is 1 +FAIL changeEventCounter should be 1. Was 0. PASS inputEventCounter is 1 PASS successfullyParsed is true 'change' was not fired when the number input lost focus after updating the value by the spin button. HTMLInputElement::stepUpFromRenderer() uses setValueAsNumber() internally. So m_wasModifiedByUser and m_textAsOfLastFormControlChangeEvent are always reset.
Ryosuke Niwa
Comment 5 2011-09-07 02:00:20 PDT
Created attachment 106558 [details] fixed the test failure
Ryosuke Niwa
Comment 6 2011-09-07 02:02:01 PDT
(In reply to comment #4) > (In reply to comment #3) > > New failing tests: > > fast/forms/input-number-events.html > > The failure was: > @@ -15,7 +15,7 @@ > PASS changeEventCounter is 0 > PASS inputEventCounter is 1 > Focus on another field > -PASS changeEventCounter is 1 > +FAIL changeEventCounter should be 1. Was 0. > PASS inputEventCounter is 1 > PASS successfullyParsed is true > > 'change' was not fired when the number input lost focus after updating the value by the spin button. > HTMLInputElement::stepUpFromRenderer() uses setValueAsNumber() internally. So m_wasModifiedByUser and m_textAsOfLastFormControlChangeEvent are always reset. Yeah, I completely overlooked this failure. New patch fixes this issue by propagating sendChangeEvent through various functions from stepUpFromRenderer.
Kent Tamura
Comment 7 2011-09-07 02:04:40 PDT
Comment on attachment 106558 [details] fixed the test failure Looks good.
Ryosuke Niwa
Comment 8 2011-09-07 02:11:10 PDT
(In reply to comment #7) > (From update of attachment 106558 [details]) > Looks good. Thanks for the review :D
WebKit Review Bot
Comment 9 2011-09-07 03:06:18 PDT
Comment on attachment 106558 [details] fixed the test failure Clearing flags on attachment: 106558 Committed r94658: <http://trac.webkit.org/changeset/94658>
WebKit Review Bot
Comment 10 2011-09-07 03:06:23 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.