Title: [230128] trunk/Source
Revision
230128
Author
[email protected]
Date
2018-03-30 23:44:29 -0700 (Fri, 30 Mar 2018)

Log Message

REGRESSION (r229828): Facebook login popup is blank
https://bugs.webkit.org/show_bug.cgi?id=184206
<rdar://problem/39057006>

Reviewed by Wenson Hsieh.

Source/WebCore:

Since r229828, we freeze the layer tree during the navigation policy check.
We freeze in WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction()
and unfreeze in WebFrameLoaderClient::didDecidePolicyForNavigationAction().

WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction() gets called
from PolicyChecker::checkNavigationPolicy() which has 3 call sites in
FrameLoader and one in DocumentLoader for redirects. The call sites in
FrameLoader were taking care of calling didDecidePolicyForNavigationAction()
on the FrameLoaderClient in their completion handler, but the DocumentLoader
call site was failing to do so. As a result, the layer tree would stay frozen.

To make this a lot less error prone, I moved the call to
WebFrameLoaderClient::didDecidePolicyForNavigationAction() to
PolicyChecker::checkNavigationPolicy(), inside the completion handler passed
to WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction(). This way,
even if new code starts calling PolicyChecker::checkNavigationPolicy(), we
do not need to worry about letting the client know when the policy decision
is made.

No new tests, covered by existing redirection tests with the
new assertion I added.

* loader/FrameLoader.cpp:
(WebCore::FrameLoader::continueFragmentScrollAfterNavigationPolicy):
(WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
* loader/PolicyChecker.cpp:
(WebCore::PolicyChecker::checkNavigationPolicy):

Source/WebKit:

Add assertion to make sure we never try to do a policy check to
a resource response while a policy check for a navigation is
pending. This assertion was being hit by several of our redirection
tests without my fix.

* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (230127 => 230128)


--- trunk/Source/WebCore/ChangeLog	2018-03-31 05:14:49 UTC (rev 230127)
+++ trunk/Source/WebCore/ChangeLog	2018-03-31 06:44:29 UTC (rev 230128)
@@ -1,3 +1,39 @@
+2018-03-30  Chris Dumez  <[email protected]>
+
+        REGRESSION (r229828): Facebook login popup is blank
+        https://bugs.webkit.org/show_bug.cgi?id=184206
+        <rdar://problem/39057006>
+
+        Reviewed by Wenson Hsieh.
+
+        Since r229828, we freeze the layer tree during the navigation policy check.
+        We freeze in WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction()
+        and unfreeze in WebFrameLoaderClient::didDecidePolicyForNavigationAction().
+
+        WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction() gets called
+        from PolicyChecker::checkNavigationPolicy() which has 3 call sites in
+        FrameLoader and one in DocumentLoader for redirects. The call sites in
+        FrameLoader were taking care of calling didDecidePolicyForNavigationAction()
+        on the FrameLoaderClient in their completion handler, but the DocumentLoader
+        call site was failing to do so. As a result, the layer tree would stay frozen.
+
+        To make this a lot less error prone, I moved the call to
+        WebFrameLoaderClient::didDecidePolicyForNavigationAction() to
+        PolicyChecker::checkNavigationPolicy(), inside the completion handler passed
+        to WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction(). This way,
+        even if new code starts calling PolicyChecker::checkNavigationPolicy(), we
+        do not need to worry about letting the client know when the policy decision
+        is made.
+
+        No new tests, covered by existing redirection tests with the
+        new assertion I added.
+
+        * loader/FrameLoader.cpp:
+        (WebCore::FrameLoader::continueFragmentScrollAfterNavigationPolicy):
+        (WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
+        * loader/PolicyChecker.cpp:
+        (WebCore::PolicyChecker::checkNavigationPolicy):
+
 2018-03-30  Devin Rousso  <[email protected]>
 
         Web Inspector: tint all pixels drawn by shader program when hovering ShaderProgramTreeElement

Modified: trunk/Source/WebCore/loader/FrameLoader.cpp (230127 => 230128)


--- trunk/Source/WebCore/loader/FrameLoader.cpp	2018-03-31 05:14:49 UTC (rev 230127)
+++ trunk/Source/WebCore/loader/FrameLoader.cpp	2018-03-31 06:44:29 UTC (rev 230128)
@@ -2930,8 +2930,6 @@
 
 void FrameLoader::continueFragmentScrollAfterNavigationPolicy(const ResourceRequest& request, bool shouldContinue)
 {
-    m_client.didDecidePolicyForNavigationAction();
-
     m_quickRedirectComing = false;
 
     if (!shouldContinue)
@@ -3177,8 +3175,6 @@
     // through this method already, nested; otherwise, policyDataSource should still be set.
     ASSERT(m_policyDocumentLoader || !m_provisionalDocumentLoader->unreachableURL().isEmpty());
 
-    m_client.didDecidePolicyForNavigationAction();
-
     bool isTargetItem = history().provisionalItem() ? history().provisionalItem()->isTargetItem() : false;
 
     bool urlIsDisallowed = allowNavigationToInvalidURL == AllowNavigationToInvalidURL::No && !request.url().isValid();

Modified: trunk/Source/WebCore/loader/PolicyChecker.cpp (230127 => 230128)


--- trunk/Source/WebCore/loader/PolicyChecker.cpp	2018-03-31 05:14:49 UTC (rev 230127)
+++ trunk/Source/WebCore/loader/PolicyChecker.cpp	2018-03-31 06:44:29 UTC (rev 230128)
@@ -150,6 +150,8 @@
     String suggestedFilename = action.downloadAttribute().isEmpty() ? nullAtom() : action.downloadAttribute();
     ResourceRequest requestCopy = request;
     m_frame.loader().client().dispatchDecidePolicyForNavigationAction(action, request, didReceiveRedirectResponse, formState, [this, function = WTFMove(function), request = WTFMove(requestCopy), formState = makeRefPtr(formState), suggestedFilename = WTFMove(suggestedFilename)](PolicyAction policyAction) mutable {
+        m_frame.loader().client().didDecidePolicyForNavigationAction();
+
         m_delegateIsDecidingNavigationPolicy = false;
 
         switch (policyAction) {

Modified: trunk/Source/WebKit/ChangeLog (230127 => 230128)


--- trunk/Source/WebKit/ChangeLog	2018-03-31 05:14:49 UTC (rev 230127)
+++ trunk/Source/WebKit/ChangeLog	2018-03-31 06:44:29 UTC (rev 230128)
@@ -1,3 +1,19 @@
+2018-03-30  Chris Dumez  <[email protected]>
+
+        REGRESSION (r229828): Facebook login popup is blank
+        https://bugs.webkit.org/show_bug.cgi?id=184206
+        <rdar://problem/39057006>
+
+        Reviewed by Wenson Hsieh.
+
+        Add assertion to make sure we never try to do a policy check to
+        a resource response while a policy check for a navigation is
+        pending. This assertion was being hit by several of our redirection
+        tests without my fix.
+
+        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
+        (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
+
 2018-03-30  Ryan Haddad  <[email protected]>
 
         Unreviewed, rolling out r230125.

Modified: trunk/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp (230127 => 230128)


--- trunk/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp	2018-03-31 05:14:49 UTC (rev 230127)
+++ trunk/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp	2018-03-31 06:44:29 UTC (rev 230128)
@@ -729,6 +729,8 @@
         return;
     }
 
+    ASSERT(!m_isDecidingNavigationPolicyDecision);
+
     RefPtr<API::Object> userData;
 
     // Notify the bundle client.
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to