Title: [209364] trunk
Revision
209364
Author
[email protected]
Date
2016-12-05 15:48:15 -0800 (Mon, 05 Dec 2016)

Log Message

pointer lock needs to be feature detectable
https://bugs.webkit.org/show_bug.cgi?id=165426
<rdar://problem/29486715>

Reviewed by Antoine Quint.

Source/WebCore:

Annotate the public-facing API for pointer-lock, so
that it is hidden when not available.

Also move the Setting to a RuntimeEnabledFeature, since
pointer-lock is exposed from WebKit as a feature.

Tests: pointer-lock/pointerlock-interface-disabled.html
       pointer-lock/pointerlock-interface.html

* bindings/generic/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setPointerLockEnabled):
(WebCore::RuntimeEnabledFeatures::pointerLockEnabled):
* dom/Document.idl:
* dom/Element.idl:
* page/PointerLockController.cpp:
(WebCore::PointerLockController::requestPointerLock):
(WebCore::PointerLockController::requestPointerUnlock):
* page/Settings.in:

Source/WebKit/mac:

Set the RuntimeEnabledFeature as preferences
change.

* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):

Source/WebKit2:

Set the RuntimeEnabledFeature as preferences
change.

* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetPointerLockEnabled):
(WKPreferencesGetPointerLockEnabled):
* UIProcess/API/C/WKPreferencesRefPrivate.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):

Tools:

Expose the comment line to turn on/off pointer lock.

* DumpRenderTree/TestOptions.h:
* DumpRenderTree/TestOptions.mm:
(TestOptions::TestOptions):
* DumpRenderTree/mac/DumpRenderTree.mm:
(resetWebPreferencesToConsistentValues):
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::resetPreferencesToConsistentValues):
(WTR::updateTestOptionsFromTestHeader):
* WebKitTestRunner/TestOptions.h:
* WebKitTestRunner/ios/PlatformWebViewIOS.mm:
(WTR::PlatformWebView::viewSupportsOptions):
* WebKitTestRunner/mac/PlatformWebViewMac.mm:
(WTR::PlatformWebView::viewSupportsOptions):

Websites/webkit.org:

We can now accurately detect pointer-lock.

* experimental-features.html:

LayoutTests:

Checks that the API is hidden when the feature is turned off.

* pointer-lock/pointerlock-interface-disabled-expected.txt: Added.
* pointer-lock/pointerlock-interface-disabled.html: Added.
* pointer-lock/pointerlock-interface-expected.txt: Added.
* pointer-lock/pointerlock-interface.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (209363 => 209364)


--- trunk/LayoutTests/ChangeLog	2016-12-05 23:39:59 UTC (rev 209363)
+++ trunk/LayoutTests/ChangeLog	2016-12-05 23:48:15 UTC (rev 209364)
@@ -1,3 +1,18 @@
+2016-12-05  Dean Jackson  <[email protected]>
+
+        pointer lock needs to be feature detectable
+        https://bugs.webkit.org/show_bug.cgi?id=165426
+        <rdar://problem/29486715>
+
+        Reviewed by Antoine Quint.
+
+        Checks that the API is hidden when the feature is turned off.
+
+        * pointer-lock/pointerlock-interface-disabled-expected.txt: Added.
+        * pointer-lock/pointerlock-interface-disabled.html: Added.
+        * pointer-lock/pointerlock-interface-expected.txt: Added.
+        * pointer-lock/pointerlock-interface.html: Added.
+
 2016-12-05  Dave Hyatt  <[email protected]>
 
         [CSS Parser] Skip a grid test

Added: trunk/LayoutTests/pointer-lock/pointerlock-interface-disabled-expected.txt (0 => 209364)


--- trunk/LayoutTests/pointer-lock/pointerlock-interface-disabled-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/pointer-lock/pointerlock-interface-disabled-expected.txt	2016-12-05 23:48:15 UTC (rev 209364)
@@ -0,0 +1,7 @@
+
+PASS Document.prototype.exitPointerLock does not exist 
+PASS Document.prototype.pointerLockElement does not exist 
+PASS Document.prototype.onpointerlockchange does not exist 
+PASS Document.prototype.onpointerlockerror does not exist 
+PASS Element.prototype.requestPointerLock does not exist 
+
Property changes on: trunk/LayoutTests/pointer-lock/pointerlock-interface-disabled-expected.txt
___________________________________________________________________

Added: svn:eol-style

+native \ No newline at end of property

Added: svn:keywords

+Date Revision \ No newline at end of property

Added: svn:mime-type

+text/plain \ No newline at end of property

Added: trunk/LayoutTests/pointer-lock/pointerlock-interface-disabled.html (0 => 209364)


--- trunk/LayoutTests/pointer-lock/pointerlock-interface-disabled.html	                        (rev 0)
+++ trunk/LayoutTests/pointer-lock/pointerlock-interface-disabled.html	2016-12-05 23:48:15 UTC (rev 209364)
@@ -0,0 +1,32 @@
+<!DOCTYPE html><!-- webkit-test-runner [ enablePointerLock=false ] -->
+<head>
+    <title>PointerLock interface tests.</title>
+    <link rel="help" href=""
+    <script src=""
+    <script src=""
+</head>
+<body>
+<div id="log"></div>
+<script>
+test(function() {
+    assert_false('exitPointerLock' in Document.prototype);
+},'Document.prototype.exitPointerLock does not exist');
+
+test(function() {
+    assert_false('pointerLockElement' in Document.prototype);
+},'Document.prototype.pointerLockElement does not exist');
+
+test(function() {
+    assert_false('onpointerlockchange' in Document.prototype);
+},'Document.prototype.onpointerlockchange does not exist');
+
+test(function() {
+    assert_false('onpointerlockerror' in Document.prototype);
+},'Document.prototype.onpointerlockerror does not exist');
+
+test(function() {
+    assert_false('requestPointerLock' in Element.prototype);
+},'Element.prototype.requestPointerLock does not exist');
+</script>
+</body>
+</html>
Property changes on: trunk/LayoutTests/pointer-lock/pointerlock-interface-disabled.html
___________________________________________________________________

Added: svn:eol-style

+native \ No newline at end of property

Added: svn:keywords

+Date Revision \ No newline at end of property

Added: svn:mime-type

+text/html \ No newline at end of property

Added: trunk/LayoutTests/pointer-lock/pointerlock-interface-expected.txt (0 => 209364)


--- trunk/LayoutTests/pointer-lock/pointerlock-interface-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/pointer-lock/pointerlock-interface-expected.txt	2016-12-05 23:48:15 UTC (rev 209364)
@@ -0,0 +1,7 @@
+
+PASS Document.prototype.exitPointerLock exists 
+PASS Document.prototype.pointerLockElement exists 
+PASS Document.prototype.onpointerlockchange exists 
+PASS Document.prototype.onpointerlockerror exists 
+PASS Element.prototype.requestPointerLock exists 
+
Property changes on: trunk/LayoutTests/pointer-lock/pointerlock-interface-expected.txt
___________________________________________________________________

Added: svn:eol-style

+native \ No newline at end of property

Added: svn:keywords

+Date Revision \ No newline at end of property

Added: svn:mime-type

+text/plain \ No newline at end of property

Added: trunk/LayoutTests/pointer-lock/pointerlock-interface.html (0 => 209364)


--- trunk/LayoutTests/pointer-lock/pointerlock-interface.html	                        (rev 0)
+++ trunk/LayoutTests/pointer-lock/pointerlock-interface.html	2016-12-05 23:48:15 UTC (rev 209364)
@@ -0,0 +1,32 @@
+<!DOCTYPE html><!-- webkit-test-runner [ enablePointerLock=true ] -->
+<head>
+    <title>PointerLock interface tests.</title>
+    <link rel="help" href=""
+    <script src=""
+    <script src=""
+</head>
+<body>
+<div id="log"></div>
+<script>
+test(function() {
+    assert_true('exitPointerLock' in Document.prototype);
+},'Document.prototype.exitPointerLock exists');
+
+test(function() {
+    assert_true('pointerLockElement' in Document.prototype);
+},'Document.prototype.pointerLockElement exists');
+
+test(function() {
+    assert_true('onpointerlockchange' in Document.prototype);
+},'Document.prototype.onpointerlockchange exists');
+
+test(function() {
+    assert_true('onpointerlockerror' in Document.prototype);
+},'Document.prototype.onpointerlockerror exists');
+
+test(function() {
+    assert_true('requestPointerLock' in Element.prototype);
+},'Element.prototype.requestPointerLock exists');
+</script>
+</body>
+</html>
Property changes on: trunk/LayoutTests/pointer-lock/pointerlock-interface.html
___________________________________________________________________

Added: svn:eol-style

+native \ No newline at end of property

Added: svn:keywords

+Date Revision \ No newline at end of property

Added: svn:mime-type

+text/html \ No newline at end of property

Modified: trunk/Source/WebCore/ChangeLog (209363 => 209364)


--- trunk/Source/WebCore/ChangeLog	2016-12-05 23:39:59 UTC (rev 209363)
+++ trunk/Source/WebCore/ChangeLog	2016-12-05 23:48:15 UTC (rev 209364)
@@ -1,3 +1,30 @@
+2016-12-05  Dean Jackson  <[email protected]>
+
+        pointer lock needs to be feature detectable
+        https://bugs.webkit.org/show_bug.cgi?id=165426
+        <rdar://problem/29486715>
+
+        Reviewed by Antoine Quint.
+
+        Annotate the public-facing API for pointer-lock, so
+        that it is hidden when not available.
+
+        Also move the Setting to a RuntimeEnabledFeature, since
+        pointer-lock is exposed from WebKit as a feature.
+
+        Tests: pointer-lock/pointerlock-interface-disabled.html
+               pointer-lock/pointerlock-interface.html
+
+        * bindings/generic/RuntimeEnabledFeatures.h:
+        (WebCore::RuntimeEnabledFeatures::setPointerLockEnabled):
+        (WebCore::RuntimeEnabledFeatures::pointerLockEnabled):
+        * dom/Document.idl:
+        * dom/Element.idl:
+        * page/PointerLockController.cpp:
+        (WebCore::PointerLockController::requestPointerLock):
+        (WebCore::PointerLockController::requestPointerUnlock):
+        * page/Settings.in:
+
 2016-12-05  Keith Rollin  <[email protected]>
 
         Reduce number of platformMemoryUsage calls

Modified: trunk/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.h (209363 => 209364)


--- trunk/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.h	2016-12-05 23:39:59 UTC (rev 209363)
+++ trunk/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.h	2016-12-05 23:48:15 UTC (rev 209364)
@@ -212,6 +212,11 @@
     bool webGL2Enabled() const { return m_isWebGL2Enabled; }
 #endif
 
+#if ENABLE(POINTER_LOCK)
+    void setPointerLockEnabled(bool isEnabled) { m_isPointerLockEnabled = isEnabled; }
+    bool pointerLockEnabled() const { return m_isPointerLockEnabled; }
+#endif
+
 #if ENABLE(FETCH_API)
     void setFetchAPIEnabled(bool isEnabled) { m_isFetchAPIEnabled = isEnabled; }
     bool fetchAPIEnabled() const { return m_isFetchAPIEnabled; }
@@ -347,6 +352,10 @@
     bool m_isWebGL2Enabled;
 #endif
 
+#if ENABLE(POINTER_LOCK)
+    bool m_isPointerLockEnabled;
+#endif
+
 #if ENABLE(FETCH_API)
     bool m_isFetchAPIEnabled { false };
 #endif

Modified: trunk/Source/WebCore/dom/Document.idl (209363 => 209364)


--- trunk/Source/WebCore/dom/Document.idl	2016-12-05 23:39:59 UTC (rev 209363)
+++ trunk/Source/WebCore/dom/Document.idl	2016-12-05 23:48:15 UTC (rev 209364)
@@ -152,8 +152,8 @@
     void webkitExitFullscreen();
 #endif
 
-    [Conditional=POINTER_LOCK] void exitPointerLock();
-    [Conditional=POINTER_LOCK] readonly attribute Element? pointerLockElement;
+    [Conditional=POINTER_LOCK, EnabledAtRuntime=PointerLock] void exitPointerLock();
+    [Conditional=POINTER_LOCK, EnabledAtRuntime=PointerLock] readonly attribute Element? pointerLockElement;
 
     [Conditional=CSS_REGIONS] DOMNamedFlowCollection webkitGetNamedFlows();
 
@@ -202,8 +202,8 @@
     // Unique to Document
     [LenientThis] attribute EventHandler onreadystatechange;
     [NotEnumerable, Conditional=CSP_NEXT] attribute EventHandler onsecuritypolicyviolation;
-    [NotEnumerable, Conditional=POINTER_LOCK] attribute EventHandler onpointerlockchange;
-    [NotEnumerable, Conditional=POINTER_LOCK] attribute EventHandler onpointerlockerror;
+    [NotEnumerable, Conditional=POINTER_LOCK, EnabledAtRuntime=PointerLock] attribute EventHandler onpointerlockchange;
+    [NotEnumerable, Conditional=POINTER_LOCK, EnabledAtRuntime=PointerLock] attribute EventHandler onpointerlockerror;
 };
 
 Document implements ParentNode;

Modified: trunk/Source/WebCore/dom/Element.idl (209363 => 209364)


--- trunk/Source/WebCore/dom/Element.idl	2016-12-05 23:39:59 UTC (rev 209363)
+++ trunk/Source/WebCore/dom/Element.idl	2016-12-05 23:48:15 UTC (rev 209364)
@@ -128,7 +128,7 @@
     [CEReactions, MayThrowException] void insertAdjacentHTML(DOMString where, DOMString html);
     [MayThrowException] void insertAdjacentText(DOMString where, DOMString text);
 
-    [Conditional=POINTER_LOCK] void requestPointerLock();
+    [Conditional=POINTER_LOCK, EnabledAtRuntime=PointerLock] void requestPointerLock();
 
     // CSS Regions API
     [Conditional=CSS_REGIONS] readonly attribute DOMString webkitRegionOverset;

Modified: trunk/Source/WebCore/page/PointerLockController.cpp (209363 => 209364)


--- trunk/Source/WebCore/page/PointerLockController.cpp	2016-12-05 23:39:59 UTC (rev 209363)
+++ trunk/Source/WebCore/page/PointerLockController.cpp	2016-12-05 23:48:15 UTC (rev 209364)
@@ -34,6 +34,7 @@
 #include "EventNames.h"
 #include "Page.h"
 #include "PlatformMouseEvent.h"
+#include "RuntimeEnabledFeatures.h"
 #include "ScriptController.h"
 #include "Settings.h"
 #include "VoidCallback.h"
@@ -49,7 +50,7 @@
 
 void PointerLockController::requestPointerLock(Element* target)
 {
-    if (!m_page.settings().pointerLockEnabled())
+    if (!RuntimeEnabledFeatures::sharedFeatures().pointerLockEnabled())
         return;
 
     if (!target || !target->inDocument() || m_documentOfRemovedElementWhileWaitingForUnlock) {
@@ -92,7 +93,7 @@
     if (!m_element)
         return;
 
-    if (!m_page.settings().pointerLockEnabled())
+    if (!RuntimeEnabledFeatures::sharedFeatures().pointerLockEnabled())
         return;
 
     m_page.chrome().client().requestPointerUnlock();

Modified: trunk/Source/WebCore/page/Settings.in (209363 => 209364)


--- trunk/Source/WebCore/page/Settings.in	2016-12-05 23:39:59 UTC (rev 209363)
+++ trunk/Source/WebCore/page/Settings.in	2016-12-05 23:48:15 UTC (rev 209364)
@@ -293,4 +293,3 @@
 animatedImageAsyncDecodingEnabled initial=true
 
 es6ModulesEnabled initial=false
-pointerLockEnabled initial=false

Modified: trunk/Source/WebKit/mac/ChangeLog (209363 => 209364)


--- trunk/Source/WebKit/mac/ChangeLog	2016-12-05 23:39:59 UTC (rev 209363)
+++ trunk/Source/WebKit/mac/ChangeLog	2016-12-05 23:48:15 UTC (rev 209364)
@@ -1,3 +1,17 @@
+2016-12-05  Dean Jackson  <[email protected]>
+
+        pointer lock needs to be feature detectable
+        https://bugs.webkit.org/show_bug.cgi?id=165426
+        <rdar://problem/29486715>
+
+        Reviewed by Antoine Quint.
+
+        Set the RuntimeEnabledFeature as preferences
+        change.
+
+        * WebView/WebView.mm:
+        (-[WebView _preferencesChanged:]):
+
 2016-12-05  Ryan Haddad  <[email protected]>
 
         Unreviewed, rolling out r209299.

Modified: trunk/Source/WebKit/mac/WebView/WebView.mm (209363 => 209364)


--- trunk/Source/WebKit/mac/WebView/WebView.mm	2016-12-05 23:39:59 UTC (rev 209363)
+++ trunk/Source/WebKit/mac/WebView/WebView.mm	2016-12-05 23:48:15 UTC (rev 209364)
@@ -2650,10 +2650,6 @@
     settings.setXSSAuditorEnabled([preferences isXSSAuditorEnabled]);
     settings.setDNSPrefetchingEnabled([preferences isDNSPrefetchingEnabled]);
 
-#if ENABLE(POINTER_LOCK)
-    settings.setPointerLockEnabled([preferences pointerLockEnabled]);
-#endif
-
     settings.setAcceleratedCompositingEnabled([preferences acceleratedCompositingEnabled]);
     settings.setAcceleratedDrawingEnabled([preferences acceleratedDrawingEnabled]);
     settings.setDisplayListDrawingEnabled([preferences displayListDrawingEnabled]);
@@ -2846,6 +2842,10 @@
 
     RuntimeEnabledFeatures::sharedFeatures().setCustomElementsEnabled([preferences customElementsEnabled]);
 
+#if ENABLE(POINTER_LOCK)
+    RuntimeEnabledFeatures::sharedFeatures().setPointerLockEnabled([preferences pointerLockEnabled]);
+#endif
+
 #if ENABLE(FETCH_API)
     RuntimeEnabledFeatures::sharedFeatures().setFetchAPIEnabled([preferences fetchAPIEnabled]);
 #endif

Modified: trunk/Source/WebKit2/ChangeLog (209363 => 209364)


--- trunk/Source/WebKit2/ChangeLog	2016-12-05 23:39:59 UTC (rev 209363)
+++ trunk/Source/WebKit2/ChangeLog	2016-12-05 23:48:15 UTC (rev 209364)
@@ -1,3 +1,21 @@
+2016-12-05  Dean Jackson  <[email protected]>
+
+        pointer lock needs to be feature detectable
+        https://bugs.webkit.org/show_bug.cgi?id=165426
+        <rdar://problem/29486715>
+
+        Reviewed by Antoine Quint.
+
+        Set the RuntimeEnabledFeature as preferences
+        change.
+
+        * UIProcess/API/C/WKPreferences.cpp:
+        (WKPreferencesSetPointerLockEnabled):
+        (WKPreferencesGetPointerLockEnabled):
+        * UIProcess/API/C/WKPreferencesRefPrivate.h:
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::updatePreferences):
+
 2016-12-05  Andreas Kling  <[email protected]>
 
         [Cocoa] Add some memory usage related information to sysdiagnose state dumps

Modified: trunk/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp (209363 => 209364)


--- trunk/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp	2016-12-05 23:39:59 UTC (rev 209363)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp	2016-12-05 23:48:15 UTC (rev 209364)
@@ -832,6 +832,16 @@
     return toImpl(preferencesRef)->modernMediaControlsEnabled();
 }
 
+void WKPreferencesSetPointerLockEnabled(WKPreferencesRef preferencesRef, bool flag)
+{
+    toImpl(preferencesRef)->setPointerLockEnabled(flag);
+}
+
+bool WKPreferencesGetPointerLockEnabled(WKPreferencesRef preferencesRef)
+{
+    return toImpl(preferencesRef)->pointerLockEnabled();
+}
+
 void WKPreferencesSetShowsToolTipOverTruncatedText(WKPreferencesRef preferencesRef, bool flag)
 {
     toImpl(preferencesRef)->setShowsToolTipOverTruncatedText(flag);

Modified: trunk/Source/WebKit2/UIProcess/API/C/WKPreferencesRefPrivate.h (209363 => 209364)


--- trunk/Source/WebKit2/UIProcess/API/C/WKPreferencesRefPrivate.h	2016-12-05 23:39:59 UTC (rev 209363)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKPreferencesRefPrivate.h	2016-12-05 23:48:15 UTC (rev 209364)
@@ -209,6 +209,10 @@
 WK_EXPORT bool WKPreferencesGetModernMediaControlsEnabled(WKPreferencesRef preferencesRef);
 
 // Defaults to false.
+WK_EXPORT void WKPreferencesSetPointerLockEnabled(WKPreferencesRef preferencesRef, bool flag);
+WK_EXPORT bool WKPreferencesGetPointerLockEnabled(WKPreferencesRef preferencesRef);
+
+// Defaults to false.
 WK_EXPORT void WKPreferencesSetShowsToolTipOverTruncatedText(WKPreferencesRef preferencesRef, bool flag);
 WK_EXPORT bool WKPreferencesGetShowsToolTipOverTruncatedText(WKPreferencesRef preferencesRef);
 

Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (209363 => 209364)


--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2016-12-05 23:39:59 UTC (rev 209363)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2016-12-05 23:48:15 UTC (rev 209364)
@@ -2992,9 +2992,6 @@
 #if ENABLE(ATTACHMENT_ELEMENT)
     settings.setAttachmentElementEnabled(store.getBoolValueForKey(WebPreferencesKey::attachmentElementEnabledKey()));
 #endif
-#if ENABLE(POINTER_LOCK)
-    settings.setPointerLockEnabled(store.getBoolValueForKey(WebPreferencesKey::pointerLockEnabledKey()));
-#endif
     settings.setAllowsPictureInPictureMediaPlayback(store.getBoolValueForKey(WebPreferencesKey::allowsPictureInPictureMediaPlaybackKey()));
     settings.setMediaControlsScaleWithPageZoom(store.getBoolValueForKey(WebPreferencesKey::mediaControlsScaleWithPageZoomKey()));
     settings.setMockScrollbarsEnabled(store.getBoolValueForKey(WebPreferencesKey::mockScrollbarsEnabledKey()));
@@ -3188,6 +3185,10 @@
     RuntimeEnabledFeatures::sharedFeatures().setWebGL2Enabled(store.getBoolValueForKey(WebPreferencesKey::webGL2EnabledKey()));
 #endif
 
+#if ENABLE(POINTER_LOCK)
+    RuntimeEnabledFeatures::sharedFeatures().setPointerLockEnabled(store.getBoolValueForKey(WebPreferencesKey::pointerLockEnabledKey()));
+#endif
+
     settings.setSpringTimingFunctionEnabled(store.getBoolValueForKey(WebPreferencesKey::springTimingFunctionEnabledKey()));
 
     settings.setVisualViewportEnabled(store.getBoolValueForKey(WebPreferencesKey::visualViewportEnabledKey()));

Modified: trunk/Tools/ChangeLog (209363 => 209364)


--- trunk/Tools/ChangeLog	2016-12-05 23:39:59 UTC (rev 209363)
+++ trunk/Tools/ChangeLog	2016-12-05 23:48:15 UTC (rev 209364)
@@ -1,3 +1,27 @@
+2016-12-05  Dean Jackson  <[email protected]>
+
+        pointer lock needs to be feature detectable
+        https://bugs.webkit.org/show_bug.cgi?id=165426
+        <rdar://problem/29486715>
+
+        Reviewed by Antoine Quint.
+
+        Expose the comment line to turn on/off pointer lock.
+
+        * DumpRenderTree/TestOptions.h:
+        * DumpRenderTree/TestOptions.mm:
+        (TestOptions::TestOptions):
+        * DumpRenderTree/mac/DumpRenderTree.mm:
+        (resetWebPreferencesToConsistentValues):
+        * WebKitTestRunner/TestController.cpp:
+        (WTR::TestController::resetPreferencesToConsistentValues):
+        (WTR::updateTestOptionsFromTestHeader):
+        * WebKitTestRunner/TestOptions.h:
+        * WebKitTestRunner/ios/PlatformWebViewIOS.mm:
+        (WTR::PlatformWebView::viewSupportsOptions):
+        * WebKitTestRunner/mac/PlatformWebViewMac.mm:
+        (WTR::PlatformWebView::viewSupportsOptions):
+
 2016-12-05  Jonathan Bedard  <[email protected]>
 
         Make it possible to use an existing simulator instance for one-off testing

Modified: trunk/Tools/DumpRenderTree/TestOptions.h (209363 => 209364)


--- trunk/Tools/DumpRenderTree/TestOptions.h	2016-12-05 23:39:59 UTC (rev 209363)
+++ trunk/Tools/DumpRenderTree/TestOptions.h	2016-12-05 23:48:15 UTC (rev 209364)
@@ -30,6 +30,7 @@
 struct TestOptions {
     bool enableIntersectionObserver { false };
     bool enableModernMediaControls { false };
+    bool enablePointerLock { false };
 
     TestOptions(NSURL *testURL);
 };

Modified: trunk/Tools/DumpRenderTree/TestOptions.mm (209363 => 209364)


--- trunk/Tools/DumpRenderTree/TestOptions.mm	2016-12-05 23:39:59 UTC (rev 209363)
+++ trunk/Tools/DumpRenderTree/TestOptions.mm	2016-12-05 23:48:15 UTC (rev 209364)
@@ -80,6 +80,8 @@
             this->enableIntersectionObserver = parseBooleanTestHeaderValue(value);
         else if (key == "enableModernMediaControls")
             this->enableModernMediaControls = parseBooleanTestHeaderValue(value);
+        else if (key == "enablePointerLock")
+            this->enablePointerLock = parseBooleanTestHeaderValue(value);
         pairStart = pairEnd + 1;
     }
 }

Modified: trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm (209363 => 209364)


--- trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm	2016-12-05 23:39:59 UTC (rev 209363)
+++ trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm	2016-12-05 23:48:15 UTC (rev 209364)
@@ -1000,6 +1000,7 @@
 
     preferences.intersectionObserverEnabled = options.enableIntersectionObserver;
     preferences.modernMediaControlsEnabled = options.enableModernMediaControls;
+    preferences.pointerLockEnabled = options.enablePointerLock;
 
     [preferences setSubtleCryptoEnabled:YES];
 

Modified: trunk/Tools/WebKitTestRunner/TestController.cpp (209363 => 209364)


--- trunk/Tools/WebKitTestRunner/TestController.cpp	2016-12-05 23:39:59 UTC (rev 209363)
+++ trunk/Tools/WebKitTestRunner/TestController.cpp	2016-12-05 23:48:15 UTC (rev 209364)
@@ -652,6 +652,7 @@
     WKPreferencesSetNeedsSiteSpecificQuirks(preferences, options.needsSiteSpecificQuirks);
     WKPreferencesSetIntersectionObserverEnabled(preferences, options.enableIntersectionObserver);
     WKPreferencesSetModernMediaControlsEnabled(preferences, options.enableModernMediaControls);
+    WKPreferencesSetPointerLockEnabled(preferences, options.enablePointerLock);
 
     static WKStringRef defaultTextEncoding = WKStringCreateWithUTF8CString("ISO-8859-1");
     WKPreferencesSetDefaultTextEncodingName(preferences, defaultTextEncoding);
@@ -963,6 +964,8 @@
             testOptions.enableIntersectionObserver = parseBooleanTestHeaderValue(value);
         if (key == "enableModernMediaControls")
             testOptions.enableModernMediaControls = parseBooleanTestHeaderValue(value);
+        if (key == "enablePointerLock")
+            testOptions.enablePointerLock = parseBooleanTestHeaderValue(value);
         pairStart = pairEnd + 1;
     }
 }

Modified: trunk/Tools/WebKitTestRunner/TestOptions.h (209363 => 209364)


--- trunk/Tools/WebKitTestRunner/TestOptions.h	2016-12-05 23:39:59 UTC (rev 209363)
+++ trunk/Tools/WebKitTestRunner/TestOptions.h	2016-12-05 23:48:15 UTC (rev 209364)
@@ -45,6 +45,7 @@
     bool useCharacterSelectionGranularity { false };
     bool enableIntersectionObserver { false };
     bool enableModernMediaControls { false };
+    bool enablePointerLock { false };
 
     float deviceScaleFactor { 1 };
     Vector<String> overrideLanguages;

Modified: trunk/Tools/WebKitTestRunner/ios/PlatformWebViewIOS.mm (209363 => 209364)


--- trunk/Tools/WebKitTestRunner/ios/PlatformWebViewIOS.mm	2016-12-05 23:39:59 UTC (rev 209363)
+++ trunk/Tools/WebKitTestRunner/ios/PlatformWebViewIOS.mm	2016-12-05 23:48:15 UTC (rev 209364)
@@ -282,7 +282,8 @@
         || m_options.needsSiteSpecificQuirks != options.needsSiteSpecificQuirks
         || m_options.useCharacterSelectionGranularity != options.useCharacterSelectionGranularity
         || m_options.enableIntersectionObserver != options.enableIntersectionObserver
-        || m_options.enableModernMediaControls != options.enableModernMediaControls)
+        || m_options.enableModernMediaControls != options.enableModernMediaControls
+        || m_options.enablePointerLock != options.enablePointerLock)
         return false;
 
     return true;

Modified: trunk/Tools/WebKitTestRunner/mac/PlatformWebViewMac.mm (209363 => 209364)


--- trunk/Tools/WebKitTestRunner/mac/PlatformWebViewMac.mm	2016-12-05 23:39:59 UTC (rev 209363)
+++ trunk/Tools/WebKitTestRunner/mac/PlatformWebViewMac.mm	2016-12-05 23:48:15 UTC (rev 209364)
@@ -278,7 +278,8 @@
         || m_options.useMockScrollbars != options.useMockScrollbars
         || m_options.needsSiteSpecificQuirks != options.needsSiteSpecificQuirks
         || m_options.enableIntersectionObserver != options.enableIntersectionObserver
-        || m_options.enableModernMediaControls != options.enableModernMediaControls)
+        || m_options.enableModernMediaControls != options.enableModernMediaControls
+        || m_options.enablePointerLock != options.enablePointerLock)
         return false;
 
     return true;

Modified: trunk/Websites/webkit.org/ChangeLog (209363 => 209364)


--- trunk/Websites/webkit.org/ChangeLog	2016-12-05 23:39:59 UTC (rev 209363)
+++ trunk/Websites/webkit.org/ChangeLog	2016-12-05 23:48:15 UTC (rev 209364)
@@ -1,3 +1,15 @@
+2016-12-05  Dean Jackson  <[email protected]>
+
+        pointer lock needs to be feature detectable
+        https://bugs.webkit.org/show_bug.cgi?id=165426
+        <rdar://problem/29486715>
+
+        Reviewed by Antoine Quint.
+
+        We can now accurately detect pointer-lock.
+
+        * experimental-features.html:
+
 2016-12-02  Dean Jackson  <[email protected]>
 
         Make a public facing page to check for WebKit features

Modified: trunk/Websites/webkit.org/experimental-features.html (209363 => 209364)


--- trunk/Websites/webkit.org/experimental-features.html	2016-12-05 23:39:59 UTC (rev 209363)
+++ trunk/Websites/webkit.org/experimental-features.html	2016-12-05 23:48:15 UTC (rev 209364)
@@ -126,8 +126,7 @@
         <div class="test" id="CSSGrid"><p>CSS Grid</p></div>
         <div class="test" id="Gamepad"><p>Gamepad API</p></div>
         <div class="test" id="VariationFonts"><p>Variation Fonts</p></div>
-        <!-- Remove "-unknown" when WebKit can do live feature detection for pointer lock -->
-        <div class="test" id="PointerLock-unknown"><p>Mouse Pointer Lock</p></div>
+        <div class="test" id="PointerLock"><p>Mouse Pointer Lock</p></div>
         <div class="test" id="WebGL2"><p>WebGL 2.0</p></div>
         <div class="test" id="FormValidation"><p>HTML Form Validation</p></div>
         <div class="test" id="InputEvents"><p>HTML Input Events</p></div>
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to