[iOS WK2] Make -webkit-overflow-scrolling:touch work
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 24 Apr 2014 03:31:30 +0000 (03:31 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 24 Apr 2014 03:31:30 +0000 (03:31 +0000)
commit8123307f4813d1099997914c1c8239e3fdca14c1
treef4faa7a8299af063947a6b640f4acb4e2977e628
parentde005042003ab70a461584e03d2f7afe665deddb
[iOS WK2] Make -webkit-overflow-scrolling:touch work
https://bugs.webkit.org/show_bug.cgi?id=132097

Reviewed by Tim Horton.

Scrolling of UIScrollViews in content (for -webkit-overflow-scrolling:touch)
depends on them getting hit-tested correctly. UIKit hit testing assumes
that subviews are enclosed by their ancestors, but this is not true of
web content. In addition, we had a root layer that was zero sized.

Fix by overriding hitTest:withEvent: on our content WKViews to hit
test subviews even if they are not enclosed.

* UIProcess/ios/RemoteLayerTreeHostIOS.mm:
(-[UIView _recursiveFindDescendantViewAtPoint:withEvent:]):
(-[UIView _findDescendantViewAtPoint:withEvent:]):
(-[WKCompositingView hitTest:withEvent:]):
(-[WKTransformView hitTest:withEvent:]):
(-[WKRemoteView hitTest:withEvent:]):
(WebKit::RemoteLayerTreeHost::createLayer):
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::updatePreferences):
Update debug borders on the root layer.
(WebKit::RemoteLayerTreeDrawingArea::mainFrameContentSizeChanged):
Size the root layer to the contents size. This isn't strictly necessary
given the hit testing overrides, but seems sensible to do anyway.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@167740 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/ios/RemoteLayerTreeHostIOS.mm
Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm