WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
182710
WKWebView window.scrollTo() scrolls to wrong position depending on contentInsetAdjustmentBehavior setting
https://bugs.webkit.org/show_bug.cgi?id=182710
Summary
WKWebView window.scrollTo() scrolls to wrong position depending on contentIns...
Zach Waugh
Reported
2018-02-12 15:10:53 PST
Created
attachment 333635
[details]
Sample project When a WKWebView on iOS 11 uses the default `contentInsetAdjustmentBehavior`, then calls to `window.scrollTo()` don't work correctly. Specifically, `window.scrollTo(0, 0)` will not scroll all the way to the top, leaving content sitting beneath the nav bar. When `contentInsetAdjustmentBehavior = .never` and the content insets are manually set, `window.scrollTo(0, 0)` scrolls to the correct place. In both cases, the actual contentInset is correct, just depends on the adjustment behavior. I've attached a sample project that reproduces, and is also on GitHub -
https://github.com/zachwaugh/wkwebview-bugs/tree/master/ScrollToContentInset
Attachments
Sample project
(40.21 KB, application/zip)
2018-02-12 15:10 PST
,
Zach Waugh
no flags
Details
View All
Add attachment
proposed patch, testcase, etc.
Simon Fraser (smfr)
Comment 1
2018-06-05 13:56:20 PDT
Wenson, is this the thing you fixed?
Wenson Hsieh
Comment 2
2018-06-05 14:01:36 PDT
At a glance, this bug seems more related to how we handle contentInsetAdjustmentBehavior when content insets are specified; the bug I fixed was about how content insets were being conflated with obscuring insets. It's possible that the other content inset bug has an impact here, though.
Zach Waugh
Comment 3
2018-06-06 09:42:19 PDT
I retested this bug using my test project with some different results now. The original bug I described exists in iOS 11.2 and earlier. It appears to have been fixed in iOS 11.3 and 11.4. In iOS 12 beta 1, it is broken again, but in the opposite way of the original bug, it works correctly for `contentInsetAdjustmentBehavior = .automatic` and fails for `contentInsetAdjustmentBehavior = .never`. I updated my sample project and readme on GitHub (
https://github.com/zachwaugh/wkwebview-bugs/tree/master/ScrollToContentInset
) with this info.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug