New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.
Starred by 5 users

Issue metadata

Status: Fixed
Owner: ----
Closed: Apr 2014
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 3
Type: Bug



Sign in to add a comment

change event dispatched too often on input[type=range] and input element with spinbutton (type=number, type=time)

Reported by a.farkas...@gmail.com, Oct 14 2012

Issue description

UserAgent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20100101 Firefox/16.0

Steps to reproduce the problem:
1. create an input element with type range
2. add a change event to the element
3. change the value of the input by dragging it with your mouse

What is the expected behavior?
The change event should be dispatched as soon as the user releases it (mouseup).

What went wrong?
The change event is called while dragging all the time.

Did this work before? N/A 

Chrome version: Version 24.0.1294.0 canary  Channel: canary
OS Version: 6.1 (Windows 7, Windows Server 2008 R2)

In case of a form element with a special UI like (range/number) the change event shouldn't be called, while pressing the mousebutton. The specification requires a special commit action (www.w3.org/TR/html5/common-input-element-apis.html#event-input-change). While the user hasn't released the mousebutton (mouseup), it's quite possible, that the user hasn't commited a final value and therefore a change event shouldn't be dispatched.
 

Comment 1 by tkent@chromium.org, Oct 15 2012

Labels: Area-WebKit WebKit-Forms
Status: Untriaged
I was wondering, why this bug, is untriaged. Especially the fact that we have additionally the input event, dispatching the change to often doesn't give us any improvement.

Additionally, I see more and more developers having troubble with the current implementation. (see: http://stackoverflow.com/questions/5165579/onchange-event-for-html5-range)
Project Member

Comment 3 by bugdroid1@chromium.org, Mar 10 2013

Labels: -Area-WebKit -WebKit-Forms Cr-Content Cr-Content-Forms

Comment 4 by tkent@chromium.org, Apr 1 2013

Labels: -OS-Windows OS-All
As for type=range, the WHATWG specification was clarified so that we should not dispatch change events during drag.  http://html5.org/tools/web-apps-tracker?from=7786&to=7787


Project Member

Comment 5 by bugdroid1@chromium.org, Apr 5 2013

Labels: -Cr-Content Cr-Blink
Project Member

Comment 6 by bugdroid1@chromium.org, Apr 6 2013

Labels: -Cr-Content-Forms Cr-Blink-Forms
Cc: kenjibaheux@chromium.org
Labels: tbc-p2 hotlist-fixit
Status: Available

Comment 9 by tkent@chromium.org, May 8 2013

Labels: -Pri-2 -tbc-p2 Pri-3

Comment 10 by tkent@chromium.org, Dec 19 2013

Summary: change event dispatched too often on input[type=range] and input element with spinbutton (type=number, type=time) (was: change event dispatched to often on input[type=range] and input element with spinbutton (type=number, type=time))
Project Member

Comment 12 by bugdroid1@chromium.org, Jan 14 2014

The following revision refers to this bug:
    http://src.chromium.org/viewvc/blink?view=rev&rev=165061

------------------------------------------------------------------------
r165061 | habib.virji@samsung.com | 2014-01-14T11:56:35.461475Z

Changed paths:
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/fast/forms/range/range-drag-when-toggled-disabled-expected.txt?r1=165061&r2=165060&pathrev=165061
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/html/shadow/SliderThumbElement.cpp?r1=165061&r2=165060&pathrev=165061
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/fast/forms/range/range-drag-when-toggled-disabled.html?r1=165061&r2=165060&pathrev=165061

SliderThumb is responsible for sending onchange for range input type. It is updated to send change event in its defaultEventHandler only for mouse up event. 
Previously onchange was triggered for any position change

R=tkent             
BUG= 155747 
TEST=Range toggle test updated to generate onchange only on mouseUp.

Review URL: https://codereview.chromium.org/125973004
------------------------------------------------------------------------
Project Member

Comment 13 by bugdroid1@chromium.org, Jan 17 2014

The following revision refers to this bug:
    http://src.chromium.org/viewvc/blink?view=rev&rev=165300

------------------------------------------------------------------------
r165300 | habib.virji@samsung.com | 2014-01-17T10:45:46.072435Z

Changed paths:
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/html/shadow/SpinButtonElement.cpp?r1=165300&r2=165299&pathrev=165300
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/html/forms/BaseMultipleFieldsDateAndTimeInputType.cpp?r1=165300&r2=165299&pathrev=165300
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/html/forms/TextFieldInputType.h?r1=165300&r2=165299&pathrev=165300
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/html/forms/InputType.cpp?r1=165300&r2=165299&pathrev=165300
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/html/shadow/SpinButtonElement.h?r1=165300&r2=165299&pathrev=165300
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/html/forms/BaseMultipleFieldsDateAndTimeInputType.h?r1=165300&r2=165299&pathrev=165300
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/fast/forms/number/number-spinbutton-changeevent-trigger-expected.txt?r1=165300&r2=165299&pathrev=165300
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/html/forms/TextFieldInputType.cpp?r1=165300&r2=165299&pathrev=165300
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/fast/forms/number/number-spinbutton-changeevent-trigger.html?r1=165300&r2=165299&pathrev=165300
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/fast/forms/number/number-type-update-by-change-event.html?r1=165300&r2=165299&pathrev=165300

Do not dispatch 'change' events during pressing spin buttons for input[type=number].

TextFieldInputType sends change event for its derived class. Change is
done for DispatchInputAndChangeEvent to behave similar to
DispatchChangeEvent.
DispatchChangeEvent is generated by Range, Radio, File and Checkbox
input type.
DispatchInputAndChangeEvent is generated by inputtype for step up and
down, BaseChooser/BaseMultipleFieldsDateandTime also generates
DispatchInputAndChangeEvent.
Since it is different set of inputs that generate DispatchChange and
DispatchInputAndChange, both are kept but behavior is changed; this
allows spin button to handle mouseup event.
Keyboard events are also handled for spin button.

R=tkent
BUG= 155747 
TEST=automated

Review URL: https://codereview.chromium.org/128133002
------------------------------------------------------------------------
Project Member

Comment 14 by bugdroid1@chromium.org, Jan 20 2014

The following revision refers to this bug:
    http://src.chromium.org/viewvc/blink?view=rev&rev=165376

------------------------------------------------------------------------
r165376 | tkent@chromium.org | 2014-01-20T03:44:36.282754Z

Changed paths:
   D http://src.chromium.org/viewvc/blink/trunk/LayoutTests/fast/forms/number/number-spinbutton-changeevent-trigger-expected.txt?r1=165376&r2=165375&pathrev=165376
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/html/forms/TextFieldInputType.cpp?r1=165376&r2=165375&pathrev=165376
   D http://src.chromium.org/viewvc/blink/trunk/LayoutTests/fast/forms/number/number-spinbutton-changeevent-trigger.html?r1=165376&r2=165375&pathrev=165376
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/fast/forms/number/number-type-update-by-change-event.html?r1=165376&r2=165375&pathrev=165376
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/html/shadow/SpinButtonElement.cpp?r1=165376&r2=165375&pathrev=165376
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/html/forms/BaseMultipleFieldsDateAndTimeInputType.cpp?r1=165376&r2=165375&pathrev=165376
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/html/forms/TextFieldInputType.h?r1=165376&r2=165375&pathrev=165376
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/html/forms/InputType.cpp?r1=165376&r2=165375&pathrev=165376
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/html/shadow/SpinButtonElement.h?r1=165376&r2=165375&pathrev=165376
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/html/forms/BaseMultipleFieldsDateAndTimeInputType.h?r1=165376&r2=165375&pathrev=165376

Revert of Update of change event for input type number (https://codereview.chromium.org/128133002/)

Reason for revert:
I'm afraid It made time-multiple-fields-spinbutton-change-and-input-events.html falky.


Original issue's description:
> Do not dispatch 'change' events during pressing spin buttons for input[type=number].
> 
> TextFieldInputType sends change event for its derived class. Change is
> done for DispatchInputAndChangeEvent to behave similar to
> DispatchChangeEvent.
> DispatchChangeEvent is generated by Range, Radio, File and Checkbox
> input type.
> DispatchInputAndChangeEvent is generated by inputtype for step up and
> down, BaseChooser/BaseMultipleFieldsDateandTime also generates
> DispatchInputAndChangeEvent.
> Since it is different set of inputs that generate DispatchChange and
> DispatchInputAndChange, both are kept but behavior is changed; this
> allows spin button to handle mouseup event.
> Keyboard events are also handled for spin button.
> 
> R=tkent
> BUG= 155747 
> TEST=automated
> 
> Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=165300

TBR=keishi@chromium.org,habib.virji@samsung.com
NOTREECHECKS=true
NOTRY=true
BUG= 155747 

Review URL: https://codereview.chromium.org/140793012
------------------------------------------------------------------------
Project Member

Comment 15 by bugdroid1@chromium.org, Jan 20 2014

The following revision refers to this bug:
    http://src.chromium.org/viewvc/blink?view=rev&rev=165377

------------------------------------------------------------------------
r165377 | tkent@chromium.org | 2014-01-20T04:37:05.421562Z

Changed paths:
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/html/forms/BaseMultipleFieldsDateAndTimeInputType.h?r1=165377&r2=165376&pathrev=165377
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/fast/forms/number/number-spinbutton-changeevent-trigger-expected.txt?r1=165377&r2=165376&pathrev=165377
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/html/forms/TextFieldInputType.cpp?r1=165377&r2=165376&pathrev=165377
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/fast/forms/number/number-spinbutton-changeevent-trigger.html?r1=165377&r2=165376&pathrev=165377
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/fast/forms/number/number-type-update-by-change-event.html?r1=165377&r2=165376&pathrev=165377
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/html/shadow/SpinButtonElement.cpp?r1=165377&r2=165376&pathrev=165377
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/html/forms/BaseMultipleFieldsDateAndTimeInputType.cpp?r1=165377&r2=165376&pathrev=165377
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/html/forms/TextFieldInputType.h?r1=165377&r2=165376&pathrev=165377
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/html/forms/InputType.cpp?r1=165377&r2=165376&pathrev=165377
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/html/shadow/SpinButtonElement.h?r1=165377&r2=165376&pathrev=165377

Revert "Revert of Update of change event for input type number (https://codereview.chromium.org/128133002/)"

The revert didn't help.

Original issue's description:
> Revert of Update of change event for input type number (https://codereview.chromium.org/128133002/)
>
> Reason for revert:
> I'm afraid It made time-multiple-fields-spinbutton-change-and-input-events.html flaky.
>
>
> Original issue's description:
> > Do not dispatch 'change' events during pressing spin buttons for input[type=number].
> >
> > TextFieldInputType sends change event for its derived class. Change is
> > done for DispatchInputAndChangeEvent to behave similar to
> > DispatchChangeEvent.
> > DispatchChangeEvent is generated by Range, Radio, File and Checkbox
> > input type.
> > DispatchInputAndChangeEvent is generated by inputtype for step up and
> > down, BaseChooser/BaseMultipleFieldsDateandTime also generates
> > DispatchInputAndChangeEvent.
> > Since it is different set of inputs that generate DispatchChange and
> > DispatchInputAndChange, both are kept but behavior is changed; this
> > allows spin button to handle mouseup event.
> > Keyboard events are also handled for spin button.
> >
> > R=tkent
> > BUG= 155747 
> > TEST=automated
> >
> > Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=165300
>
> TBR=keishi@chromium.org,habib.virji@samsung.com
> NOTREECHECKS=true
> NOTRY=true
> BUG= 155747 

TBR=keishi@chromium.org,habib.virji@samsung.com
NOTREECHECKS=true
NOTRY=true
BUG= 155747 

Review URL: https://codereview.chromium.org/142963002
------------------------------------------------------------------------
Project Member

Comment 16 by bugdroid1@chromium.org, Jan 21 2014

The following revision refers to this bug:
    http://src.chromium.org/viewvc/blink?view=rev&rev=165455

------------------------------------------------------------------------
r165455 | habib.virji@samsung.com | 2014-01-21T11:43:10.189436Z

Changed paths:
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/fast/forms/datetimelocal-multiple-fields/datetimelocal-multiple-fields-spinbutton-change-and-input-events-expected.txt?r1=165455&r2=165454&pathrev=165455
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/html/shadow/DateTimeEditElement.cpp?r1=165455&r2=165454&pathrev=165455
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/html/shadow/DateTimeFieldElement.h?r1=165455&r2=165454&pathrev=165455
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/html/forms/BaseMultipleFieldsDateAndTimeInputType.cpp?r1=165455&r2=165454&pathrev=165455
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/html/shadow/DateTimeEditElement.h?r1=165455&r2=165454&pathrev=165455
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/fast/forms/number/number-spinbutton-change-and-input-events-expected.txt?r1=165455&r2=165454&pathrev=165455
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/fast/forms/resources/common-spinbutton-change-and-input-events.js?r1=165455&r2=165454&pathrev=165455
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/fast/forms/week-multiple-fields/week-multiple-fields-spinbutton-change-and-input-events-expected.txt?r1=165455&r2=165454&pathrev=165455
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/html/forms/BaseMultipleFieldsDateAndTimeInputType.h?r1=165455&r2=165454&pathrev=165455
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/fast/forms/date-multiple-fields/date-multiple-fields-spinbutton-change-and-input-events-expected.txt?r1=165455&r2=165454&pathrev=165455
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/fast/forms/month-multiple-fields/month-multiple-fields-spinbutton-change-and-input-events-expected.txt?r1=165455&r2=165454&pathrev=165455
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/fast/forms/time-multiple-fields/time-multiple-fields-spinbutton-change-and-input-events-expected.txt?r1=165455&r2=165454&pathrev=165455
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/html/shadow/DateTimeFieldElement.cpp?r1=165455&r2=165454&pathrev=165455

Update of change event for datetime input type

BaseMultipleFieldDateAndTime includes changes for sending change event when popup is closed, keyboard event and mouse event.

BaseChoosedOnlyDateAndTime includes changes for sending change event when popup is closed. Special case for input type datetime-local.

R=tkent
BUG= 155747 
TEST=Fixes currently broken test in bug331189

Review URL: https://codereview.chromium.org/128153002
------------------------------------------------------------------------

Comment 17 by tkent@chromium.org, Jan 28 2014

Labels: M-34
I checked the current behavior with Chrome 34 canary, and found some problems.

* Hovering over a spin button in type=number or type=date dispatches unexpected 'change' event even though I doesn't change the value at all.

* The first click of up/down arrow in a spin button dispatches a 'change' event, but the second click doesn't.

* Mouseup on the slider thumb of type=range dispatches only 'change' event. We should dispatch 'input' event too.

* Hovering trigger change event  is due to releaseCapture() being triggered from defaultEventHandler():133. As releaseCapture is being called from multiple place, change event should probably only be called from inside mouseUp event i.e defaultEventHandler():115. I have uploaded a new patch with the proposed fix:https://codereview.chromium.org/144713007/. As you earlier suggested to move change event inside releaseCapture, it will probably require moving out releaseCapture from line 133, but above patch fixes up all issues.

* Regarding Spinner: This issue was due to  m_capture not getting reset, if mouse is not moved away from spinner element. If mouse is moved away from spinner element and brought back, m_capture was getting set. Moving change event to defaultEventHandler():115, resolves this issue too. 

* Uploaded new patch to trigger change and input event for slider thumb: https://codereview.chromium.org/148763005/. Few expected files had to be updated to handle both input and change event. 
Project Member

Comment 19 by bugdroid1@chromium.org, Feb 12 2014

The following revision refers to this bug:
    http://src.chromium.org/viewvc/blink?view=rev&rev=166970

------------------------------------------------------------------------
r166970 | tkent@chromium.org | 2014-02-12T07:36:16.882983Z

Changed paths:
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/fast/forms/number/number-spinbutton-change-and-input-events-expected.txt?r1=166970&r2=166969&pathrev=166970
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/fast/forms/resources/common-spinbutton-change-and-input-events.js?r1=166970&r2=166969&pathrev=166970
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/fast/forms/week-multiple-fields/week-multiple-fields-spinbutton-change-and-input-events-expected.txt?r1=166970&r2=166969&pathrev=166970
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/html/forms/BaseMultipleFieldsDateAndTimeInputType.h?r1=166970&r2=166969&pathrev=166970
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/fast/forms/date-multiple-fields/date-multiple-fields-spinbutton-change-and-input-events-expected.txt?r1=166970&r2=166969&pathrev=166970
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/fast/forms/month-multiple-fields/month-multiple-fields-spinbutton-change-and-input-events-expected.txt?r1=166970&r2=166969&pathrev=166970
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/fast/forms/time-multiple-fields/time-multiple-fields-spinbutton-change-and-input-events-expected.txt?r1=166970&r2=166969&pathrev=166970
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/html/shadow/DateTimeFieldElement.cpp?r1=166970&r2=166969&pathrev=166970
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/fast/forms/datetimelocal-multiple-fields/datetimelocal-multiple-fields-spinbutton-change-and-input-events-expected.txt?r1=166970&r2=166969&pathrev=166970
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/html/shadow/DateTimeEditElement.cpp?r1=166970&r2=166969&pathrev=166970
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/html/shadow/DateTimeFieldElement.h?r1=166970&r2=166969&pathrev=166970
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/html/forms/BaseMultipleFieldsDateAndTimeInputType.cpp?r1=166970&r2=166969&pathrev=166970
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/html/shadow/DateTimeEditElement.h?r1=166970&r2=166969&pathrev=166970

Revert of Update of change event for datetime input type (https://codereview.chromium.org/128153002/)

Reason for revert:
INPUT element dispatches extra events.


Original issue's description:
> Update of change event for datetime input type
> 
> BaseMultipleFieldDateAndTime includes changes for sending change event when popup is closed, keyboard event and mouse event.
> 
> BaseChoosedOnlyDateAndTime includes changes for sending change event when popup is closed. Special case for input type datetime-local.
> 
> R=tkent
> BUG= 155747 
> TEST=Fixes currently broken test in bug331189
> 
> Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=165455

TBR=keishi@chromium.org,habib.virji@samsung.com
NOTREECHECKS=true
NOTRY=true
BUG= 155747 

Review URL: https://codereview.chromium.org/159893007
------------------------------------------------------------------------
Project Member

Comment 20 by bugdroid1@chromium.org, Feb 12 2014

The following revision refers to this bug:
    http://src.chromium.org/viewvc/blink?view=rev&rev=166983

------------------------------------------------------------------------
r166983 | tkent@chromium.org | 2014-02-12T08:01:38.275328Z

Changed paths:
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/html/forms/TextFieldInputType.cpp?r1=166983&r2=166982&pathrev=166983
   D http://src.chromium.org/viewvc/blink/trunk/LayoutTests/fast/forms/number/number-spinbutton-changeevent-trigger.html?r1=166983&r2=166982&pathrev=166983
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/fast/forms/number/number-type-update-by-change-event.html?r1=166983&r2=166982&pathrev=166983
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/html/shadow/SpinButtonElement.cpp?r1=166983&r2=166982&pathrev=166983
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/html/forms/BaseMultipleFieldsDateAndTimeInputType.cpp?r1=166983&r2=166982&pathrev=166983
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/html/forms/TextFieldInputType.h?r1=166983&r2=166982&pathrev=166983
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/html/forms/InputType.cpp?r1=166983&r2=166982&pathrev=166983
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/html/shadow/SpinButtonElement.h?r1=166983&r2=166982&pathrev=166983
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/html/forms/BaseMultipleFieldsDateAndTimeInputType.h?r1=166983&r2=166982&pathrev=166983
   D http://src.chromium.org/viewvc/blink/trunk/LayoutTests/fast/forms/number/number-spinbutton-changeevent-trigger-expected.txt?r1=166983&r2=166982&pathrev=166983

Revert of Update of change event for input type number (https://codereview.chromium.org/128133002/)

Reason for revert:
INPUT element dispatches extra events.

Original issue's description:
> Do not dispatch 'change' events during pressing spin buttons for input[type=number].
>
> TextFieldInputType sends change event for its derived class. Change is
> done for DispatchInputAndChangeEvent to behave similar to
> DispatchChangeEvent.
> DispatchChangeEvent is generated by Range, Radio, File and Checkbox
> input type.
> DispatchInputAndChangeEvent is generated by inputtype for step up and
> down, BaseChooser/BaseMultipleFieldsDateandTime also generates
> DispatchInputAndChangeEvent.
> Since it is different set of inputs that generate DispatchChange and
> DispatchInputAndChange, both are kept but behavior is changed; this
> allows spin button to handle mouseup event.
> Keyboard events are also handled for spin button.
>
> R=tkent
> BUG= 155747 
> TEST=automated
>
> Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=165300

TBR=keishi@chromium.org,habib.virji@samsung.com
NOTREECHECKS=true
NOTRY=true
BUG= 155747 

Review URL: https://codereview.chromium.org/157813010
------------------------------------------------------------------------

Comment 21 by dxie@chromium.org, Mar 3 2014

Labels: -M-34 MovedFrom-34 M-35
Status: Untriaged
Moving all non essential bugs to the next Milestone.
Labels: Cr-Blink-Forms-Range Cr-Blink-Forms-Number Cr-Blink-Forms-Date

Comment 23 by kareng@google.com, Apr 7 2014

Labels: -M-35 MovedFrom-35
This issue has already been moved once and is lower than Priority 1,therefore removing mstone.
Project Member

Comment 24 by bugdroid1@chromium.org, Apr 8 2014

The following revision refers to this bug:
  http://src.chromium.org/viewvc/blink?view=rev&rev=171006

------------------------------------------------------------------
r171006 | habib.virji@samsung.com | 2014-04-08T00:08:41.136088Z

Changed paths:
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/html/HTMLTextFormControlElement.cpp?r1=171006&r2=171005&pathrev=171006
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/html/shadow/SpinButtonElement.h?r1=171006&r2=171005&pathrev=171006
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/html/forms/BaseMultipleFieldsDateAndTimeInputType.h?r1=171006&r2=171005&pathrev=171006
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/fast/forms/number/number-spinbutton-changeevent-trigger-expected.txt?r1=171006&r2=171005&pathrev=171006
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/html/forms/TextFieldInputType.cpp?r1=171006&r2=171005&pathrev=171006
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/fast/forms/number/number-spinbutton-changeevent-trigger.html?r1=171006&r2=171005&pathrev=171006
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/html/shadow/SpinButtonElement.cpp?r1=171006&r2=171005&pathrev=171006
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/html/forms/BaseMultipleFieldsDateAndTimeInputType.cpp?r1=171006&r2=171005&pathrev=171006
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/html/forms/TextFieldInputType.h?r1=171006&r2=171005&pathrev=171006
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/html/forms/InputType.cpp?r1=171006&r2=171005&pathrev=171006

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.

Review URL: https://codereview.chromium.org/196933006
-----------------------------------------------------------------
Project Member

Comment 25 by bugdroid1@chromium.org, Apr 10 2014

The following revision refers to this bug:
  http://src.chromium.org/viewvc/blink?view=rev&rev=171217

------------------------------------------------------------------
r171217 | habib.virji@samsung.com | 2014-04-10T01:55:14.157786Z

Changed paths:
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/fast/forms/date-multiple-fields/date-multiple-fields-spinbutton-change-and-input-events-expected.txt?r1=171217&r2=171216&pathrev=171217
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/fast/forms/month-multiple-fields/month-multiple-fields-spinbutton-change-and-input-events-expected.txt?r1=171217&r2=171216&pathrev=171217
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/fast/forms/time-multiple-fields/time-multiple-fields-spinbutton-change-and-input-events-expected.txt?r1=171217&r2=171216&pathrev=171217
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/html/shadow/DateTimeFieldElement.cpp?r1=171217&r2=171216&pathrev=171217
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/fast/forms/datetimelocal-multiple-fields/datetimelocal-multiple-fields-spinbutton-change-and-input-events-expected.txt?r1=171217&r2=171216&pathrev=171217
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/html/shadow/DateTimeEditElement.cpp?r1=171217&r2=171216&pathrev=171217
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/html/shadow/DateTimeFieldElement.h?r1=171217&r2=171216&pathrev=171217
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/html/forms/BaseMultipleFieldsDateAndTimeInputType.cpp?r1=171217&r2=171216&pathrev=171217
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/html/shadow/DateTimeEditElement.h?r1=171217&r2=171216&pathrev=171217
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/fast/forms/number/number-spinbutton-change-and-input-events-expected.txt?r1=171217&r2=171216&pathrev=171217
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/fast/forms/resources/common-spinbutton-change-and-input-events.js?r1=171217&r2=171216&pathrev=171217
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/fast/forms/week-multiple-fields/week-multiple-fields-spinbutton-change-and-input-events-expected.txt?r1=171217&r2=171216&pathrev=171217
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/html/forms/BaseMultipleFieldsDateAndTimeInputType.h?r1=171217&r2=171216&pathrev=171217

Do not dispatch change event when pressing spin button for input type=datetime

Date time dispatches change event only on mouseUp. On mouseDown only
input event is triggered. Changes in this CL are to incorporate keyboard press
and picker selection. Change event trigger for mouseDown and mouseUp
relies on CL#196933006.

R=tkent@chromium.org,keishi1@chromium.org
BUG= 155747 
TEST=Test on mouseDown only input event is triggered and on mouseUp only change event is triggered.

Review URL: https://codereview.chromium.org/228633003
-----------------------------------------------------------------

Comment 26 by tkent@chromium.org, Apr 11 2014

Labels: -MovedFrom-34 -MovedFrom-35 M-36
Status: Fixed
Basically fixed.  One bug on Android remains,  Issue 361335 

Sign in to add a comment