Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(412)

Issue 679273004: Set element value to its default value on reset (Closed)

Created:
6 years, 1 month ago by Habib Virji
Modified:
6 years ago
Reviewers:
keishi, tkent
CC:
blink-reviews, dglazkov+blink, blink-reviews-html_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Project:
blink
Visibility:
Public.

Description

Ignore changing value of m_textAsOfLastFormControlChangeEvent during reset On reset, m_textAsOfLastFormControlChangeEvent value is changed in setValue of HTMLInputElement and TextFieldInputType. Since reset sets value the value to null String, value of m_textAsOfLastFormControlChangeEvent also set to null string. Changed behavior to not change value of m_textAsOfLastFormControlChangeEvent, when in reset state. R=tkent, keishi BUG=425408 TEST=fast/forms/text/text-reset-click-delete-text-change-event.html Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=185914

Patch Set 1 #

Total comments: 1

Patch Set 2 : Added isReset as a parameter to not allow setValue change value of m_textAsOfLastFormControlChangeE… #

Total comments: 6

Patch Set 3 : Use sanitize value if not null, if null use defaultValue() #

Total comments: 6

Patch Set 4 : Updated to use defaultValue #

Patch Set 5 : Updated as missed updating one review comment #

Unified diffs Side-by-side diffs Delta from patch set Stats (+56 lines, -2 lines) Patch
A LayoutTests/fast/forms/text/text-reset-click-delete-text-change-event.html View 1 chunk +38 lines, -0 lines 0 comments Download
A LayoutTests/fast/forms/text/text-reset-click-delete-text-change-event-expected.txt View 1 chunk +16 lines, -0 lines 0 comments Download
M Source/core/html/HTMLInputElement.cpp View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M Source/core/html/forms/TextFieldInputType.cpp View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 21 (3 generated)
Habib Virji
PTAL.
6 years, 1 month ago (2014-10-28 11:01:23 UTC) #2
tkent
https://codereview.chromium.org/679273004/diff/1/Source/core/html/HTMLInputElement.cpp File Source/core/html/HTMLInputElement.cpp (right): https://codereview.chromium.org/679273004/diff/1/Source/core/html/HTMLInputElement.cpp#newcode842 Source/core/html/HTMLInputElement.cpp:842: setValue(defaultValue()); This is a wrong fix. Setting a null ...
6 years, 1 month ago (2014-10-29 00:28:29 UTC) #3
Habib Virji
Default value will it be not the value of the value content attribute? As per ...
6 years, 1 month ago (2014-10-29 08:43:53 UTC) #4
tkent
On 2014/10/29 08:43:53, Habib Virji wrote: > Default value will it be not the value ...
6 years, 1 month ago (2014-10-31 02:08:21 UTC) #5
Habib Virji
"m_textAsOfLastFormControlChangeEvent is different in a case of reset() and in a case of the HTML ...
6 years, 1 month ago (2014-11-05 16:21:14 UTC) #7
tkent
https://codereview.chromium.org/679273004/diff/20001/Source/core/html/HTMLInputElement.cpp File Source/core/html/HTMLInputElement.cpp (right): https://codereview.chromium.org/679273004/diff/20001/Source/core/html/HTMLInputElement.cpp#newcode1029 Source/core/html/HTMLInputElement.cpp:1029: if (valueChanged && eventBehavior == DispatchNoEvent && !isReset) Skipping ...
6 years, 1 month ago (2014-11-06 00:11:17 UTC) #8
Habib Virji
Thanks tkent for reviewing. As described below, m_textAsOfLastFormControlChangeEvent is "" after reset. Thus if value ...
6 years, 1 month ago (2014-11-06 14:23:08 UTC) #9
tkent
https://codereview.chromium.org/679273004/diff/20001/Source/core/html/HTMLInputElement.cpp File Source/core/html/HTMLInputElement.cpp (right): https://codereview.chromium.org/679273004/diff/20001/Source/core/html/HTMLInputElement.cpp#newcode1029 Source/core/html/HTMLInputElement.cpp:1029: if (valueChanged && eventBehavior == DispatchNoEvent && !isReset) On ...
6 years, 1 month ago (2014-11-07 00:34:19 UTC) #10
Habib Virji
Thanks suggestion does work. Upload changes accordingly. https://codereview.chromium.org/679273004/diff/20001/Source/core/html/HTMLInputElement.cpp File Source/core/html/HTMLInputElement.cpp (right): https://codereview.chromium.org/679273004/diff/20001/Source/core/html/HTMLInputElement.cpp#newcode1029 Source/core/html/HTMLInputElement.cpp:1029: if (valueChanged ...
6 years, 1 month ago (2014-11-07 14:10:43 UTC) #11
tkent
https://codereview.chromium.org/679273004/diff/40001/Source/core/html/HTMLInputElement.cpp File Source/core/html/HTMLInputElement.cpp (right): https://codereview.chromium.org/679273004/diff/40001/Source/core/html/HTMLInputElement.cpp#newcode842 Source/core/html/HTMLInputElement.cpp:842: setValue(String(), DispatchNoEvent); This change is unnecessary. https://codereview.chromium.org/679273004/diff/40001/Source/core/html/forms/TextFieldInputType.cpp File Source/core/html/forms/TextFieldInputType.cpp ...
6 years, 1 month ago (2014-11-10 01:54:39 UTC) #12
Habib Virji
https://codereview.chromium.org/679273004/diff/40001/Source/core/html/HTMLInputElement.cpp File Source/core/html/HTMLInputElement.cpp (right): https://codereview.chromium.org/679273004/diff/40001/Source/core/html/HTMLInputElement.cpp#newcode842 Source/core/html/HTMLInputElement.cpp:842: setValue(String(), DispatchNoEvent); On 2014/11/10 01:54:39, tkent wrote: > This ...
6 years, 1 month ago (2014-11-13 15:00:56 UTC) #13
tkent
https://codereview.chromium.org/679273004/diff/40001/Source/core/html/forms/TextFieldInputType.cpp File Source/core/html/forms/TextFieldInputType.cpp (right): https://codereview.chromium.org/679273004/diff/40001/Source/core/html/forms/TextFieldInputType.cpp#newcode192 Source/core/html/forms/TextFieldInputType.cpp:192: input->setTextAsOfLastFormControlChangeEvent(sanitizedValue.isNull() ? visibleValue() : sanitizedValue); On 2014/11/13 15:00:56, Habib ...
6 years, 1 month ago (2014-11-14 00:23:56 UTC) #14
Habib Virji
On 2014/11/14 00:23:56, tkent wrote: > https://codereview.chromium.org/679273004/diff/40001/Source/core/html/forms/TextFieldInputType.cpp > File Source/core/html/forms/TextFieldInputType.cpp (right): > > https://codereview.chromium.org/679273004/diff/40001/Source/core/html/forms/TextFieldInputType.cpp#newcode192 > ...
6 years, 1 month ago (2014-11-14 10:05:26 UTC) #15
tkent
On 2014/11/14 10:05:26, Habib Virji wrote: > > > > Why is it visibleValue(), instead ...
6 years, 1 month ago (2014-11-17 01:29:22 UTC) #16
Habib Virji
Thanks, updated to use defaultValue. Apologise for delay in updating. https://codereview.chromium.org/679273004/diff/40001/Source/core/html/forms/TextFieldInputType.cpp File Source/core/html/forms/TextFieldInputType.cpp (right): https://codereview.chromium.org/679273004/diff/40001/Source/core/html/forms/TextFieldInputType.cpp#newcode192 ...
6 years ago (2014-11-24 11:05:32 UTC) #17
tkent
lgtm
6 years ago (2014-11-25 00:50:28 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/679273004/80001
6 years ago (2014-11-25 00:50:53 UTC) #20
commit-bot: I haz the power
6 years ago (2014-11-25 02:31:00 UTC) #21
Message was sent while issue was closed.
Committed patchset #5 (id:80001) as
https://src.chromium.org/viewvc/blink?view=rev&revision=185914

Powered by Google App Engine
This is Rietveld 408576698