-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cherry-pick 3d721c0. rdar://problem/111534888
REGRESSION (UI-side compositing): Jumpy full screen transition animation https://bugs.webkit.org/show_bug.cgi?id=259375 rdar://111534888 Reviewed by Wenson Hsieh. With UI-side compositing, when entering or exiting window fullscreen mode, the transition is sometimes jumpy. This happens in cases where the UI process resizes before the web content has a chance to resize. The web content and the UI Process should always resize in the same CA commit. Fix by adopting an AppKit SPI to defer entering or exiting window fullscreen mode until the web content has actually been resized to the new size. This is done by using a "window snapshot readiness handler". * Source/WTF/wtf/PlatformHave.h: Add a new `HAVE` definition to only enable this on macOS, and only on versions where the SPI exists. * Source/WebKit/Platform/spi/mac/AppKitSPI.h: * Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView dealloc]): (-[WKWebView _invalidateWindowSnapshotReadinessHandler]): Invokes the readiness handler and then resets it, indicating to AppKit that the full screen should be allowed to resume. * Source/WebKit/UIProcess/API/Cocoa/WKWebViewInternal.h: * Source/WebKit/UIProcess/API/mac/WKView.mm: (-[WKView _web_windowWillEnterFullScreen]): (-[WKView _web_windowWillExitFullScreen]): Stub methods required to compile legacy WebKit. * Source/WebKit/UIProcess/API/mac/WKWebViewMac.mm: (-[WKWebView _doWindowSnapshotReadinessUpdate]): (-[WKWebView setFrameSize:]): When `setFrameSize` gets called with the new frame size, the UI process waits for the next presentation update of the web prcoess. Once in the completion handler, we know that the web content has properly resized, and so we should now invalidate the readiness handler. (-[WKWebView _web_windowWillEnterFullScreen]): (-[WKWebView _web_windowWillExitFullScreen]): Upon receiving one of these notifications, we take out a window snapshot readiness handler and store it. This tells AppKit to defer the final stage of the enter and exit full screen animations until the handler is invoked. * Source/WebKit/UIProcess/mac/WKViewLayoutStrategy.h: * Source/WebKit/UIProcess/mac/WKViewLayoutStrategy.mm: (-[WKViewLayoutStrategy disableFrameSizeUpdates]): (-[WKViewLayoutStrategy enableFrameSizeUpdates]): (-[WKViewLayoutStrategy frameSizeUpdatesDisabled]): (-[WKViewLayoutStrategy didChangeFrameSize]): In some cases, `setFrameSize` would early return inside of `didChangeFrameSize` due to these set of methods. This caused the bug to still reproduce, since the new drawing area size was no longer being set. These methods have long been not actually needed, so their implementations are now removed and there is no longer a need for an early return. * Source/WebKit/UIProcess/mac/WebViewImpl.h: * Source/WebKit/UIProcess/mac/WebViewImpl.mm: (-[WKWindowVisibilityObserver startObserving:]): (-[WKWindowVisibilityObserver stopObserving:]): (-[WKWindowVisibilityObserver _windowWillEnterFullScreen:]): (-[WKWindowVisibilityObserver _windowWillExitFullScreen:]): (WebKit::WebViewImpl::windowWillEnterFullScreen): (WebKit::WebViewImpl::windowWillExitFullScreen): When entering or exiting full screen, we now listen to their respective notifications. Canonical link: https://commits.webkit.org/266273@main
- Loading branch information
Showing
10 changed files
with
111 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters