Created attachment 419046 [details] Test case from crbug.com/1172787 On iPhone 12 on iOS 14.4, window.screen.{width, height} is incorrect in non-Safari WKWebView, but correct in Safari. Specifically, in WKWebView (tested in Chrome, Edge, and Firefox on iOS): window.screen.width is 375 and window.screen.height is 812 But in Safari: window.screen.width is 390 and window.screen.height is 844 This bug was originally reported at https://crbug.com/1172787
<rdar://problem/74152923>
Created attachment 428532 [details] screenshot WebKit ToT I am seeing 375x812 on trunk WebKit.
(In reply to zalan from comment #2) > Created attachment 428532 [details] > screenshot WebKit ToT > > I am seeing 375x812 on trunk WebKit. In Safari that is.
Do you check with "Zoom" feature on or off? As it affects the values that you'll see. Check this article that states when each resolutions should appear: https://hacknicity.medium.com/how-ios-apps-adapt-to-the-various-iphone-12-screen-sizes-e45c021e1b8b "Standard Zoom Unlike the iPhone 12 mini, the iPhone 12 and 12 Pro introduce a completely new resolution of 390×844 points at their native resolution" And "Apps built with Xcode 12.0 or earlier will see a zoomed up iPhone 11 Pro resolution of 375×812 when run on the iPhone 12 or 12 Pro at its native resolution" BTW all the internet is full of claiming that iOS window should be 390x844. E.g. https://yesviz.com/devices/iphone-12/ https://useyourloaf.com/blog/iphone-12-screen-sizes/ Back to the bug, is the wrong resolution in non-Safari WKWebView due to compilation with old XCode or for other reason (i.e. bug)?
<rdar://78465520>
I re-tested on the currently shipping versions of Chrome, Firefox, and Edge on iOS, and they all now show the same result as Safari on iOS 14.5 (390x844). For Chrome at least, this seems to have been fixed by building with Xcode 12.1+ rather than Xcode 12.0. I think the only thing remaining to figure out here is Comment 2, that is, why trunk WebKit is reporting 375x812 rather than 390x844.