Bug 182709 - Elements placed using position: fixed are misplaced when contentInsets are manually set in WKWebView
Summary: Elements placed using position: fixed are misplaced when contentInsets are ma...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Scrolling (show other bugs)
Version: Safari 11
Hardware: iPhone / iPad iOS 11
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-02-12 15:03 PST by Zach Waugh
Modified: 2019-06-16 21:11 PDT (History)
3 users (show)

See Also:


Attachments
Sample Project (48.63 KB, application/zip)
2018-02-12 15:03 PST, Zach Waugh
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Zach Waugh 2018-02-12 15:03:52 PST
Created attachment 333634 [details]
Sample Project

When a WKWebView is configured with `webView.scrollView.contentInsetAdjustmentBehavior = .never`, DOM elements using `position: fixed` are misplaced. This occurs even though the correct contentInset has been manually applied. When `webView.scrollView.contentInsetAdjustmentBehavior = .automatic` (or not changed), it works correctly. This applies when the web view sits beneath the nav/tab bars. It works correctly if the web view does not underlay nav/tab bars in either configuration.

I've attached a sample project that demonstrates the bug. It is also available on GitHub - https://github.com/zachwaugh/wkwebview-bugs/tree/master/PositionFixedContentInset