Bug 501496 part.8 Native key event tests should prevent default only when the event is keypress r=smaug
authorMasayuki Nakano <masayuki@d-toybox.com>
Thu, 25 Jul 2013 15:09:29 +0900
changeset 152205 ab40003ed2dc4d01ace1386c36806b2f76ea5e74
parent 152204 d29dd6534e43a3751875980dcf0c60f1d4730817
child 152206 441c1fc13ebdc8e30ca97f2ca87e1995d6b1f5e8
push id2859
push userakeybl@mozilla.com
push dateMon, 16 Sep 2013 19:14:59 +0000
treeherdermozilla-beta@87d3c51cd2bf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs501496
milestone25.0a1
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
Bug 501496 part.8 Native key event tests should prevent default only when the event is keypress r=smaug
widget/tests/test_keycodes.xul
--- a/widget/tests/test_keycodes.xul
+++ b/widget/tests/test_keycodes.xul
@@ -231,17 +231,19 @@ function runKeyEventTests()
           return testingEvent.capsLock && removeFlag(e, kCapsLockFlag) && expectedDOMKeyCode != e.keyCode;
       }
       return false;
     }
 
     // Ignore the state changing key events which is fired by the testing event.
     if (!isStateChangingModifierKeyEvent(e))
       eventList.push(e);
-    e.preventDefault();
+    if (e.type == "keypress") {
+      e.preventDefault();
+    }
   }
 
   const SHOULD_DELIVER_NONE             = 0x0;
   const SHOULD_DELIVER_KEYDOWN          = 0x1;
   const SHOULD_DELIVER_KEYPRESS         = 0x2;
   const SHOULD_DELIVER_KEYUP            = 0x4;
   const SHOULD_NOT_CAUSE_INPUT          = 0x8;
   const SHOULD_DELIVER_ALL              = SHOULD_DELIVER_KEYDOWN |