embedded web view (WKWebView? UIWebView?) reports incorrect window.innerHeight on load

Originator:itsbusticated
Number:rdar://24043930 Date Originated:04-Jan-2016 11:18 AM
Status:Open Resolved:
Product:iOS Product Version:9.2
Classification:Severe Bug Reproducible:Always
 
Summary:
window.innerHeight reports an inaccurate value on page load when queried within a custom in-app browser - for example, Twitter for iOS (v6.43.1) and Facebook for iOS (v45.0).

Steps to Reproduce:
1. on the window's "load" event, query and log window.innerHeight
2. sometime after, re-query window.innerHeight

Expected Results:
window.innerHeight is accurate, does not change after "load" event

Actual Results:
window.innerHeight is inaccurate when "load" event fires, is accurate sometime after

Version:
iOS 9.2

Notes:
alternately, you can:

1. host the attached html file on a publicly accessible web server
2. share a link to said html file on twitter or facebook
3. view the shared link within twitter or facebook for iOS

tapping the "Calculate Dimensions" re-runs the viewport measurements. you'll see that on load "innerHeight" uses one value, then when dimensions are recalculated it uses another. the later value is accurate.

Configuration:
iPhone 6s

Attachments:
'viewport.html' was successfully uploaded.

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!