Title: [238896] tags/Safari-607.1.16.1/Source/WebKit
- Revision
- 238896
- Author
- [email protected]
- Date
- 2018-12-05 10:12:32 -0800 (Wed, 05 Dec 2018)
Log Message
Cherry-pick r238818. rdar://problem/45928708
Swipe snapshot stays up too long swiping around on apple.com (waiting for first paint)
https://bugs.webkit.org/show_bug.cgi?id=192319
<rdar://problem/45928708>
Reviewed by Simon Fraser.
* UIProcess/Cocoa/ViewGestureController.cpp:
(WebKit::ViewGestureController::didStartProvisionalLoadForMainFrame):
* UIProcess/Cocoa/ViewGestureController.h:
* UIProcess/ios/ViewGestureControllerIOS.mm:
(WebKit::ViewGestureController::endSwipeGesture):
In r236966, I reverted slightly too much of r232416.
We still need to defer requesting a presentation update callback until
after the provisional load starts. Otherwise, we could get the callback
while we're in the 'paused' state, and drop it on the floor. That would
then mean that we time out instead of promptly removing the snapshot.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@238818 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Modified Paths
Diff
Modified: tags/Safari-607.1.16.1/Source/WebKit/ChangeLog (238895 => 238896)
--- tags/Safari-607.1.16.1/Source/WebKit/ChangeLog 2018-12-05 18:03:54 UTC (rev 238895)
+++ tags/Safari-607.1.16.1/Source/WebKit/ChangeLog 2018-12-05 18:12:32 UTC (rev 238896)
@@ -1,3 +1,46 @@
+2018-12-05 Alan Coon <[email protected]>
+
+ Cherry-pick r238818. rdar://problem/45928708
+
+ Swipe snapshot stays up too long swiping around on apple.com (waiting for first paint)
+ https://bugs.webkit.org/show_bug.cgi?id=192319
+ <rdar://problem/45928708>
+
+ Reviewed by Simon Fraser.
+
+ * UIProcess/Cocoa/ViewGestureController.cpp:
+ (WebKit::ViewGestureController::didStartProvisionalLoadForMainFrame):
+ * UIProcess/Cocoa/ViewGestureController.h:
+ * UIProcess/ios/ViewGestureControllerIOS.mm:
+ (WebKit::ViewGestureController::endSwipeGesture):
+ In r236966, I reverted slightly too much of r232416.
+ We still need to defer requesting a presentation update callback until
+ after the provisional load starts. Otherwise, we could get the callback
+ while we're in the 'paused' state, and drop it on the floor. That would
+ then mean that we time out instead of promptly removing the snapshot.
+
+
+ git-svn-id: https://svn.webkit.org/repository/webkit/trunk@238818 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+ 2018-12-03 Tim Horton <[email protected]>
+
+ Swipe snapshot stays up too long swiping around on apple.com (waiting for first paint)
+ https://bugs.webkit.org/show_bug.cgi?id=192319
+ <rdar://problem/45928708>
+
+ Reviewed by Simon Fraser.
+
+ * UIProcess/Cocoa/ViewGestureController.cpp:
+ (WebKit::ViewGestureController::didStartProvisionalLoadForMainFrame):
+ * UIProcess/Cocoa/ViewGestureController.h:
+ * UIProcess/ios/ViewGestureControllerIOS.mm:
+ (WebKit::ViewGestureController::endSwipeGesture):
+ In r236966, I reverted slightly too much of r232416.
+ We still need to defer requesting a presentation update callback until
+ after the provisional load starts. Otherwise, we could get the callback
+ while we're in the 'paused' state, and drop it on the floor. That would
+ then mean that we time out instead of promptly removing the snapshot.
+
2018-12-04 Alan Coon <[email protected]>
Revert r238869. rdar://problem/45928708
Modified: tags/Safari-607.1.16.1/Source/WebKit/UIProcess/Cocoa/ViewGestureController.cpp (238895 => 238896)
--- tags/Safari-607.1.16.1/Source/WebKit/UIProcess/Cocoa/ViewGestureController.cpp 2018-12-05 18:03:54 UTC (rev 238895)
+++ tags/Safari-607.1.16.1/Source/WebKit/UIProcess/Cocoa/ViewGestureController.cpp 2018-12-05 18:12:32 UTC (rev 238896)
@@ -148,6 +148,9 @@
void ViewGestureController::didStartProvisionalLoadForMainFrame()
{
m_snapshotRemovalTracker.resume();
+
+ if (auto provisionalLoadCallback = WTFMove(m_provisionalLoadCallback))
+ provisionalLoadCallback();
}
void ViewGestureController::didFirstVisuallyNonEmptyLayoutForMainFrame()
Modified: tags/Safari-607.1.16.1/Source/WebKit/UIProcess/Cocoa/ViewGestureController.h (238895 => 238896)
--- tags/Safari-607.1.16.1/Source/WebKit/UIProcess/Cocoa/ViewGestureController.h 2018-12-05 18:03:54 UTC (rev 238895)
+++ tags/Safari-607.1.16.1/Source/WebKit/UIProcess/Cocoa/ViewGestureController.h 2018-12-05 18:12:32 UTC (rev 238896)
@@ -312,6 +312,7 @@
bool m_isConnectedToProcess { false };
SnapshotRemovalTracker m_snapshotRemovalTracker;
+ WTF::Function<void()> m_provisionalLoadCallback;
};
} // namespace WebKit
Modified: tags/Safari-607.1.16.1/Source/WebKit/UIProcess/ios/ViewGestureControllerIOS.mm (238895 => 238896)
--- tags/Safari-607.1.16.1/Source/WebKit/UIProcess/ios/ViewGestureControllerIOS.mm 2018-12-05 18:03:54 UTC (rev 238895)
+++ tags/Safari-607.1.16.1/Source/WebKit/UIProcess/ios/ViewGestureControllerIOS.mm 2018-12-05 18:12:32 UTC (rev 238896)
@@ -300,19 +300,6 @@
return;
}
- if (auto drawingArea = m_webPageProxy.drawingArea()) {
- uint64_t pageID = m_webPageProxy.pageID();
- GestureID gestureID = m_currentGestureID;
- drawingArea->dispatchAfterEnsuringDrawing([pageID, gestureID] (CallbackBase::Error error) {
- if (auto gestureController = controllerForGesture(pageID, gestureID))
- gestureController->willCommitPostSwipeTransitionLayerTree(error == CallbackBase::Error::None);
- });
- drawingArea->hideContentUntilPendingUpdate();
- } else {
- removeSwipeSnapshot();
- return;
- }
-
// FIXME: Should we wait for VisuallyNonEmptyLayout like we do on Mac?
m_snapshotRemovalTracker.start(SnapshotRemovalTracker::RenderTreeSizeThreshold
| SnapshotRemovalTracker::RepaintAfterNavigation
@@ -326,6 +313,22 @@
m_backgroundColorForCurrentSnapshot = snapshot->backgroundColor();
m_webPageProxy.didChangeBackgroundColor();
}
+
+ uint64_t pageID = m_webPageProxy.pageID();
+ GestureID gestureID = m_currentGestureID;
+ m_provisionalLoadCallback = [this, pageID, gestureID] {
+ auto drawingArea = m_webPageProxy.drawingArea();
+ if (!drawingArea) {
+ removeSwipeSnapshot();
+ return;
+ }
+
+ drawingArea->dispatchAfterEnsuringDrawing([pageID, gestureID] (CallbackBase::Error error) {
+ if (auto gestureController = controllerForGesture(pageID, gestureID))
+ gestureController->willCommitPostSwipeTransitionLayerTree(error == CallbackBase::Error::None);
+ });
+ drawingArea->hideContentUntilPendingUpdate();
+ };
}
void ViewGestureController::setRenderTreeSize(uint64_t renderTreeSize)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes