Bug 1440189 - part 1: Stop dispatching keypress event to the default event group in web content (only Nightly and early Beta) r=smaug
authorMasayuki Nakano <masayuki@d-toybox.com>
Fri, 26 Jan 2018 00:16:14 +0900
changeset 405883 741e9659cd4cb0f40973df5bfd3c1543b0698d8d
parent 405882 61bbd00bee83d35bfa6d14a5e92f76f5d2150c9f
child 405884 eb86519cc44fe0d2b64eed8363d7ff36bdbc1499
push id33536
push usertoros@mozilla.com
push dateThu, 01 Mar 2018 17:11:23 +0000
treeherdermozilla-central@bf8a7dceffc4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1440189
milestone60.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 1440189 - part 1: Stop dispatching keypress event to the default event group in web content (only Nightly and early Beta) r=smaug UI Events declares that keypress event should be fired only when the keydown sequence produces some characters. For conforming to UI Events and compatibility with the other browsers, we should stop dispatching keypress events for non-printable keys. For getting regression reports, we should enable this new behavior only on Nightly and early Beta. MozReview-Commit-ID: 5IIL9huejXH
modules/libpref/init/all.js
widget/TextEventDispatcher.cpp
--- a/modules/libpref/init/all.js
+++ b/modules/libpref/init/all.js
@@ -218,17 +218,21 @@ pref("dom.gamepad.haptic_feedback.enable
 // If this is true, TextEventDispatcher dispatches keydown and keyup events
 // even during composition (keypress events are never fired during composition
 // even if this is true).
 pref("dom.keyboardevent.dispatch_during_composition", false);
 
 // If this is true, TextEventDispatcher dispatches keypress event with setting
 // WidgetEvent::mFlags::mOnlySystemGroupDispatchInContent to true if it won't
 // cause inputting printable character.
+#ifdef EARLY_BETA_OR_EARLIER
+pref("dom.keyboardevent.keypress.dispatch_non_printable_keys_only_system_group_in_content", true);
+#else
 pref("dom.keyboardevent.keypress.dispatch_non_printable_keys_only_system_group_in_content", false);
+#endif
 
 // Whether the WebMIDI API is enabled
 pref("dom.webmidi.enabled", false);
 
 // Whether to run add-on code in different compartments from browser code. This
 // causes a separate compartment for each (addon, global) combination, which may
 // significantly increase the number of compartments in the system.
 pref("dom.compartment_per_addon", true);
--- a/widget/TextEventDispatcher.cpp
+++ b/widget/TextEventDispatcher.cpp
@@ -40,17 +40,17 @@ TextEventDispatcher::TextEventDispatcher
     Preferences::AddBoolVarCache(
       &sDispatchKeyEventsDuringComposition,
       "dom.keyboardevent.dispatch_during_composition",
       false);
     Preferences::AddBoolVarCache(
       &sDispatchKeyPressEventsOnlySystemGroupInContent,
       "dom.keyboardevent.keypress."
         "dispatch_non_printable_keys_only_system_group_in_content",
-      false);
+      true);
     sInitialized = true;
   }
 
   ClearNotificationRequests();
 }
 
 nsresult
 TextEventDispatcher::BeginInputTransaction(