pointer lock needs to be feature detectable
authordino@apple.com <dino@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 5 Dec 2016 23:48:15 +0000 (23:48 +0000)
committerdino@apple.com <dino@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 5 Dec 2016 23:48:15 +0000 (23:48 +0000)
commit88a7fd6a58eb2780c89864f158f3b0ba5f431fb4
treec378c54140159260e067d02b2aceeac805b5b2c1
parent78644802b7d6a5c9c5890079a7b791dc0162d17e
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.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209364 268f45cc-cd09-0410-ab3c-d52691b4dbfc
27 files changed:
LayoutTests/ChangeLog
LayoutTests/pointer-lock/pointerlock-interface-disabled-expected.txt [new file with mode: 0644]
LayoutTests/pointer-lock/pointerlock-interface-disabled.html [new file with mode: 0644]
LayoutTests/pointer-lock/pointerlock-interface-expected.txt [new file with mode: 0644]
LayoutTests/pointer-lock/pointerlock-interface.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/bindings/generic/RuntimeEnabledFeatures.h
Source/WebCore/dom/Document.idl
Source/WebCore/dom/Element.idl
Source/WebCore/page/PointerLockController.cpp
Source/WebCore/page/Settings.in
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebView/WebView.mm
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/C/WKPreferences.cpp
Source/WebKit2/UIProcess/API/C/WKPreferencesRefPrivate.h
Source/WebKit2/WebProcess/WebPage/WebPage.cpp
Tools/ChangeLog
Tools/DumpRenderTree/TestOptions.h
Tools/DumpRenderTree/TestOptions.mm
Tools/DumpRenderTree/mac/DumpRenderTree.mm
Tools/WebKitTestRunner/TestController.cpp
Tools/WebKitTestRunner/TestOptions.h
Tools/WebKitTestRunner/ios/PlatformWebViewIOS.mm
Tools/WebKitTestRunner/mac/PlatformWebViewMac.mm
Websites/webkit.org/ChangeLog
Websites/webkit.org/experimental-features.html