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
--- 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;
}