From 76239d6da4e0176bccf1b5124084af0aeca89fcc Mon Sep 17 00:00:00 2001 From: Tim Horton Date: Thu, 2 Mar 2023 00:22:01 -0800 Subject: [PATCH] Fullscreen UIScene adjustments are not reverted if the Web Content process crashes while in fullscreen https://bugs.webkit.org/show_bug.cgi?id=253216 rdar://106107254 Reviewed by Aditya Keerthi. * Source/WebKit/UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm: (-[WKFullScreenWindowController _exitFullscreenImmediately]): Perform the fullscreen transition without animation if exiting fullscreen "immediately", which happens in cases such as Web Content process crash or WKWebView unparenting. This ensures that all of the scene/window cleanup work happens even if we don't go through the usual animated dismissal path. Canonical link: https://commits.webkit.org/261051@main --- .../ios/fullscreen/WKFullScreenWindowControllerIOS.mm | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Source/WebKit/UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm b/Source/WebKit/UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm index 43a2df6fee33..1b6c527b63cd 100644 --- a/Source/WebKit/UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm +++ b/Source/WebKit/UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm @@ -1082,6 +1082,13 @@ - (void)_exitFullscreenImmediately if (page) page->setSuppressVisibilityUpdates(true); +#if ENABLE(FULLSCREEN_WINDOW_EFFECTS) + [UIView performWithoutAnimation:^{ + CompletionHandler completionHandler = []() { }; + performFullscreenTransition(_lastKnownParentWindow.get(), _window.get(), _parentWindowState.get(), false, WTFMove(completionHandler)); + }]; +#endif + [self _reinsertWebViewUnderPlaceholder]; if (auto* manager = self._manager) {