Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: f8605b5f37ee3836b29ce2329b5f14e6febc0e43
      
https://github.com/WebKit/WebKit/commit/f8605b5f37ee3836b29ce2329b5f14e6febc0e43
  Author: Wenson Hsieh <[email protected]>
  Date:   2025-07-19 (Sat, 19 Jul 2025)

  Changed paths:
    M Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm
    M Source/WebKit/UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm
    M Source/WebKit/UIProcess/mac/WKFullScreenWindowController.mm

  Log Message:
  -----------
  [iPadOS] [Liquid Glass] bsky.app: scroll pocket may get hidden indefinitely 
after failed element fullscreen presentation
https://bugs.webkit.org/show_bug.cgi?id=296219
rdar://155245241

Reviewed by Aditya Keerthi and Abrar Rahman Protyasha.

On iPadOS, it's possible to get into a state where the top scroll pocket is 
indefinitely suppressed
when attempting to play videos on the home feed in bsky.app. This happens 
because the web view gets
permanently stuck in a state where the fullscreen presentation state is 
`.entering` and only
`FullscreenClient::willEnterFullscreen` is called (not `didEnterFullscreen`, 
`willExitFullscreen` or
`didExitFullscreen`) and the fullscreen view controller never gets a chance to 
present (tracked in
rdar://139744548). This can be induced by immediately removing the fullscreen 
element from the
DOM immediately after requesting fullscreen presentation, e.g.:

```
playButton.addEventListener("click", async () => {
    // `container` is the fullscreen element container.
    // `video` is a video element inside the container.
    if (!document.webkitIsFullScreen && container.webkitRequestFullscreen)
        container.webkitRequestFullscreen({ navigationUI: "hide" })
    video.play();
    await new Promise(requestAnimationFrame);
    container.remove();
});
```

...which causes us to call `-_exitFullscreenImmediately` which dismisses the 
view controller without
calling into the corresponding UI delegate methods or updating the fullscreen 
state. To fix this
bug, we add logic to un-hide the scroll pocket in this "immediate exit" 
codepath.

* Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm:
(descriptionForReason):
(-[WKWebView _addReasonToHideTopScrollPocket:]):
(-[WKWebView _removeReasonToHideTopScrollPocket:]):

Also add release logs to make it easier to triage similar issues in the future, 
where the scroll
pocket is stuck in a hidden state.

* Source/WebKit/UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
(-[WKFullScreenWindowController _exitFullscreenImmediately]):
* Source/WebKit/UIProcess/mac/WKFullScreenWindowController.mm:
(-[WKFullScreenWindowController exitFullScreenImmediately]):

Call through to `-_removeReasonToHideTopScrollPocket:` when exiting fullscreen 
immediately.

Canonical link: https://commits.webkit.org/297642@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to