[iOS WK2] position:fixed elements sometimes truncated on scroll view bouncing
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 16 Jun 2015 02:10:58 +0000 (02:10 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 16 Jun 2015 02:10:58 +0000 (02:10 +0000)
commit23d39ae18d1f4da4551840dabe8d3961a2ab1e13
tree70e7743a4e5bb8fbe7ac3c03bcc1fac2b1c4d281
parent0fe6cdab7cf035056176ae78da104fbda6d3e483
[iOS WK2] position:fixed elements sometimes truncated on scroll view bouncing
https://bugs.webkit.org/show_bug.cgi?id=146000
rdar://problem/19448439

Reviewed by Benjamin Poulain.

When in the middle of a rubber-band (UIScrollView bounce), we could send a bad
fixed position rect down to WebCore, causing 100% height elements to get laid out
at the wrong height, possible too short. This occurred when -_updateVisibleContentRects
said we were in a stable state, but the rubber-band offset caused WebPageProxy::computeCustomFixedPositionRect()
to compute a bad rect via constrainedUnobscuredRect.intersect(documentRect).

Fix by not claiming to be in a stable state during rubber-banding. Added _scrollViewIsRubberBanding
to compute that, taking care with floating point comparisons for 3x devices.

* UIProcess/API/Cocoa/WKWebView.mm:
(isGreaterInDevicePixels):
(-[WKWebView _scrollViewIsRubberBanding]):
(-[WKWebView _updateVisibleContentRects]):

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