Bug 264215 - Prevent requestFullscreen() from closing when touch events are preventDefault'ed
Summary: Prevent requestFullscreen() from closing when touch events are preventDefault'ed
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: UI Events (show other bugs)
Version: Safari Technology Preview
Hardware: iPhone / iPad iOS 17
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-11-04 13:53 PDT by Jesper van den Ende
Modified: 2023-11-13 17:26 PST (History)
7 users (show)

See Also:


Attachments
screen recording (15.65 MB, video/mp4)
2023-11-04 13:53 PDT, Jesper van den Ende
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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.