RESOLVED FIXED 145869
Select validation does not correctly work when handling change event
https://bugs.webkit.org/show_bug.cgi?id=145869
Summary Select validation does not correctly work when handling change event
mh35jp
Reported 2015-06-10 20:11:40 PDT
Created attachment 254703 [details] Test case Expected behavior Select a value->1 ... Should be changed to true, but remains false 1->Select a value ... Should be changed to false, but true
Attachments
Test case (594 bytes, text/html)
2015-06-10 20:11 PDT, mh35jp
no flags
Patch (4.83 KB, patch)
2015-08-19 17:35 PDT, Wenson Hsieh
dino: review+
Wenson Hsieh
Comment 1 2015-08-19 17:35:32 PDT
Dean Jackson
Comment 2 2015-08-19 17:39:52 PDT
Comment on attachment 259434 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=259434&action=review > Source/WebCore/ChangeLog:14 > + Test: fast/forms/onchange-select-check-validity.html > + > + When selecting an option in a <select> with validation that also has an onchange listener, calling > + checkValidity() for the select within the onchange handler would produce incorrect results and (on > + a debug build) crash at an assertion. This is because the change events were being dispatched before > + form validity was updated. Making the validation step come before the change event dispatch fixes > + this issue. Normally the Test line comes last. > LayoutTests/fast/forms/onchange-select-check-validity.html:17 > + select.onchange = showFormValidity; > + select.addEventListener("change", showFormValidity); I think these two lines do the same thing. You only need one of them.
Wenson Hsieh
Comment 3 2015-08-19 17:43:07 PDT
Comment on attachment 259434 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=259434&action=review >> Source/WebCore/ChangeLog:14 >> + this issue. > > Normally the Test line comes last. got it. >> LayoutTests/fast/forms/onchange-select-check-validity.html:17 >> + select.addEventListener("change", showFormValidity); > > I think these two lines do the same thing. You only need one of them. good catch. fixed!
Ahmad Saleem
Comment 4 2022-10-25 13:34:35 PDT
Landed and didn't backed out - https://github.com/WebKit/WebKit/commit/dfc4f77e61d39a165b4d9c8edd877282bde90e84 Marking this as "RESOLVED FIXED".
Note You need to log in before you can comment on or make changes to this bug.