Bug 1486297 - Add a pref for Pointer Lock API so that user can disable it. r=smaug!
authorXidorn Quan <me@upsuper.org>
Thu, 30 Aug 2018 22:55:31 +0000
changeset 434168 86ec37344b447f7feaea09ed2e2eb25146ddff7c
parent 434167 96b5a88ac0041a1bd382a731749e1fca9aa911ed
child 434169 ec1279ae74f332a9b7fa33cbb365a92c7d12b940
push id68576
push userxquan@mozilla.com
push dateThu, 30 Aug 2018 22:56:09 +0000
treeherderautoland@86ec37344b44 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1486297
milestone63.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 1486297 - Add a pref for Pointer Lock API so that user can disable it. r=smaug! Differential Revision: https://phabricator.services.mozilla.com/D4637
dom/webidl/Element.webidl
modules/libpref/init/all.js
--- a/dom/webidl/Element.webidl
+++ b/dom/webidl/Element.webidl
@@ -264,17 +264,17 @@ partial interface Element {
   [Throws, Func="nsDocument::IsUnprefixedFullscreenEnabled", NeedsCallerType]
   void requestFullscreen();
   [Throws, BinaryName="requestFullscreen", NeedsCallerType]
   void mozRequestFullScreen();
 };
 
 // https://w3c.github.io/pointerlock/#extensions-to-the-element-interface
 partial interface Element {
-  [NeedsCallerType]
+  [NeedsCallerType, Pref="dom.pointer-lock.enabled"]
   void requestPointerLock();
 };
 
 // Mozilla-specific additions to support devtools
 partial interface Element {
   // Support reporting of Flexbox properties
   /**
    * If this element has a display:flex or display:inline-flex style,
--- a/modules/libpref/init/all.js
+++ b/modules/libpref/init/all.js
@@ -190,16 +190,22 @@ pref("dom.performance.time_to_non_blank_
 pref("dom.performance.time_to_dom_content_flushed.enabled", false);
 
 // Enable Performance Observer API
 pref("dom.enable_performance_observer", true);
 
 // Enable requestIdleCallback API
 pref("dom.requestIdleCallback.enabled", true);
 
+// Enable Pointer Lock API
+// This is added for accessibility purpose. When user has no way to exit
+// pointer lock (e.g. no keyboard available), they can use this pref to
+// disable the Pointer Lock API altogether.
+pref("dom.pointer-lock.enabled", true);
+
 // Whether the Gamepad API is enabled
 pref("dom.gamepad.enabled", true);
 pref("dom.gamepad.test.enabled", false);
 #ifdef RELEASE_OR_BETA
 pref("dom.gamepad.non_standard_events.enabled", false);
 #else
 pref("dom.gamepad.non_standard_events.enabled", true);
 #endif