Add plumbing for a compatibility mode preference in WebKit
authorwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 3 Apr 2019 15:02:07 +0000 (15:02 +0000)
committerwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 3 Apr 2019 15:02:07 +0000 (15:02 +0000)
commita538a4a821f58b2fbc38adf5b36531db4e7848dc
tree68bb4e0edd085e5f3a87314346532cee676da056
parente049becbefa649af07a66d5c382eeb2939a4b3f5
Add plumbing for a compatibility mode preference in WebKit
https://bugs.webkit.org/show_bug.cgi?id=196005

Reviewed by Tim Horton.

Source/WebKit:

Add plumbing between the Cocoa API object (WKWebpagePreferences) and the inner C++ API object
(API::WebsitePolicies) for compatibility mode.

* Shared/WebCompatibilityMode.h: Added.
* UIProcess/API/APIWebsitePolicies.h:
* UIProcess/API/Cocoa/WKWebpagePreferences.mm:
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::adjustPoliciesForCompatibilityMode):
* UIProcess/WebPageProxy.h:
* UIProcess/ios/WebPageProxyIOS.mm:
* WebKit.xcodeproj/project.pbxproj:

Tools:

Add new API tests.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/ios/PreferredCompatibilityMode.mm: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@243797 268f45cc-cd09-0410-ab3c-d52691b4dbfc
12 files changed:
Source/WebKit/ChangeLog
Source/WebKit/Shared/WebCompatibilityMode.h [new file with mode: 0644]
Source/WebKit/UIProcess/API/APIWebsitePolicies.h
Source/WebKit/UIProcess/API/Cocoa/WKWebpagePreferences.mm
Source/WebKit/UIProcess/Cocoa/NavigationState.mm
Source/WebKit/UIProcess/WebPageProxy.cpp
Source/WebKit/UIProcess/WebPageProxy.h
Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm
Source/WebKit/WebKit.xcodeproj/project.pbxproj
Tools/ChangeLog
Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
Tools/TestWebKitAPI/ios/PreferredCompatibilityMode.mm [new file with mode: 0644]