Title: [184399] trunk/Source/WebKit2
Revision
184399
Author
[email protected]
Date
2015-05-15 11:25:57 -0700 (Fri, 15 May 2015)

Log Message

[WK2][Cocoa] Back swipe tab snapshot takes a long time to be removed on bing.com
https://bugs.webkit.org/show_bug.cgi?id=145061
<rdar://problem/20939743>

Reviewed by Tim Horton.

When swiping back from a video search result to the list of video
search results on bing.com, the back swipe gesture tab snapshot takes
~3 seconds to be removed, even though the page gets loaded almost
instantly from PageCache. The tab snapshot should be removed as soon as
the load is done.

The issue is that we only cleared the back swipe gesture tab snapshot
after PageClient::didFinishLoadForMainFrame() has been called. However,
PageClient::didFinishLoadForMainFrame() was only being called by
WebPageProxy if the main frame loaded *without* error. In case the main
frame loaded with an error, only WebPageProxy::didFailLoadForFrame() is
called, not WebPageProxy::didFinishLoadForFrame() and we would fail to
remove the gesture snapshot until the 3 seconds timeout.

This patch calls PageClient::didFinishLoadForMainFrame() from
WebPageProxy::didFailLoadForFrame() so we remove the snapshot in the
error case as well.

The reason didFailLoadForFrame() is being called on bing.com video
search results is because a "ping" load is aborted when the page is
entering PageCache. Aborting any kind of resource load sets a
"cancellation" error on the main document.

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

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (184398 => 184399)


--- trunk/Source/WebKit2/ChangeLog	2015-05-15 18:21:29 UTC (rev 184398)
+++ trunk/Source/WebKit2/ChangeLog	2015-05-15 18:25:57 UTC (rev 184399)
@@ -1,3 +1,37 @@
+2015-05-15  Chris Dumez  <[email protected]>
+
+        [WK2][Cocoa] Back swipe tab snapshot takes a long time to be removed on bing.com
+        https://bugs.webkit.org/show_bug.cgi?id=145061
+        <rdar://problem/20939743>
+
+        Reviewed by Tim Horton.
+
+        When swiping back from a video search result to the list of video
+        search results on bing.com, the back swipe gesture tab snapshot takes
+        ~3 seconds to be removed, even though the page gets loaded almost
+        instantly from PageCache. The tab snapshot should be removed as soon as
+        the load is done.
+
+        The issue is that we only cleared the back swipe gesture tab snapshot
+        after PageClient::didFinishLoadForMainFrame() has been called. However,
+        PageClient::didFinishLoadForMainFrame() was only being called by
+        WebPageProxy if the main frame loaded *without* error. In case the main
+        frame loaded with an error, only WebPageProxy::didFailLoadForFrame() is
+        called, not WebPageProxy::didFinishLoadForFrame() and we would fail to
+        remove the gesture snapshot until the 3 seconds timeout.
+
+        This patch calls PageClient::didFinishLoadForMainFrame() from
+        WebPageProxy::didFailLoadForFrame() so we remove the snapshot in the
+        error case as well.
+
+        The reason didFailLoadForFrame() is being called on bing.com video
+        search results is because a "ping" load is aborted when the page is
+        entering PageCache. Aborting any kind of resource load sets a
+        "cancellation" error on the main document.
+
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::didFailLoadForFrame):
+
 2015-05-14  Carlos Garcia Campos  <[email protected]>
 
         REGRESSION(r183861): [SOUP] Downloads are broken when using the Network Process

Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp (184398 => 184399)


--- trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp	2015-05-15 18:21:29 UTC (rev 184398)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp	2015-05-15 18:25:57 UTC (rev 184399)
@@ -3042,6 +3042,11 @@
             m_navigationClient->didFailNavigationWithError(*this, *frame, navigation.get(), error, m_process->transformHandlesToObjects(userData.object()).get());
     } else
         m_loaderClient->didFailLoadWithErrorForFrame(*this, *frame, navigation.get(), error, m_process->transformHandlesToObjects(userData.object()).get());
+
+    // Notify the PageClient that the main frame finished loading. The WebView / GestureController need to know the load has
+    // finished (e.g. to clear the back swipe snapshot).
+    if (frame->isMainFrame())
+        m_pageClient.didFinishLoadForMainFrame();
 }
 
 void WebPageProxy::didSameDocumentNavigationForFrame(uint64_t frameID, uint64_t navigationID, uint32_t opaqueSameDocumentNavigationType, const String& url, const UserData& userData)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to