[iOS WK2] Fixed elements can go outside the document on pinching
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 10 May 2014 00:11:26 +0000 (00:11 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 10 May 2014 00:11:26 +0000 (00:11 +0000)
commitde27b42348a43c20a475ee16da436c7d25d9f218
treecee977d21b2a6779a3b43e1157cde6b392299084
parent7ada3be3cb8c322496fc50f789dd26fd72df15af
[iOS WK2] Fixed elements can go outside the document on pinching
https://bugs.webkit.org/show_bug.cgi?id=132759
<rdar://problem/16870835>

Reviewed by Benjamin Poulain.

Constrain the rect used to position fixed position objects when pinching (when
the scale goes below the minimumScale). Do so in such a way that there's a smooth
transition between rubber-banding and pinching.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _updateScrollViewBackground]): Use a nicer form for std::max<>.
(-[WKWebView _updateVisibleContentRects]): Pass the minimum scale.
* UIProcess/API/ios/WKViewIOS.mm:
(-[WKView _updateVisibleContentRects]): Ditto.
* UIProcess/ios/WKContentView.h:
* UIProcess/ios/WKContentView.mm:
(adjustedUnexposedEdge): Helper to adjust the left/top.
(adjustedUnexposedMaxEdge): Helper to adjust the right/bottom.
(fixedPositionRectFromExposedRect):
(-[WKContentView didUpdateVisibleRect:unobscuredRect:scale:minimumScale:inStableState:]):
(-[WKContentView didUpdateVisibleRect:unobscuredRect:scale:inStableState:]): Deleted.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@168560 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm
Source/WebKit2/UIProcess/API/ios/WKViewIOS.mm
Source/WebKit2/UIProcess/ios/WKContentView.h
Source/WebKit2/UIProcess/ios/WKContentView.mm