WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
221279
[iOS] window.screen.{width, height} are incorrect on iPhone 12 in WKWebView
https://bugs.webkit.org/show_bug.cgi?id=221279
Summary
[iOS] window.screen.{width, height} are incorrect on iPhone 12 in WKWebView
Ali Juma
Reported
2021-02-02 12:09:38 PST
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
Attachments
Test case from crbug.com/1172787
(475 bytes, text/html)
2021-02-02 12:09 PST
,
Ali Juma
no flags
Details
screenshot WebKit ToT
(299.57 KB, image/jpeg)
2021-05-13 10:56 PDT
,
zalan
no flags
Details
View All
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2021-02-09 12:10:12 PST
<
rdar://problem/74152923
>
zalan
Comment 2
2021-05-13 10:56:27 PDT
Created
attachment 428532
[details]
screenshot WebKit ToT I am seeing 375x812 on trunk WebKit.
zalan
Comment 3
2021-05-13 10:56:47 PDT
(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.
kirill.kandalov
Comment 4
2021-05-25 06:55:17 PDT
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)?
Tim Horton
Comment 5
2021-05-25 10:51:52 PDT
<
rdar://78465520
>
Ali Juma
Comment 6
2021-05-26 05:26:30 PDT
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.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug