Bug 1548587 - Add addl preferences for dom keyboard hacks. r=smaug
authorMichael Kaply <mozilla@kaply.com>
Fri, 03 May 2019 09:41:39 +0000
changeset 531301 b78f80a0ee086ce4e28035c2954b9219c21f63aa
parent 531300 871aff9c35e95c2d7754b8cef7c14a7155204f15
child 531302 f1bc4fcd152e66e858c3a1d0b0afd30a78e9474b
push id11265
push userffxbld-merge
push dateMon, 13 May 2019 10:53:39 +0000
treeherdermozilla-beta@77e0fe8dbdd3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1548587
milestone68.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 1548587 - Add addl preferences for dom keyboard hacks. r=smaug Differential Revision: https://phabricator.services.mozilla.com/D29696
layout/base/PresShell.cpp
modules/libpref/init/all.js
--- a/layout/base/PresShell.cpp
+++ b/layout/base/PresShell.cpp
@@ -8169,20 +8169,29 @@ nsresult PresShell::EventHandler::Dispat
       if (!mPresShell->mInitializedWithKeyPressEventDispatchingBlacklist) {
         mPresShell->mInitializedWithKeyPressEventDispatchingBlacklist = true;
         nsCOMPtr<nsIURI> uri =
             GetDocumentURIToCompareWithBlacklist(*mPresShell);
         mPresShell->mForceDispatchKeyPressEventsForNonPrintableKeys =
             nsContentUtils::IsURIInPrefList(
                 uri,
                 "dom.keyboardevent.keypress.hack.dispatch_non_printable_keys");
+        mPresShell->mForceDispatchKeyPressEventsForNonPrintableKeys |=
+            nsContentUtils::IsURIInPrefList(uri,
+                                            "dom.keyboardevent.keypress.hack."
+                                            "dispatch_non_printable_keys.addl");
         mPresShell->mForceUseLegacyKeyCodeAndCharCodeValues |=
             nsContentUtils::IsURIInPrefList(uri,
                                             "dom.keyboardevent.keypress.hack."
                                             "use_legacy_keycode_and_charcode");
+        mPresShell->mForceUseLegacyKeyCodeAndCharCodeValues |=
+            nsContentUtils::IsURIInPrefList(
+                uri,
+                "dom.keyboardevent.keypress.hack."
+                "use_legacy_keycode_and_charcode.addl");
       }
       if (mPresShell->mForceDispatchKeyPressEventsForNonPrintableKeys) {
         aEvent->mFlags.mOnlySystemGroupDispatchInContent = false;
       }
       if (mPresShell->mForceUseLegacyKeyCodeAndCharCodeValues) {
         aEvent->AsKeyboardEvent()->mUseLegacyKeyCodeAndCharCodeValues = true;
       }
     } else if (aEvent->mMessage == eMouseUp) {
--- a/modules/libpref/init/all.js
+++ b/modules/libpref/init/all.js
@@ -201,23 +201,27 @@ pref("dom.keyboardevent.keypress.dispatc
 
 // Blacklist of domains of web apps which are not aware of strict keypress
 // dispatching behavior.  This is comma separated list.  If you need to match
 // all sub-domains, you can specify it as "*.example.com".  Additionally, you
 // can limit the path.  E.g., "example.com/foo" means "example.com/foo*".  So,
 // if you need to limit under a directory, the path should end with "/" like
 // "example.com/foo/".  Note that this cannot limit port number for now.
 pref("dom.keyboardevent.keypress.hack.dispatch_non_printable_keys", "www.icloud.com");
+// Pref for end-users and policy to add additional values.
+pref("dom.keyboardevent.keypress.hack.dispatch_non_printable_keys.addl", "");
 
 // Blacklist of domains of web apps which handle keyCode and charCode of
 // keypress events with a path only for Firefox (i.e., broken if we set
 // non-zero keyCode or charCode value to the other).  The format is exactly
 // same as "dom.keyboardevent.keypress.hack.dispatch_non_printable_keys". So,
 // check its explanation for the detail.
 pref("dom.keyboardevent.keypress.hack.use_legacy_keycode_and_charcode", "*.collabserv.com,*.gov.online.office365.us,*.officeapps-df.live.com,*.officeapps.live.com,*.online.office.de,*.partner.officewebapps.cn,*.scniris.com");
+// Pref for end-users and policy to add additional values.
+pref("dom.keyboardevent.keypress.hack.use_legacy_keycode_and_charcode.addl", "");
 
 // Blacklist of domains of web apps which listen for non-primary click events
 // on window global or document. The format is exactly same as
 // "dom.keyboardevent.keypress.hack.dispatch_non_printable_keys". So, check its
 // explanation for the detail.
 pref("dom.mouseevent.click.hack.use_legacy_non-primary_dispatch", "");
 
 // Whether InputEvent.data is enabled.