WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
273598
VisionOS JS screen size API returns inconsistent values
https://bugs.webkit.org/show_bug.cgi?id=273598
Summary
VisionOS JS screen size API returns inconsistent values
odinman08
Reported
2024-05-01 17:39:55 PDT
Created
attachment 471245
[details]
Shows Safari JS api sending 1306px × 735px screen size using
https://whatismyviewport.com
I checked viewport size and screen size in Safari native VisionOS. On one try the screen size was 1306px × 735px. Looking at my site's analytics I could see that screen size for Intel Mac user agent started appearing Feb 2 when Apple Vision Pro launched. When I reopened safari later the page reported 960px x 540px. What should the expected resolution for screen size be on a device with not much of a logical "screen." Selfishly I'd like it to be something unique to have a way to track growth of Apple Vision Pro users to make web product decisions around
Attachments
Shows Safari JS api sending 1306px × 735px screen size
(102.23 KB, image/jpeg)
2024-05-01 17:39 PDT
,
odinman08
no flags
Details
safari showing JS api for other screen size.
(245.72 KB, image/jpeg)
2024-05-01 17:43 PDT
,
odinman08
no flags
Details
View All
Add attachment
proposed patch, testcase, etc.
odinman08
Comment 1
2024-05-01 17:41:10 PDT
Oh, I guess I can't send the other screenshot showing it at the other resolution.
odinman08
Comment 2
2024-05-01 17:43:30 PDT
Created
attachment 471246
[details]
safari showing JS api for other screen size.
Alexey Proskuryakov
Comment 3
2024-05-06 12:59:50 PDT
Windows can be resized by the user, so I'm not sure if this is a valid expectation. Even though there is no direct connection between visible window size and pixel dimensions, page rendering will change with the latter.
odinman08
Comment 4
2024-05-06 13:12:56 PDT
Alexey, Viewport width and height changes as a user adjusts their window size. I was not reporting an issue with Viewport API. That works as expected. As I change the window size in visionOS Safari, I see the API update values accordingly. The screen width and height of a device normally doesn't change unless maybe the user changes the rendered resolution in system settings, right? It's odd enough that the API would report 1306px × 735px as a screen size for a device that has screens the resolution of 4K TVs,let alone the fact that I'd be able to make the Safari window (and therefore the viewport) larger than the available screen size. Then even odder coming back to the Safari later would have it report out 960px x 540px. I don't know if there's some technical explanation I don't understand for how Apple Vision Pro is rendering everything in view or if it's just intentionally set this way.
Radar WebKit Bug Importer
Comment 5
2024-05-08 17:40:15 PDT
<
rdar://problem/127776912
>
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