[webkit-changes] [WebKit/WebKit] 0aa6c9: window.open from an iframe doesn't exit fullscreen...

Aditya Keerthi noreply at github.com
Sat Apr 22 15:41:43 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 0aa6c9026a5343e363e2375b5a14178132678913
      https://github.com/WebKit/WebKit/commit/0aa6c9026a5343e363e2375b5a14178132678913
  Author: Aditya Keerthi <akeerthi at apple.com>
  Date:   2023-04-22 (Sat, 22 Apr 2023)

  Changed paths:
    A LayoutTests/fullscreen/enter-fullscreen-main-frame-window-open-iframe-expected.txt
    A LayoutTests/fullscreen/enter-fullscreen-main-frame-window-open-iframe.html
    A LayoutTests/fullscreen/resources/window-open-iframe.html
    M LayoutTests/platform/mac-wk1/TestExpectations
    M Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp

  Log Message:
  -----------
  window.open from an iframe doesn't exit fullscreen for parent document
https://bugs.webkit.org/show_bug.cgi?id=255813
rdar://108387151

Reviewed by Tim Nguyen.

Currently, invoking `window.open` from an `iframe` that has a parent document
is fullscreen does not exit fullscreen, while invoking `window.open` from
the main frame does.

On macOS, the user is taken to a new tab, which is made visible, while the
fullscreen content remains in its own space. On iOS, the user is taken to a new
tab, but the existing content remains in fullscreen, leaving the user unaware
of what has happened.

WebKit's existing behavior in this scenario on macOS differs from both Chrome
and Firefox, which completely exit fullscreen regardless of which frame invoked
`window.open`. Additionally, the iOS behavior is confusing, as the user will
suddenly viewing another page after they decide to exit fullscreen.

To fix, ensure any successful call to `window.open` always exits fullscreen.

* LayoutTests/fullscreen/enter-fullscreen-main-frame-window-open-iframe-expected.txt: Added.
* LayoutTests/fullscreen/enter-fullscreen-main-frame-window-open-iframe.html: Added.
* LayoutTests/fullscreen/resources/window-open-iframe.html: Added.
* LayoutTests/platform/mac-wk1/TestExpectations:

Skip test on WK1, similar to another "exit fullscreen from iframe" test.

* Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::createWindow):

Call `FullscreenManager::cancelFullscreen` unconditionally, rather than checking
if the frame's document has a fullscreen element, which would be false if the
fullscreen element is in another document.

`cancelFullscreen` already accounts for the top document, and is a no-op if there
is no fullscreen element in any document.

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




More information about the webkit-changes mailing list