[webkit-changes] [WebKit/WebKit] 969632: Properly resolve fullscreen API promises
Tim Nguyen
noreply at github.com
Fri Dec 9 20:04:05 PST 2022
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 9696329f7af6ec156b6f45ae41d811da8fa0eeee
https://github.com/WebKit/WebKit/commit/9696329f7af6ec156b6f45ae41d811da8fa0eeee
Author: Tim Nguyen <ntim at apple.com>
Date: 2022-12-09 (Fri, 09 Dec 2022)
Changed paths:
R LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/css/selectors/modal-pseudo-class-expected.txt
R LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/fullscreen/api/document-exit-fullscreen-nested-shadow-dom-expected.txt
R LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/fullscreen/api/element-request-fullscreen-same-element-expected.txt
M Source/WebCore/dom/DocumentFullscreen.cpp
M Source/WebCore/dom/DocumentFullscreen.h
M Source/WebCore/dom/FullscreenManager.cpp
M Source/WebCore/dom/FullscreenManager.h
M Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentGtk.cpp
Log Message:
-----------
Properly resolve fullscreen API promises
https://bugs.webkit.org/show_bug.cgi?id=248879
rdar://103074395
Reviewed by Chris Dumez.
- exitFullscreen() promises should resolve in FullscreenManager::finishExitFullscreen().
- requestFullscreen() promises should resolve in FullscreenManager::willEnterFullscreen().
Store a pendingPromise field for async operations, and ensure there's only one promise at once, by rejecting the previous operation if it is still pending
(meaning the previous operation failed, since it is overriden by the new one).
We resolve this pending promise at the same time as emitting the fullscreen change/error events.
Removed mac-wk1 baselines that were due to this bug.
* LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/css/selectors/modal-pseudo-class-expected.txt: Removed.
* LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/fullscreen/api/document-exit-fullscreen-nested-shadow-dom-expected.txt: Removed.
* LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/fullscreen/api/element-request-fullscreen-same-element-expected.txt: Removed.
* Source/WebCore/dom/DocumentFullscreen.cpp:
(WebCore::DocumentFullscreen::exitFullscreen):
(WebCore::DocumentFullscreen::webkitExitFullscreen):
* Source/WebCore/dom/DocumentFullscreen.h:
(WebCore::DocumentFullscreen::webkitExitFullscreen): Deleted.
* Source/WebCore/dom/FullscreenManager.cpp:
(WebCore::FullscreenManager::requestFullscreenForElement):
(WebCore::FullscreenManager::exitFullscreen):
(WebCore::FullscreenManager::willEnterFullscreen):
(WebCore::FullscreenManager::didExitFullscreen): Since 257456 at main, cancelFullscreen now shares codepath with exitFullscreen, making the exitingDocument variable not needed.
(WebCore::FullscreenManager::notifyAboutFullscreenChangeOrError):
(WebCore::FullscreenManager::exitRemovedFullscreenElementIfNeeded):
(WebCore::FullscreenManager::clear):
(WebCore::FullscreenManager::dispatchFullscreenChangeEvents): Deleted.
* Source/WebCore/dom/FullscreenManager.h:
* Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentGtk.cpp:
(webkit_dom_document_webkit_exit_fullscreen):
Canonical link: https://commits.webkit.org/257668@main
More information about the webkit-changes
mailing list