Changeset 280358 in webkit


Ignore:
Timestamp:
Jul 27, 2021 4:19:32 PM (12 months ago)
Author:
Peng Liu
Message:

Safari hangs when entering PiP from (element) fullscreen
https://bugs.webkit.org/show_bug.cgi?id=228332

Reviewed by Eric Carlson.

When a video element's ancestor element is in fullscreen and the video element
is entering picture-in-picture, WKFullScreenWindowController in the UI process
will notify the WebContent process that the ancestor element needs to exit fullscreen.
However, some sites call document.webkitExitFullscreen() to request the ancestor
element to exit fullscreen proactively. Both WebContent process and UI process will
try to do the same thing and may lead to a race condition.

That was not an issue before r274460 because WebFullScreenManager::requestExitFullScreen()
will ignore the request from the UI process if the WebContent process has already
started the steps to exit fullscreen.

This patch stops the UI process sending the exit fullscreen request if a WebContent
process has started the steps to exit fullscreen.

Manually tested.

  • UIProcess/mac/WKFullScreenWindowController.mm:

(-[WKFullScreenWindowController didEnterPictureInPicture]):

Location:
trunk/Source/WebKit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r280356 r280358  
     12021-07-27  Peng Liu  <peng.liu6@apple.com>
     2
     3        Safari hangs when entering PiP from (element) fullscreen
     4        https://bugs.webkit.org/show_bug.cgi?id=228332
     5
     6        Reviewed by Eric Carlson.
     7
     8        When a video element's ancestor element is in fullscreen and the video element
     9        is entering picture-in-picture, `WKFullScreenWindowController` in the UI process
     10        will notify the WebContent process that the ancestor element needs to exit fullscreen.
     11        However, some sites call `document.webkitExitFullscreen()` to request the ancestor
     12        element to exit fullscreen proactively. Both WebContent process and UI process will
     13        try to do the same thing and may lead to a race condition.
     14
     15        That was not an issue before r274460 because `WebFullScreenManager::requestExitFullScreen()`
     16        will ignore the request from the UI process if the WebContent process has already
     17        started the steps to exit fullscreen.
     18
     19        This patch stops the UI process sending the exit fullscreen request if a WebContent
     20        process has started the steps to exit fullscreen.
     21
     22        Manually tested.
     23
     24        * UIProcess/mac/WKFullScreenWindowController.mm:
     25        (-[WKFullScreenWindowController didEnterPictureInPicture]):
     26
    1272021-07-27  Myles C. Maxfield  <mmaxfield@apple.com>
    228
  • trunk/Source/WebKit/UIProcess/mac/WKFullScreenWindowController.mm

    r279122 r280358  
    642642- (void)didEnterPictureInPicture
    643643{
    644     [self requestExitFullScreen];
     644    if ([self isFullScreen])
     645        [self requestExitFullScreen];
    645646}
    646647
Note: See TracChangeset for help on using the changeset viewer.