Bug 272136 - Pointer Lock API does not work when Fullscreen API is enabled
Summary: Pointer Lock API does not work when Fullscreen API is enabled
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: Safari Technology Preview
Hardware: Mac (Apple Silicon) macOS 14
: P2 Major
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2024-04-03 20:47 PDT by Jeffrey Blanz
Modified: 2024-06-06 10:47 PDT (History)
8 users (show)

See Also:


Attachments
Video of the Bug (235.37 MB, video/quicktime)
2024-04-04 15:23 PDT, Jeffrey Blanz
no flags Details
Test case for the ponter lock with full screen API (1.31 KB, text/html)
2024-05-02 15:59 PDT, Byungseon(Sun) Shin
no flags Details
Pointer Lock Test after Full Screen Mode (1.87 KB, text/html)
2024-05-08 13:41 PDT, Byungseon(Sun) Shin
no flags Details
Screen recording on Safari 17.1 (non-repo) (76.70 MB, video/quicktime)
2024-06-06 10:43 PDT, Byungseon(Sun) Shin
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jeffrey Blanz 2024-04-03 20:47:49 PDT
Pointer Lock API does not work when Fullscreen API is enabled. You can see this in PWA apps that have been added to the dock from safari or normal safari web applications. 

Games use both fullscreen and pointer lock to function. Not having both at the same time is an issue. You can try this with geforce now and Xbox cloud gaming on safari, without a PWA installation:


1. Disable fullscreen API in the feature flags.

2. Go to https://play.geforcenow.com/mall/ and play a game like Fortnite.

- You will see you can use the mouse to click on the game UI and even look around when playing.

3. Re-enable the Fullscreen API in feature flags. Then quit and re open safari to make sure the changes apply.

4. Next go to https://www.xbox.com/en-us/play and play Fortnite.

- You will see the mouse can no longer be used to interact with the Ul. The mouse can also not be locked to moving around when playing a match.

- Note 1: You could also test this with GeForce now in Fullscreen mode, but for some reason even with the API enabled the game does not consistently launch in Fullscreen. This is why I have you try it with Xbox cloud gaming.
- Note 2: You could also test this by adding one of the website to the dock as a PWA installation. PWA always launch in Fullscreen mode.
Comment 1 Radar WebKit Bug Importer 2024-04-04 12:51:20 PDT
<rdar://problem/125924062>
Comment 2 Abrar Rahman Protyasha 2024-04-04 13:33:46 PDT
@Jeffrey, what macOS/Safari version are you using?
Comment 3 Jeffrey Blanz 2024-04-04 14:18:57 PDT
(In reply to Abrar Rahman Protyasha from comment #2)
> @Jeffrey, what macOS/Safari version are you using?

I am using Safari Technology Preview 191. Although this happens on at least Safari 17.3 and newer as this bug is present on those versions as well.
Comment 4 Jeffrey Blanz 2024-04-04 15:23:57 PDT
Created attachment 470759 [details]
Video of the Bug

I have attached a video of the bug that shows the difference in Pointer Lock API when in fullscreen and when not in fullscreen.
Comment 5 Abrar Rahman Protyasha 2024-04-04 16:03:50 PDT
Thanks for the repro video. CC-ing broadly for comments.
Comment 6 Jeffrey Blanz 2024-04-10 17:19:31 PDT
Still happens on Safari Technology Preview 192.

I even turned on the new "Pointer Lock Options" Feature Flag.
Comment 7 Abrar Rahman Protyasha 2024-04-10 18:27:14 PDT
Yes, that's expected since no changes have been made to address this yet, thanks for checking though!

FYI, the pointer lock options feature flag was about exposing unadjusted movement values: https://developer.mozilla.org/en-US/docs/Web/API/Element/requestPointerLock#unadjustedmovement
Comment 8 Jeffrey Blanz 2024-04-10 20:59:19 PDT
Yes, just figured I would update on updates.

Good to see the unadjusted movements supported in Safari!

Hoping to potentially see it and the other pointer lock API options on iPadOS, iOS, and visionOS sometime after it’s out of testing.
Comment 9 Byungseon(Sun) Shin 2024-05-02 15:59:00 PDT
Created attachment 471262 [details]
Test case for the ponter lock with full screen API
Comment 10 Byungseon(Sun) Shin 2024-05-08 13:41:58 PDT
Created attachment 471324 [details]
Pointer Lock Test after Full Screen Mode
Comment 11 Byungseon(Sun) Shin 2024-05-08 13:43:25 PDT
Added more simplified test case for pointer lock API testing after entering the Full Screen mode. 
This works fine with webkit mini browser as well as chrome browser.
Comment 12 Jeffrey Blanz 2024-05-09 09:57:54 PDT
Adding that this bug has to be new to macOS safari 17.5 as I have a video of pointer Lock API working in fullscreen API dated February 19, 2024. At the time of the video I was running macOS developer beta 14.4 beta 3. I was using the normal safari app and not STP. Now with macOS 14.5 the bug happens in the normal safari app as well as STP.

I was using this website in the video https://app.3daimtrainer.com/play

I can attach the video of it working perfectly fine with macOS 14.4 if needed.

Safe to say this bug is from safari for macOS 14.4 developer beta 4 or newer, but I am assuming it was safari 17.5 that brought the bug from STP to normal safari.

I would have to downgrade to confirm, but this means safari 17.4 and macOS 14.4 should not have this bug. Or at least safari 17.3 or macOS 14.3 should not have this bug.
Comment 13 Byungseon(Sun) Shin 2024-06-06 10:43:16 PDT
Created attachment 471611 [details]
Screen recording on Safari 17.1 (non-repo)
Comment 14 Byungseon(Sun) Shin 2024-06-06 10:47:14 PDT
Adding screen recording on previous version of safari (17.1) and it worked well.