Weird status bar gap for WKWebView

Originator:darryl
Number:rdar://32599304 Date Originated:2017-06-06
Status:Closed Resolved:
Product:iOS Product Version:11
Classification:WebKit Reproducible:Always
 
Area:
WebKit

Summary:
On iOS 11, a full-sized WKWebView is pushed down by the height of the status bar.  The `viewport-fit=cover` workaround for this is not documented, and a change from the default behaviour from previous iOS versions.

Steps to Reproduce:
Create an app with a full-sized WKWebView as its main view.

Expected Results:
The web view should fill the full screen, including behind the status bar.

Observed Results:
The web view is pushed down by the height of the status bar. In particular, content scrolls behind the status bar when scrolling the page, but fixed position elements do not.

Version:
iOS 11 beta 1 (15A5278f)

Notes:
This is viewable in a sample app: https://github.com/dpogue/WKScrollTest/tree/visual-viewport
Edit ViewController.swift and change VIEWPORT to "auto".

Configuration:
There is an undocumented workaround to restore the old behaviour via `viewport-fit=cover` in the meta viewport tag.

Comments

With iOS 11 beta 2, the viewport-fit=cover change no longer has any effect and there is always a gap at the top of the page behind the status bar.

Fixed in beta 4 by restoring the viewport-fit=cover behaviour


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!