To reproduce: - Make a WKWebView - Set the WKWebView's scrollView's contentInset to something like UIEdgeInsetsMake(500, 0, 0, 0) - Load a page with clickable elements, such as links or buttons - Scroll so that the links or buttons are in view - Try to tap on them Expected: elements should be clicked Observed: elements are not clicked Tested on latest iOS 11.3 beta.
WKWebView conflates obscured insets (which cover parts of the viewport) with content insets (which allow scrolling beyond content bounds in a scroll view). This manifests in incorrect behavior when computing the unobscured content rect if the web view's scrollview has a top content inset, since we'll think that there's a region as tall as the content inset that obscures the viewport, when in fact, the viewport isn't obscured. This causes all hit-testing in this region to fail because FrameView::visibleContentRect is wrong.
It appears this bug has existed since the early days of WebKit2 (see: <http://trac.webkit.org/changeset/170361>). It also seems others have also run into this before: https://stackoverflow.com/questions/27755251/wkwebview-isnt-clickable-outside-its-contentinset
<rdar://problem/38421894>
Created attachment 335827 [details] Patch
Comment on attachment 335827 [details] Patch Thanks for the review!
Comment on attachment 335827 [details] Patch Clearing flags on attachment: 335827 Committed r229641: <https://trac.webkit.org/changeset/229641>
All reviewed patches have been landed. Closing bug.
ππΌππΌππΌ
*** Bug 153439 has been marked as a duplicate of this bug. ***