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

Issue 196933006: Do not dispatch 'change' events during pressing spin buttons for input[type=number]. (Closed)

Created:
6 years, 9 months ago by Habib Virji
Modified:
6 years, 8 months ago
Reviewers:
keishi, tkent
CC:
blink-reviews, dglazkov+blink, adamk+blink_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Visibility:
Public.

Description

Do not dispatch 'change' events during pressing spin buttons for input[type=number]. InputType to triggers change event when not in focus and input event when in focus. The change event is triggered only when user stops pressing spin button. R=tkent, keishi1 BUG=155747 TEST=Change event is only trigger when mouse press is stopped. Only 1 change event is triggered when moving out of focus. Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=171006

Patch Set 1 #

Patch Set 2 : Avoid extra change event #

Total comments: 13

Patch Set 3 : Removed fallback value changes and added equalIgnoringNullity #

Patch Set 4 : SpinButton detach handling #

Patch Set 5 : Updated to latest code #

Patch Set 6 : Replaced detach functionality when input loses focus #

Total comments: 6

Patch Set 7 : Removed setFocus code from ShadowElement to InputElement #

Total comments: 2

Patch Set 8 : Removed double change event changes #

Total comments: 2

Patch Set 9 : Test code updated #

Unified diffs Side-by-side diffs Delta from patch set Stats (+101 lines, -11 lines) Patch
A LayoutTests/fast/forms/number/number-spinbutton-changeevent-trigger.html View 1 2 3 4 5 6 7 8 1 chunk +55 lines, -0 lines 0 comments Download
A LayoutTests/fast/forms/number/number-spinbutton-changeevent-trigger-expected.txt View 1 2 3 4 5 6 7 8 1 chunk +23 lines, -0 lines 0 comments Download
M Source/core/html/HTMLTextFormControlElement.cpp View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M Source/core/html/forms/BaseMultipleFieldsDateAndTimeInputType.h View 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/html/forms/BaseMultipleFieldsDateAndTimeInputType.cpp View 1 2 3 1 chunk +5 lines, -0 lines 0 comments Download
M Source/core/html/forms/InputType.cpp View 1 2 3 1 chunk +2 lines, -2 lines 0 comments Download
M Source/core/html/forms/TextFieldInputType.h View 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/html/forms/TextFieldInputType.cpp View 1 2 3 4 5 6 3 chunks +8 lines, -0 lines 0 comments Download
M Source/core/html/shadow/SpinButtonElement.h View 1 2 3 4 5 6 2 chunks +1 line, -1 line 0 comments Download
M Source/core/html/shadow/SpinButtonElement.cpp View 1 2 3 4 5 6 7 3 chunks +4 lines, -7 lines 0 comments Download

Messages

Total messages: 28 (0 generated)
Habib Virji
Resubmission of spin button change event trigger. The reason for resubmitting issue was found why ...
6 years, 9 months ago (2014-03-13 14:42:44 UTC) #1
tkent
The patch still dispatches unnecessary 'change' event. Try 1. Load data:text/html,<input type=number autofocus onchange="alert('FAIL')"> 2. ...
6 years, 9 months ago (2014-03-14 01:51:18 UTC) #2
Habib Virji
Thanks for the code. Was missing this and was not able to figure out the ...
6 years, 9 months ago (2014-03-14 16:10:32 UTC) #3
tkent
On 2014/03/14 16:10:32, Habib Virji wrote: > 1. In above code m_textAsOfLastFormControlChangeEvent is initialized by ...
6 years, 9 months ago (2014-03-18 08:17:00 UTC) #4
tkent
https://codereview.chromium.org/196933006/diff/20001/LayoutTests/fast/forms/number/number-spinbutton-changeevent-trigger.html File LayoutTests/fast/forms/number/number-spinbutton-changeevent-trigger.html (right): https://codereview.chromium.org/196933006/diff/20001/LayoutTests/fast/forms/number/number-spinbutton-changeevent-trigger.html#newcode33 LayoutTests/fast/forms/number/number-spinbutton-changeevent-trigger.html:33: shouldBe('numberInput1.value', '"1"'); Use shouldBeEqualToString https://codereview.chromium.org/196933006/diff/20001/LayoutTests/fast/forms/number/number-spinbutton-changeevent-trigger.html#newcode39 LayoutTests/fast/forms/number/number-spinbutton-changeevent-trigger.html:39: shouldBe('numberInput1.value', '"1"'); shouldBeEqualToString ...
6 years, 9 months ago (2014-03-18 08:26:19 UTC) #5
Habib Virji
Thanks for reviewing. "We don't have multiple threads in such case. Everything happens in a ...
6 years, 9 months ago (2014-03-18 08:54:37 UTC) #6
Habib Virji
Removed fallbackValue and added equalIgnoringNullity. Added a condition to generate changeevent on mousedown and mouseout ...
6 years, 9 months ago (2014-03-18 17:37:26 UTC) #7
tkent
I'll take a look at this in the next week. This change is risky, and ...
6 years, 9 months ago (2014-03-25 02:12:12 UTC) #8
Habib Virji
On 2014/03/25 02:12:12, tkent wrote: > I'll take a look at this in the next ...
6 years, 9 months ago (2014-03-25 09:16:48 UTC) #9
tkent
https://codereview.chromium.org/196933006/diff/20001/Source/core/html/forms/BaseMultipleFieldsDateAndTimeInputType.cpp File Source/core/html/forms/BaseMultipleFieldsDateAndTimeInputType.cpp (right): https://codereview.chromium.org/196933006/diff/20001/Source/core/html/forms/BaseMultipleFieldsDateAndTimeInputType.cpp#newcode245 Source/core/html/forms/BaseMultipleFieldsDateAndTimeInputType.cpp:245: if (element().focused()) On 2014/03/18 17:37:27, Habib Virji wrote: > ...
6 years, 8 months ago (2014-03-31 07:50:39 UTC) #10
Habib Virji
The issue is highlighted in particular in detach called from radioNodeList scenario(form-collection-radio-node-list.html). 1. container.parentNode.removeChild(container) invokes ...
6 years, 8 months ago (2014-03-31 15:41:46 UTC) #11
tkent
Please follow my previous comment. 'change' event still can be dispatched in detach() with your ...
6 years, 8 months ago (2014-04-03 04:41:48 UTC) #12
Habib Virji
On 2014/04/03 04:41:48, tkent wrote: > Please follow my previous comment. > 'change' event still ...
6 years, 8 months ago (2014-04-03 10:14:14 UTC) #13
tkent
https://codereview.chromium.org/196933006/diff/100001/Source/core/html/forms/TextFieldInputType.cpp File Source/core/html/forms/TextFieldInputType.cpp (right): https://codereview.chromium.org/196933006/diff/100001/Source/core/html/forms/TextFieldInputType.cpp#newcode189 Source/core/html/forms/TextFieldInputType.cpp:189: if (!input->focused() && eventBehavior != DispatchNoEvent) I think this ...
6 years, 8 months ago (2014-04-04 01:31:46 UTC) #14
Habib Virji
Comment#1: I did not consider the mentioned scenario. Removed the code. Comment#2: Moved code to ...
6 years, 8 months ago (2014-04-04 09:24:04 UTC) #15
tkent
https://codereview.chromium.org/196933006/diff/120001/Source/core/html/shadow/SpinButtonElement.cpp File Source/core/html/shadow/SpinButtonElement.cpp (right): https://codereview.chromium.org/196933006/diff/120001/Source/core/html/shadow/SpinButtonElement.cpp#newcode104 Source/core/html/shadow/SpinButtonElement.cpp:104: m_spinButtonOwner->spinButtonDidReleaseMouseCapture(); Why pinButtonDidReleaseMouseCapture is called? We don't release mouse ...
6 years, 8 months ago (2014-04-07 04:31:17 UTC) #16
Habib Virji
Apologise, it was from double change events changes. UPload new patch without those changes. https://codereview.chromium.org/196933006/diff/120001/Source/core/html/shadow/SpinButtonElement.cpp ...
6 years, 8 months ago (2014-04-07 07:33:18 UTC) #17
tkent
https://codereview.chromium.org/196933006/diff/140001/LayoutTests/fast/forms/number/number-spinbutton-changeevent-trigger.html File LayoutTests/fast/forms/number/number-spinbutton-changeevent-trigger.html (right): https://codereview.chromium.org/196933006/diff/140001/LayoutTests/fast/forms/number/number-spinbutton-changeevent-trigger.html#newcode29 LayoutTests/fast/forms/number/number-spinbutton-changeevent-trigger.html:29: eventSender.mouseUp(); We should test if mouseDown won't dispatch a ...
6 years, 8 months ago (2014-04-07 07:53:26 UTC) #18
Habib Virji
Thanks updated. https://codereview.chromium.org/196933006/diff/140001/LayoutTests/fast/forms/number/number-spinbutton-changeevent-trigger.html File LayoutTests/fast/forms/number/number-spinbutton-changeevent-trigger.html (right): https://codereview.chromium.org/196933006/diff/140001/LayoutTests/fast/forms/number/number-spinbutton-changeevent-trigger.html#newcode29 LayoutTests/fast/forms/number/number-spinbutton-changeevent-trigger.html:29: eventSender.mouseUp(); On 2014/04/07 07:53:26, tkent wrote: > ...
6 years, 8 months ago (2014-04-07 10:02:42 UTC) #19
tkent
lgtm. Thank you for the hard work. Now the code change looks very simple and ...
6 years, 8 months ago (2014-04-07 23:15:09 UTC) #20
tkent
The CQ bit was checked by tkent@chromium.org
6 years, 8 months ago (2014-04-07 23:15:13 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/habib.virji@samsung.com/196933006/160001
6 years, 8 months ago (2014-04-07 23:15:19 UTC) #22
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 8 months ago (2014-04-07 23:36:04 UTC) #23
commit-bot: I haz the power
Try jobs failed on following builders: tryserver.blink on win_blink_compile_dbg
6 years, 8 months ago (2014-04-07 23:36:05 UTC) #24
tkent
The CQ bit was checked by tkent@chromium.org
6 years, 8 months ago (2014-04-07 23:42:51 UTC) #25
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/habib.virji@samsung.com/196933006/160001
6 years, 8 months ago (2014-04-07 23:42:54 UTC) #26
commit-bot: I haz the power
Change committed as 171006
6 years, 8 months ago (2014-04-08 00:08:44 UTC) #27
Habib Virji
6 years, 8 months ago (2014-04-08 05:18:42 UTC) #28
Message was sent while issue was closed.
Thanks for your patience it was your comments and directions that made it
possible. Will upload new code for date change event.

Powered by Google App Engine
This is Rietveld 408576698