Disable AR support in WKWebView clients
authordino@apple.com <dino@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 13 Jun 2018 23:20:49 +0000 (23:20 +0000)
committerdino@apple.com <dino@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 13 Jun 2018 23:20:49 +0000 (23:20 +0000)
commit4e067285a7a15629771a374c63f4bead66fb9a10
treea5a455a14c33d521ba9e7b3e9c1ee75f0ff809cc
parentb616c56b5e61fc7f0c1cc77ee32aef6b98bd4075
Disable AR support in WKWebView clients
https://bugs.webkit.org/show_bug.cgi?id=186611
<rdar://problem/39544684>

Reviewed by Jon Lee.

Since it hasn't been adequately tested, System Preview (AR) should
be disabled by default for WKWebViews.

Source/WebCore:

Add a new RuntimeEnabledFeature to control this, and guard for
this case everywhere we use system previews.

* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::isSystemPreviewLink const):
(WebCore::HTMLAnchorElement::handleClick):
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::isSystemPreviewImage const):
* html/HTMLPictureElement.cpp:
(WebCore::HTMLPictureElement::isSystemPreviewImage const):
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setSystemPreviewEnabled):
(WebCore::RuntimeEnabledFeatures::systemPreviewEnabled const):
* rendering/RenderImage.cpp:
(WebCore::RenderImage::paintIntoRect):

Source/WebKit:

Add a new WebPreference, and SPI into WKWebViewConfiguration. Also
don't register the WebViewContentProvider if the feature is
disabled.

* Shared/WebPreferences.yaml:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]):
* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
(-[WKWebViewConfiguration init]):
(-[WKWebViewConfiguration encodeWithCoder:]):
(-[WKWebViewConfiguration initWithCoder:]):
(-[WKWebViewConfiguration copyWithZone:]):
(-[WKWebViewConfiguration _contentProviderRegistry]):
(-[WKWebViewConfiguration _systemPreviewEnabled]):
(-[WKWebViewConfiguration _setSystemPreviewEnabled:]):
* UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
* UIProcess/Cocoa/WKWebViewContentProviderRegistry.h:
* UIProcess/Cocoa/WKWebViewContentProviderRegistry.mm:
(-[WKWebViewContentProviderRegistry initWithConfiguration:]):
(-[WKWebViewContentProviderRegistry init]): Deleted.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@232817 268f45cc-cd09-0410-ab3c-d52691b4dbfc
14 files changed:
Source/WebCore/ChangeLog
Source/WebCore/html/HTMLAnchorElement.cpp
Source/WebCore/html/HTMLImageElement.cpp
Source/WebCore/html/HTMLPictureElement.cpp
Source/WebCore/page/RuntimeEnabledFeatures.h
Source/WebCore/rendering/RenderImage.cpp
Source/WebKit/ChangeLog
Source/WebKit/Shared/WebPreferences.yaml
Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm
Source/WebKit/UIProcess/API/Cocoa/WKWebViewConfiguration.mm
Source/WebKit/UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h
Source/WebKit/UIProcess/Cocoa/WKWebViewContentProviderRegistry.h
Source/WebKit/UIProcess/Cocoa/WKWebViewContentProviderRegistry.mm
Tools/WebKitTestRunner/cocoa/TestControllerCocoa.mm