Bug 182709

Summary: Elements placed using position: fixed are misplaced when contentInsets are manually set in WKWebView
Product: WebKit Reporter: Zach Waugh <zwaugh>
Component: ScrollingAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: simon.fraser, thorton, wenson_hsieh
Priority: P2    
Version: Safari 11   
Hardware: iPhone / iPad   
OS: iOS 11   
Attachments:
Description Flags
Sample Project none

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