Plumb the navigation's request when determining recommended compatibility mode
authorwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 24 Apr 2019 19:10:50 +0000 (19:10 +0000)
committerwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 24 Apr 2019 19:10:50 +0000 (19:10 +0000)
https://bugs.webkit.org/show_bug.cgi?id=197225
<rdar://problem/48389965>

Reviewed by Alex Christensen.

Adds a new argument to effectiveCompatibilityModeAfterAdjustingPolicies.

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

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244601 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit/ChangeLog
Source/WebKit/UIProcess/WebPageProxy.cpp
Source/WebKit/UIProcess/WebPageProxy.h

index 270eb51..8e8baa8 100644 (file)
@@ -1,3 +1,18 @@
+2019-04-24  Wenson Hsieh  <wenson_hsieh@apple.com>
+
+        Plumb the navigation's request when determining recommended compatibility mode
+        https://bugs.webkit.org/show_bug.cgi?id=197225
+        <rdar://problem/48389965>
+
+        Reviewed by Alex Christensen.
+
+        Adds a new argument to effectiveCompatibilityModeAfterAdjustingPolicies.
+
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::decidePolicyForNavigationAction):
+        (WebKit::WebPageProxy::effectiveCompatibilityModeAfterAdjustingPolicies):
+        * UIProcess/WebPageProxy.h:
+
 2019-04-24  Tim Horton  <timothy_horton@apple.com>
 
         Clean up WKActionSheetAssistant's use of LaunchServices
index 43bb795..c48adcd 100644 (file)
@@ -4600,7 +4600,7 @@ void WebPageProxy::decidePolicyForNavigationAction(Ref<WebProcessProxy>&& proces
                         policies = defaultPolicies->copy();
                 }
                 if (policies)
-                    navigation->setEffectiveCompatibilityMode(effectiveCompatibilityModeAfterAdjustingPolicies(*policies));
+                    navigation->setEffectiveCompatibilityMode(effectiveCompatibilityModeAfterAdjustingPolicies(*policies, navigation->originalRequest()));
             }
             receivedNavigationPolicyDecision(policyAction, navigation.get(), processSwapRequestedByClient, frame, policies.get(), WTFMove(sender));
         };
@@ -9000,7 +9000,7 @@ void WebPageProxy::speechSynthesisResume(CompletionHandler<void()>&& completionH
 
 #if !PLATFORM(IOS_FAMILY) || !USE(APPLE_INTERNAL_SDK)
 
-WebCompatibilityMode WebPageProxy::effectiveCompatibilityModeAfterAdjustingPolicies(API::WebsitePolicies&)
+WebCompatibilityMode WebPageProxy::effectiveCompatibilityModeAfterAdjustingPolicies(API::WebsitePolicies&, const WebCore::ResourceRequest&)
 {
     return WebCompatibilityMode::Recommended;
 }
index 2413954..3c54aa9 100644 (file)
@@ -1625,7 +1625,7 @@ private:
     void unableToImplementPolicy(uint64_t frameID, const WebCore::ResourceError&, const UserData&);
     void beginSafeBrowsingCheck(const URL&, bool, WebFramePolicyListenerProxy&);
 
-    WebCompatibilityMode effectiveCompatibilityModeAfterAdjustingPolicies(API::WebsitePolicies&);
+    WebCompatibilityMode effectiveCompatibilityModeAfterAdjustingPolicies(API::WebsitePolicies&, const WebCore::ResourceRequest&);
 
     void willSubmitForm(uint64_t frameID, uint64_t sourceFrameID, const Vector<std::pair<String, String>>& textFieldValues, uint64_t listenerID, const UserData&);