When the user types into a text field (input type="text" or textarea) something that does not actually change the value of the field (i.e. the typed value is identical to the original value), blurring the field triggers the "onchange" event anyway. This is unintuitive behavior and inconsistent with other browsers (FireFox, IE, although Opera behaves the same). "onchange" should only be triggered if the new value is different from the original one. In the attached test case, for comparison there is also a <select>: if one goes through the list and ends up seleting the same value as before, no onchange is triggered, only if the value actually changed. For the text input and textarea, though, typing an "l" over the last letter "l" results in an "onchange" after moving the focus away. Confirmed on r56152.
Created attachment 84957 [details] Patch
Emil, I wonder if we can keep the machinery of comparing text value in the InputType? Storing Strings in a RenderObject just seems... suboptimal.
Yeah, it seems a bit. I didn't want to change the code too much but moving logic into InputType makes sense. I'll update the patch.
Created attachment 86864 [details] Patch This was a bit tricker than I first though, added tests for some of the tricker cases and made sure it works with input types other than text (checkbox, radio, password, search, number, range).
Comment on attachment 86864 [details] Patch ok.
Comment on attachment 86864 [details] Patch Clearing flags on attachment: 86864 Committed r81978: <http://trac.webkit.org/changeset/81978>
All reviewed patches have been landed. Closing bug.
http://trac.webkit.org/changeset/81978 might have broken Chromium Linux Release and EFL Linux Release (Build)