Backout b453362886a9 before recommitting with the correct bug commit message. r=me
authorJonathan Watt <jwatt@jwatt.org>
Sun, 08 Dec 2013 17:57:14 +0000
changeset 175122 35d7b6de678b930ebb0ff4e1a475be7118920181
parent 175121 fa0e8a8ee25be30068db257021386bdd2c50c1c9
child 175123 e9b06b13344d3ec0a9558288acd62ec601663bce
push id445
push userffxbld
push dateMon, 10 Mar 2014 22:05:19 +0000
treeherdermozilla-release@dc38b741b04e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersme
milestone28.0a1
backs outb453362886a9542188cfc986af40444d00303a3d
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backout b453362886a9 before recommitting with the correct bug commit message. r=me
content/html/content/src/HTMLInputElement.cpp
content/html/content/test/forms/test_input_number_key_events.html
--- a/content/html/content/src/HTMLInputElement.cpp
+++ b/content/html/content/src/HTMLInputElement.cpp
@@ -3830,20 +3830,21 @@ HTMLInputElement::PostHandleEvent(nsEven
       // control and as a result aVisitor.mEventStatus will already have been
       // set to nsEventStatus_eConsumeNoDefault. However, we know that
       // whenever the up/down arrow keys cause the value of the number
       // control to change the string in the text control will change, and
       // the cursor will be moved to the end of the text control, overwriting
       // the editor's handling of up/down keypress events. For that reason we
       // just ignore aVisitor.mEventStatus here and go ahead and handle the
       // event to increase/decrease the value of the number control.
-      if (!aVisitor.mEvent->mFlags.mDefaultPreventedByContent) {
-        StepNumberControlForUserEvent(keyEvent->keyCode == NS_VK_UP ? 1 : -1);
-        aVisitor.mEventStatus = nsEventStatus_eConsumeNoDefault;
-      }
+      // XXX we still need to allow script to call preventDefault() on the
+      // event, but right now we can't tell the difference between the editor
+      // on script doing that (bug 930374).
+      StepNumberControlForUserEvent(keyEvent->keyCode == NS_VK_UP ? 1 : -1);
+      aVisitor.mEventStatus = nsEventStatus_eConsumeNoDefault;
     } else if (nsEventStatus_eIgnore == aVisitor.mEventStatus) {
       switch (aVisitor.mEvent->message) {
 
         case NS_FOCUS_CONTENT:
         {
           // see if we should select the contents of the textbox. This happens
           // for text and password fields when the field was focused by the
           // keyboard or a navigation, the platform allows it, and it wasn't
--- a/content/html/content/test/forms/test_input_number_key_events.html
+++ b/content/html/content/test/forms/test_input_number_key_events.html
@@ -172,25 +172,15 @@ function test() {
     expectedVal = expectedValAfterKeyEvent(key, elem);
     synthesizeKey(key, {});
     is(elem.value, expectedVal, "Test " + key + " for number control with value set to the minimum (" + oldVal + ")");
 
     // Same again:
     expectedVal = expectedValAfterKeyEvent(key, elem);
     synthesizeKey(key, {});
     is(elem.value, expectedVal, "Test repeat of " + key + " for number control");
-
-    // Test preventDefault():
-    elem.addEventListener("keypress", function(evt) {
-      evt.preventDefault();
-      elem.removeEventListener("keypress", arguments.callee, false);
-    }, false);
-    oldVal = elem.value = 0;
-    expectedVal = 0;
-    synthesizeKey(key, {});
-    is(elem.value, expectedVal, "Test " + key + " for number control where scripted preventDefault() should prevent the value changing");
   }
 }
 
 </script>
 </pre>
 </body>
 </html>