[webkit-changes] [WebKit/WebKit] 43da1f: WebKit Media: Toggling fullscreen fails to work

Richard Robinson noreply at github.com
Thu Aug 3 16:37:41 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 43da1fd1587ab9c839f236204f090b0034ae9fc2
      https://github.com/WebKit/WebKit/commit/43da1fd1587ab9c839f236204f090b0034ae9fc2
  Author: Richard Robinson <richard_robinson2 at apple.com>
  Date:   2023-08-03 (Thu, 03 Aug 2023)

  Changed paths:
    M Source/WebKit/UIProcess/API/mac/WKView.mm
    M Source/WebKit/UIProcess/API/mac/WKWebViewMac.mm
    M Source/WebKit/UIProcess/mac/WebViewImpl.h
    M Source/WebKit/UIProcess/mac/WebViewImpl.mm

  Log Message:
  -----------
  WebKit Media: Toggling fullscreen fails to work
https://bugs.webkit.org/show_bug.cgi?id=259760
rdar://111534888

Reviewed by Aditya Keerthi.

The window resize handler is created when receiving the `will{Enter|Exit}FullScreen` notification,
and is then invalidated as a result of `setFrameSize` being called. However, when transiting to/from
element full screen, `setFrameSize` is called before the notification is posted, instead of after.
This causes the handler to never be invalidated.

Fix by creating the handler directly inside `setFrameSize`, and not rely on the full screen
notifications at all. This is ok since `_holdResizeSnapshotWithReason` only returns a non-nil block
when entering or exiting full screen, so it has no effect in other cases.

No new tests, since all tests in `FullscreenVideoTextRecognition` already test this behavior in some
configurations.

* Source/WebKit/UIProcess/API/mac/WKView.mm:
(-[WKView _web_windowWillEnterFullScreen]): Deleted.
(-[WKView _web_windowWillExitFullScreen]): Deleted.
* Source/WebKit/UIProcess/API/mac/WKWebViewMac.mm:
(-[WKWebView _holdWindowResizeSnapshotWithReason:]):
(-[WKWebView setFrameSize:]):
(-[WKWebView _web_windowWillEnterFullScreen]): Deleted.
(-[WKWebView _web_windowWillExitFullScreen]): Deleted.
* Source/WebKit/UIProcess/mac/WebViewImpl.h:
* Source/WebKit/UIProcess/mac/WebViewImpl.mm:
(-[WKWindowVisibilityObserver startObserving:]):
(-[WKWindowVisibilityObserver stopObserving:]):
(-[WKWindowVisibilityObserver _windowWillEnterFullScreen:]): Deleted.
(-[WKWindowVisibilityObserver _windowWillExitFullScreen:]): Deleted.
(WebKit::WebViewImpl::windowWillEnterFullScreen): Deleted.
(WebKit::WebViewImpl::windowWillExitFullScreen): Deleted.

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




More information about the webkit-changes mailing list