Bug 264215

Summary: Prevent requestFullscreen() from closing when touch events are preventDefault'ed
Product: WebKit Reporter: Jesper van den Ende <jespertheend>
Component: UI EventsAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: alex, andj2223, augus.dupin, eric.carlson, jer.noble, jespertheend, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Safari Technology Preview   
Hardware: iPhone / iPad   
OS: iOS 17   
Attachments:
Description Flags
screen recording none

Description Jesper van den Ende 2023-11-04 13:53:48 PDT
Created attachment 468487 [details]
screen recording

To reproduce:
1. Visit https://requestfullscreen-touch-preventdefault.glitch.me on iOS
2. Click the 'Enter Full Screen' button
3. Touch the red square and drag down.

Expected behaviour:
Full screen is not closed

Actual behaviour:
Full screen is closed, despite the fact that the events on the red square calls `event.preventDefault()` and has the `touch-action: none;` css style applied.
Comment 1 Jer Noble 2023-11-06 16:56:43 PST
It sounds like the behavior you're reproducing here is that `preventDefault()` doesn't block the "drag to dismiss" behavior which allows users to exit fullscreen mode. This is intentional, and is a anti-phishing / security feature. 

The site cannot block the user from exiting fullscreen, either via drag-to-dismiss, the `esc` key, or the persistent close button.
Comment 2 Alex Moore 2023-11-07 05:46:33 PST
@Jer Noble: 

Safari/Webkit's implementation of the Fullscreen API ensures that its primary use case, i.e. games, is effectively unusable. 

Most mobile web games require swipe actions of some kind, and both native iOS games and web games on Android fully support this functionality.

Webkit needs a solution to the security issues that still enables developers to build games.
Comment 3 Radar WebKit Bug Importer 2023-11-11 12:54:18 PST
<rdar://problem/118278675>
Comment 4 andj2223 2023-11-13 17:26:28 PST
drag-to-dismiss makes many forms of non-game applications effectively unusable in full screen as well:
Drawing apps that use dragging gestures to make pen/brush strokes
3d viewing applications that use dragging gestures to navigate the camera / viewpoint
Map applications that use dragging gestures to move the map
Etc.

I sincerely hope that this is rectified before the release of iOS 17.2.