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

Issue 159483004: Revert of Update of change event for input type number (Closed)

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

Description

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

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+8 lines, -68 lines) Patch
D LayoutTests/fast/forms/number/number-spinbutton-changeevent-trigger.html View 1 chunk +0 lines, -33 lines 0 comments Download
D LayoutTests/fast/forms/number/number-spinbutton-changeevent-trigger-expected.txt View 1 chunk +0 lines, -10 lines 0 comments Download
M LayoutTests/fast/forms/number/number-type-update-by-change-event.html View 1 chunk +0 lines, -1 line 0 comments Download
M Source/core/html/forms/BaseMultipleFieldsDateAndTimeInputType.h View 1 chunk +0 lines, -1 line 0 comments Download
M Source/core/html/forms/BaseMultipleFieldsDateAndTimeInputType.cpp View 1 chunk +0 lines, -5 lines 0 comments Download
M Source/core/html/forms/InputType.cpp View 2 chunks +5 lines, -5 lines 0 comments Download
M Source/core/html/forms/TextFieldInputType.h View 1 chunk +0 lines, -1 line 0 comments Download
M Source/core/html/forms/TextFieldInputType.cpp View 2 chunks +0 lines, -6 lines 0 comments Download
M Source/core/html/shadow/SpinButtonElement.h View 1 chunk +0 lines, -1 line 0 comments Download
M Source/core/html/shadow/SpinButtonElement.cpp View 2 chunks +3 lines, -5 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
tkent
Created Revert of Update of change event for input type number
6 years, 10 months ago (2014-02-12 07:37:47 UTC) #1
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/tkent@chromium.org/159483004/1
6 years, 10 months ago (2014-02-12 07:37:58 UTC) #2
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 10 months ago (2014-02-12 07:38:02 UTC) #3
commit-bot: I haz the power
6 years, 10 months ago (2014-02-12 07:38:02 UTC) #4
Failed to apply patch for Source/core/html/forms/InputType.cpp:
While running patch -p1 --forward --force --no-backup-if-mismatch;
  patching file Source/core/html/forms/InputType.cpp
  Hunk #1 FAILED at 934.
  Hunk #2 FAILED at 952.
  2 out of 2 hunks FAILED -- saving rejects to file
Source/core/html/forms/InputType.cpp.rej

Patch:       Source/core/html/forms/InputType.cpp
Index: Source/core/html/forms/InputType.cpp
diff --git a/Source/core/html/forms/InputType.cpp
b/Source/core/html/forms/InputType.cpp
index
0b435546b2b7df229b94fa85e38ba3af0ec17112..7f92a4a1b0b5b4a784c560be1f31e981c27e3e87
100644
--- a/Source/core/html/forms/InputType.cpp
+++ b/Source/core/html/forms/InputType.cpp
@@ -934,7 +934,7 @@
         setValueAsDecimal(current, DispatchNoEvent, IGNORE_EXCEPTION);
     }
     if ((sign > 0 && current < stepRange.minimum()) || (sign < 0 && current >
stepRange.maximum())) {
-        setValueAsDecimal(sign > 0 ? stepRange.minimum() : stepRange.maximum(),
DispatchChangeEvent, IGNORE_EXCEPTION);
+        setValueAsDecimal(sign > 0 ? stepRange.minimum() : stepRange.maximum(),
DispatchInputAndChangeEvent, IGNORE_EXCEPTION);
     } else {
         if (stepMismatch(element().value())) {
             ASSERT(!step.isZero());
@@ -952,13 +952,13 @@
             if (newValue > stepRange.maximum())
                 newValue = stepRange.maximum();
 
-            setValueAsDecimal(newValue, n == 1 || n == -1 ? DispatchChangeEvent
: DispatchNoEvent, IGNORE_EXCEPTION);
+            setValueAsDecimal(newValue, n == 1 || n == -1 ?
DispatchInputAndChangeEvent : DispatchNoEvent, IGNORE_EXCEPTION);
             if (n > 1)
-                applyStep(n - 1, AnyIsDefaultStep, DispatchChangeEvent,
IGNORE_EXCEPTION);
+                applyStep(n - 1, AnyIsDefaultStep, DispatchInputAndChangeEvent,
IGNORE_EXCEPTION);
             else if (n < -1)
-                applyStep(n + 1, AnyIsDefaultStep, DispatchChangeEvent,
IGNORE_EXCEPTION);
+                applyStep(n + 1, AnyIsDefaultStep, DispatchInputAndChangeEvent,
IGNORE_EXCEPTION);
         } else {
-            applyStep(n, AnyIsDefaultStep, DispatchChangeEvent,
IGNORE_EXCEPTION);
+            applyStep(n, AnyIsDefaultStep, DispatchInputAndChangeEvent,
IGNORE_EXCEPTION);
         }
     }
 }

Powered by Google App Engine
This is Rietveld 408576698