WKWebView top content inset for PDFs is broken on iOS 12

Originator:nickcthompson6
Number:rdar://45093716 Date Originated:2018-10-8
Status:Duplicate/44700556 Resolved:
Product:WebKit Product Version:iOS 12
Classification: Reproducible:Always
 
Area:
WebKit

Summary:
On iOS 12, when creating a UIViewController that only contains a WKWebView, PDF files do not correctly render. 

Steps to Reproduce:
Create and push a view controller which has a WKWebView constrained to the top of the superview. Load a PDF when the view loads.

Changing the web view's scrollView.contentInsetAdjustmentBehavior to .always still has the initial bug, but is usable after scrolling once. However, this messes up the expected/correct behavior on iOS 11.

Expected Results:
Top of PDF is below the navigation bar, and is completely visible. Same behavior in iOS 11 and below.
Left simulator in screenshot.

Actual Results:
Top of PDF is at the top of the superview, and doe not respect content inset margins.
Right simulator in screenshot.

Version/Build:
Xcode 10 GM, iOS 12 simulators/device (iPhone XS/iPhone 6s)

Configuration:
Exists in brand new project as well as existing project. Targeting iOS 9, so cannot use Storyboards for WKWebView.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!