[iOS WK2] When zoomed, fixed elements jump at the start of a scroll, and jump back...
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 16 May 2014 03:56:10 +0000 (03:56 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 16 May 2014 03:56:10 +0000 (03:56 +0000)
commit8b927a310d3e43da988c473ae25b4ac86104e262
tree9dca49ca50e7c1e6f4218f8189e1123c1cad340a
parent9ae9815ee379d33491ff52d1468697da64fdb7c7
[iOS WK2] When zoomed, fixed elements jump at the start of a scroll, and jump back at the end.
https://bugs.webkit.org/show_bug.cgi?id=132978
<rdar://problem/16894428>

Reviewed by Benjamin Poulain.

Source/WebCore:

This was the actual cause of the bug; r168560 changed the rect passed in here
to be the customFixedPositionRect rather than the unobscured rect, but we
used it to call FrameView::rectForViewportConstrainedObjects() which gave back
another bogus rect. So just use the rect passed in.

* page/scrolling/ios/ScrollingTreeScrollingNodeIOS.mm:
(WebCore::ScrollingTreeScrollingNodeIOS::updateLayersAfterViewportChange):

Source/WebKit2:

Move the static function fixedPositionRectFromExposedRect() to a member function on
WebPageProxy so we can call it from more places. Also never give WebCore a customFixedPosition
rect that extends past the document bounds, but allow rubber-banding/pinching in the UI process to
move fixed elements outside the document.

* UIProcess/PageClient.h: Need to expose minimumZoomScale() and contentsSize() to WebPageProxy.
* UIProcess/WebPageProxy.h:
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::minimumZoomScale):
(WebKit::PageClientImpl::contentsSize):
* UIProcess/ios/WKContentView.mm:
(-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:]):
Pass the computeCustomFixedPositionRect(ConstrainedToDocumentRect) to WebCore, but use computeCustomFixedPositionRect()
for the ScrollingCoordinator update.
(adjustedUnexposedEdge): Deleted.
(adjustedUnexposedMaxEdge): Deleted.
(fixedPositionRectFromExposedRect): Deleted.
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::adjustedUnexposedEdge):
(WebKit::adjustedUnexposedMaxEdge):
(WebKit::WebPageProxy::computeCustomFixedPositionRect):
* UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
(WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree): This fixes some flashing when the scrolling tree
was being updated while scrolling; we now pass the correct rect.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@168920 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/page/scrolling/ios/ScrollingTreeScrollingNodeIOS.mm
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/PageClient.h
Source/WebKit2/UIProcess/WebPageProxy.h
Source/WebKit2/UIProcess/ios/PageClientImplIOS.h
Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm
Source/WebKit2/UIProcess/ios/WKContentView.mm
Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm
Source/WebKit2/UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm