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: http://svn.webkit.org/repository/webkit/trunk@209364 268f45cc-cd09-0410-ab3c-d52691b4dbfc
27 files changed