[iOS WK2] Swiping back just after scrolling can cause some tiles to disappear
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 26 Jun 2015 00:29:58 +0000 (00:29 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 26 Jun 2015 00:29:58 +0000 (00:29 +0000)
commit405649e8d21cea40550aa8ad078affc90c59aa83
treec95814ca1819f0a8503d5e78a94dd7ee7f452a0f
parentae53c1507507dc09099d917a1b46d33347943100
[iOS WK2] Swiping back just after scrolling can cause some tiles to disappear
https://bugs.webkit.org/show_bug.cgi?id=146329
rdar://problem/21233010

Reviewed by Tim Horton.
Source/WebCore:

Have the Compositing log channel dump the visible rect used for layer flushing.

* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::flushPendingLayerChanges):

Source/WebKit2:

When doing a back swipe, views interposed between the WKWebView and the WKContentView
get positions and animations for the swipe. This -_updateVisibleContentRects to
compute bad visible and unobscured rects, so we lose tiles.

Fix by "freezing" the visible and unobscured content rects in the view being
swiped for the duration of the navigation gesture. When swiping the main view,
we just plumb through navigationGestureDidEnd(). When Reader is showing and the
swiped view is different from the navigating view, use the new navigationGestureDidEnd()
override which takes no arguments.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _updateVisibleContentRects]):
(-[WKWebView _navigationGestureDidBegin]):
(-[WKWebView _navigationGestureDidEnd]):
* UIProcess/API/Cocoa/WKWebViewInternal.h:
* UIProcess/API/gtk/PageClientImpl.cpp:
(WebKit::PageClientImpl::navigationGestureDidEnd):
* UIProcess/API/gtk/PageClientImpl.h:
* UIProcess/CoordinatedGraphics/WebView.h:
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::navigationGestureDidEnd):
* UIProcess/WebPageProxy.h:
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::navigationGestureDidBegin):
(WebKit::PageClientImpl::navigationGestureDidEnd):
* UIProcess/ios/ViewGestureControllerIOS.mm:
(WebKit::ViewGestureController::beginSwipeGesture):
(WebKit::ViewGestureController::endSwipeGesture):
* UIProcess/mac/PageClientImpl.h:
* UIProcess/mac/PageClientImpl.mm:
(WebKit::PageClientImpl::navigationGestureDidEnd):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@185972 268f45cc-cd09-0410-ab3c-d52691b4dbfc
16 files changed:
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderLayerCompositor.cpp
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm
Source/WebKit2/UIProcess/API/Cocoa/WKWebViewInternal.h
Source/WebKit2/UIProcess/API/gtk/PageClientImpl.cpp
Source/WebKit2/UIProcess/API/gtk/PageClientImpl.h
Source/WebKit2/UIProcess/CoordinatedGraphics/WebView.h
Source/WebKit2/UIProcess/PageClient.h
Source/WebKit2/UIProcess/WebPageProxy.cpp
Source/WebKit2/UIProcess/WebPageProxy.h
Source/WebKit2/UIProcess/ios/PageClientImplIOS.h
Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm
Source/WebKit2/UIProcess/ios/ViewGestureControllerIOS.mm
Source/WebKit2/UIProcess/mac/PageClientImpl.h
Source/WebKit2/UIProcess/mac/PageClientImpl.mm