Inside iframe with the 'style="display: none;"' property, all dimension properties return 0

Originator:atwhitcomb
Number:rdar://43050477 Date Originated:August 8th, 2018
Status:Open Resolved:
Product:iOS + SDK UIKit Product Version:10.3.1, 11.3, 11.4
Classification:Bug Reproducible:Always
 
Area:
UIKit

Summary:
Using UIWebView, when inside of an iframe with the 'style="display: none;" property, a call to all of screen's dimension properties (availHeight, availLeft, availTop, availWidth, height, width) will report 0.

Steps to Reproduce:
Inside an application, create a UIWebView and load up an HTML page (whether by simply referencing by file, see the attached, or doing a proxy rewrite) whose body only contains a iframe with the style property of 'style="display: none;". Inside the Safari Web Inspector, switch from inspecting the "Page" to the "about: blank". Inside the console, type "screen" and hit enter.

Expected Results:
The web inspector debugger will print out the actual screen height, width, and other properties in its object.

Actual Results:
All the dimension properties return 0, making a script that is running within the iframe unable to parse proper device metadata.

Version/Build:
iOS 10.3.1, iOS 11.3, iOS 11.4, all devices

Configuration:
N/A

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!