REGRESSION (PSON): After swipe back, first few attempts to swipe forward not recogniz...
authorantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 25 Jan 2019 20:20:17 +0000 (20:20 +0000)
committerantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 25 Jan 2019 20:20:17 +0000 (20:20 +0000)
commitc25a8df516e349e78c28ebb3b534f832114e001c
treea9bc4e512358e08d81376c676c6139485b1015fe
parent4828196d97fabe1481f351337469c281bdd98a2f
REGRESSION (PSON): After swipe back, first few attempts to swipe forward not recognized as swipe gestures
https://bugs.webkit.org/show_bug.cgi?id=193818
<rdar://problem/47456584>

Reviewed by Tim Horton.

We don't hit the RenderTreeSizeThreshold milestone to remove the snapshot and allow interaction because we request it
from a wrong process (the one we are leaving behind).

* UIProcess/Cocoa/ViewGestureController.cpp:
(WebKit::ViewGestureController::didStartProvisionalLoadForMainFrame):

Request the RenderTreeSizeThreshold notification when the load has started and we know the process to use.

(WebKit::ViewGestureController::SnapshotRemovalTracker::hasOutstandingEvent):
* UIProcess/Cocoa/ViewGestureController.h:
(WebKit::ViewGestureController::SnapshotRemovalTracker::renderTreeSizeThreshold const):
(WebKit::ViewGestureController::SnapshotRemovalTracker::setRenderTreeSizeThreshold):
* UIProcess/mac/ViewGestureControllerMac.mm:
(WebKit::ViewGestureController::endSwipeGesture):

Don't request immediately, save the threshold to SnapshotRemovalTracker.

(WebKit::ViewGestureController::requestRenderTreeSizeNotificationIfNeeded):

Do the request to the right process.

* WebProcess/WebPage/ViewGestureGeometryCollector.cpp:
(WebKit::ViewGestureGeometryCollector::setRenderTreeSizeNotificationThreshold):

Ensure we send the notification even if we reached the threshold before it was requested.

(WebKit::ViewGestureGeometryCollector::sendDidHitRenderTreeSizeThresholdIfNeeded):
(WebKit::ViewGestureGeometryCollector::mainFrameDidLayout):
* WebProcess/WebPage/ViewGestureGeometryCollector.h:
(WebKit::ViewGestureGeometryCollector::setRenderTreeSizeNotificationThreshold): Deleted.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@240493 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/Cocoa/ViewGestureController.cpp
Source/WebKit/UIProcess/Cocoa/ViewGestureController.h
Source/WebKit/UIProcess/mac/ViewGestureControllerMac.mm
Source/WebKit/WebProcess/WebPage/ViewGestureGeometryCollector.cpp
Source/WebKit/WebProcess/WebPage/ViewGestureGeometryCollector.h