Bug 227387

Summary: Webkit Fullscreen API does not prevent dismiss gesture on Mobile Safari if user is scrolling or website is handling pinch
Product: WebKit Reporter: James Campbell <james.campbell>
Component: New BugsAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: jer.noble, jespertheend, peng.liu6, simon.fraser, thorton, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Safari 14   
Hardware: iPhone / iPad   
OS: Unspecified   
Attachments:
Description Flags
Example of scrolling issue none

Description James Campbell 2021-06-25 01:41:12 PDT
Created attachment 432246 [details]
Example of scrolling issue

We develop a Web PDF Viewer SDK which our customers integrate into their web apps. Some of our customers use the webkitRequestFullscreen API to present this viewer fullscreen as they want to focus on the content without any chrome from Mobile Safari.

Unfortunately there appears to be a bug in iOS 14 when the user scrolls though the document then iOS can prematurely dismiss the fullscreen mode. Scrolling down seems to account for the fact the user is scrolling through the fullscreen content but scrolling up seem to have issue with not always waiting until user has reached top of scrollable content.

In addition to that our SDK allows the user to pinch to zoom into the PDF Document but unfortunately this will always end up with the fullscreen mode being dismissed.

The expected behaviour for me would be for Mobile Safari to wait until the user has reached the end of the scroll chain before a pan gesture causes the fullscreen to dismiss just as the Modal dialogs in iOS would.

As well as a way for the Website to hint that it needs to handle the touches for a gesture (i.e by calling preventDefault). Since iOS presents a close button this shouldn't prevent user from closing.

Here is a Codesandbox which recreates the issue:

Sandbox: https://codesandbox.io/s/fullscreen-dismiss-bug-vws32
Preview: https://vws32.sse.codesandbox.io/
Comment 1 James Campbell 2021-06-25 01:44:30 PDT
I can also confirm this still happens in Mobile Safari 15
Comment 2 Radar WebKit Bug Importer 2021-07-02 01:42:17 PDT
<rdar://problem/80071890>