UIWebView safe area inset constants are not updated on rotation

Originator:darryl
Number:rdar://34518947 Date Originated:19-Sep-2017 09:41
Status:Open Resolved:
Product:iOS + SDK Product Version:iOS 11 GM
Classification:UI/Usability Reproducible:Always
 
Summary:
When rotating the device, it appears that the CSS safe-area-inset constants are not getting updated in UIWebView. They seem to be getting updated after the rotation, but not in time for them to apply to the re-drawn view.

Steps to Reproduce:
1. Load a page with `viewport-fit=cover` and `constant(safe-area-inset-top)` into a fullscreen UIWebView on iPhone X in portrait view (example HTML: https://gist.github.com/dpogue/dbfe53aaa2c8ed914c8f2d8fd8beb78a)

2. Rotate the device to landscape view.

3. Rotate the device back to portrait view.

Expected Results:
The safe area constants should be correct for the given view, and update automatically when rotation occurs.

Actual Results:
After rotating to landscape view, the safe-area-inset-top still seems to have a value of 44px.
After rotating back to portrait view, the safe-area-inset-top seems to have a value of 0px.

Version:
iOS 11 GM

Notes:
This is fixed in WKWebView, possibly by this: https://bugs.webkit.org/show_bug.cgi?id=174598 & rdar://problem/33364275

Comments

In newer versions of iOS 11, just as 11.1, 11.1.1 and 11.2 beta 1 we're finding that the values do update on rotate, but not always on initialization. For example, safe-area-inset-top is returning 0px on initial opening, and then after a rotate-left + rotate-right, it will then correctly report 44px. Other oddities exist such as the overlaid status-bar information (battery, network, ...) disappearing upon these rotations.

By rpaskowitz at Nov. 13, 2017, 6:43 p.m. (reply...)

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!