Add new compatibility mode API on WKNavigation
authorwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 18 Apr 2019 23:38:53 +0000 (23:38 +0000)
committerwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 18 Apr 2019 23:38:53 +0000 (23:38 +0000)
commit6377befcf86442cb9c49d931ac1fc841ff9293c2
treecbe26283090a74f6f07c7900da2051a30fda9d34
parent08f5d25c28ab21983e4977806bfde47ec0d500d6
Add new compatibility mode API on WKNavigation
https://bugs.webkit.org/show_bug.cgi?id=197069
<rdar://problem/50025800>

Reviewed by Tim Horton.

Source/WebKit:

Adds a new property on WKNavigation.

* Shared/WebCompatibilityMode.h:

Drive-by fix: make this enum class 8 bits wide.

* UIProcess/API/APINavigation.h:
(API::Navigation::setEffectiveCompatibilityMode):
(API::Navigation::effectiveCompatibilityMode const):

Add a new member variable to API::Navigation.

* UIProcess/API/Cocoa/WKNavigation.h:
* UIProcess/API/Cocoa/WKNavigation.mm:
* UIProcess/API/Cocoa/WKWebpagePreferences.mm:
* UIProcess/API/Cocoa/WKWebpagePreferencesInternal.h:

Add various hooks into WebKitAdditions.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::decidePolicyForNavigationAction):

Set API::Navigation's effective compatibility mode.

(WebKit::WebPageProxy::effectiveCompatibilityModeAfterAdjustingPolicies):

Renamed and refactored this method to return the effective compatibility mode, chosen while adjusting website
policies.

(WebKit::WebPageProxy::adjustPoliciesForCompatibilityMode): Deleted.
* UIProcess/WebPageProxy.h:

Tools:

Add a block property for -didCommitNavigation to TestNavigationDelegate.

* TestWebKitAPI/cocoa/TestNavigationDelegate.h:
* TestWebKitAPI/cocoa/TestNavigationDelegate.mm:
(-[TestNavigationDelegate webView:didCommitNavigation:]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244444 268f45cc-cd09-0410-ab3c-d52691b4dbfc
12 files changed:
Source/WebKit/ChangeLog
Source/WebKit/Shared/WebCompatibilityMode.h
Source/WebKit/UIProcess/API/APINavigation.h
Source/WebKit/UIProcess/API/Cocoa/WKNavigation.h
Source/WebKit/UIProcess/API/Cocoa/WKNavigation.mm
Source/WebKit/UIProcess/API/Cocoa/WKWebpagePreferences.mm
Source/WebKit/UIProcess/API/Cocoa/WKWebpagePreferencesInternal.h
Source/WebKit/UIProcess/WebPageProxy.cpp
Source/WebKit/UIProcess/WebPageProxy.h
Tools/ChangeLog
Tools/TestWebKitAPI/cocoa/TestNavigationDelegate.h
Tools/TestWebKitAPI/cocoa/TestNavigationDelegate.mm