Bug 1446401 - Start to dispatch "keydown" event and "keyup" event even during in composition in Nightly and early Beta r?smaug draft
authorMasayuki Nakano <masayuki@d-toybox.com>
Wed, 28 Feb 2018 22:19:09 +0900
changeset 769241 674c2f57e8393e95ed34cd9d03dbcadf04ea2726
parent 769240 1f6cb84828925633d7879c952c55be3131ab6ab3
push id103083
push usermasayuki@d-toybox.com
push dateMon, 19 Mar 2018 08:32:41 +0000
reviewerssmaug
bugs1446401
milestone61.0a1
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;
   }