Bug 1446401 - Start to dispatch "keydown" event and "keyup" event even during in composition in Nightly and early Beta r=smaug
authorMasayuki Nakano <masayuki@d-toybox.com>
Wed, 28 Feb 2018 22:19:09 +0900
changeset 408771 a0de39bcd31848b43bba37cacaa55552decebd14
parent 408770 0cc692ebfaedfa662505143457825a47a79c3523
child 408790 968b633a0b542ff74ad90918daceaf909ec0b2a9
push id61319
push usermasayuki@d-toybox.com
push dateMon, 19 Mar 2018 10:01:42 +0000
treeherderautoland@a0de39bcd318 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1446401
milestone61.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 1446401 - Start to dispatch "keydown" event and "keyup" event even during in composition in Nightly and early Beta r=smaug For confirming to UI Events spec, we should dispatch "keydown" event and "keyup" event even during in composition. This patch makes only Nightly and early Beta start to dispatch those events during a composition. MozReview-Commit-ID: 8md7NtSdurJ
modules/libpref/init/all.js
widget/TextEventDispatcher.cpp
--- a/modules/libpref/init/all.js
+++ b/modules/libpref/init/all.js
@@ -220,17 +220,21 @@ pref("dom.gamepad.non_standard_events.en
 pref("dom.gamepad.non_standard_events.enabled", true);
 #endif
 pref("dom.gamepad.extensions.enabled", true);
 pref("dom.gamepad.haptic_feedback.enabled", true);
 
 // 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).
+#ifdef EARLY_BETA_OR_EARLIER
+pref("dom.keyboardevent.dispatch_during_composition", true);
+#else
 pref("dom.keyboardevent.dispatch_during_composition", false);
+#endif
 
 // If this is true, TextEventDispatcher dispatches keypress event with setting
 // WidgetEvent::mFlags::mOnlySystemGroupDispatchInContent to true if it won't
 // cause inputting printable character.
 pref("dom.keyboardevent.keypress.dispatch_non_printable_keys_only_system_group_in_content", false);
 
 // Whether the WebMIDI API is enabled
 pref("dom.webmidi.enabled", false);
--- a/widget/TextEventDispatcher.cpp
+++ b/widget/TextEventDispatcher.cpp
@@ -35,17 +35,17 @@ TextEventDispatcher::TextEventDispatcher
 {
   MOZ_RELEASE_ASSERT(mWidget, "aWidget must not be nullptr");
 
   static bool sInitialized = false;
   if (!sInitialized) {
     Preferences::AddBoolVarCache(
       &sDispatchKeyEventsDuringComposition,
       "dom.keyboardevent.dispatch_during_composition",
-      false);
+      true);
     Preferences::AddBoolVarCache(
       &sDispatchKeyPressEventsOnlySystemGroupInContent,
       "dom.keyboardevent.keypress."
         "dispatch_non_printable_keys_only_system_group_in_content",
       false);
     sInitialized = true;
   }