Skip to content

Remove FullscreenManager::currentFullscreenElement() - #40201

Merged
webkit-commit-queue merged 1 commit into
WebKit:mainfrom
nt1m:eng/Remove-FullscreenManager-currentFullscreenElement
Feb 7, 2025
Merged

webkit-commit-queue merged 1 commit into
WebKit:mainfrom
nt1m:eng/Remove-FullscreenManager-currentFullscreenElement

Conversation

@nt1m

@nt1m nt1m commented Feb 7, 2025 •

Copy link
Copy Markdown
Member

64f1b51

Remove `FullscreenManager::currentFullscreenElement()`
https://bugs.webkit.org/show_bug.cgi?id=268232
rdar://121753573

Reviewed by Jer Noble.

It's a misleading function, especially in the case of an iframe being implicitly fullscreened by it's children. `currentFullscreenElement` will not work in that case.

m_fullscreenElement will be removed in a separate change, since it requires a bit of refactoring of the internal logic.

* Source/WebCore/css/SelectorCheckerTestFunctions.h:
(WebCore::matchesAnimatingFullscreenTransitionPseudoClass):
(WebCore::matchesInWindowFullscreenPseudoClass):
* Source/WebCore/dom/Document.cpp:
(WebCore::eventTargetElementForDocument):
* Source/WebCore/dom/DocumentFullscreen.cpp:
(WebCore::DocumentFullscreen::webkitCurrentFullScreenElement):
* Source/WebCore/dom/FullscreenManager.cpp:
(WebCore::FullscreenManager::didEnterFullscreen):
(WebCore::FullscreenManager::didExitFullscreen):
(WebCore::FullscreenManager::setAnimatingFullscreen):
* Source/WebCore/dom/FullscreenManager.h:
* Source/WebCore/html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::elementIsHidden const):
(WebCore::HTMLMediaElement::isFullscreen const):
(WebCore::HTMLMediaElement::isStandardFullscreen const):
(WebCore::HTMLMediaElement::exitFullscreen):
* Source/WebCore/html/MediaElementSession.cpp:
(WebCore::MediaElementSession::canShowControlsManager const):
(WebCore::MediaElementSession::updateMediaUsageIfChanged):
* Source/WebCore/rendering/RenderLayerCompositor.cpp:
(WebCore::isDescendantOfFullScreenLayer):
* Source/WebCore/style/UserAgentStyle.cpp:
(WebCore::Style::UserAgentStyle::ensureDefaultStyleSheetsForElement):
The UA stylesheet needs to be initialized before checking for the fullscreen element.
Previously, the earlier timing of `currentFullscreenElement()` would achieve that.
Instead, initialize the UA stylesheet as soon as we have fullscreen manager.

* Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentGtk.cpp:
(webkit_dom_document_get_webkit_current_fullscreen_element):
* Source/WebKitLegacy/mac/WebCoreSupport/WebChromeClient.mm:
(WebChromeClient::createWindow):
* Source/WebKitLegacy/mac/WebView/WebView.mm:
(-[WebView _didStartProvisionalLoadForFrame:]):

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

2a4a0ed

Misc iOS, visionOS, tvOS & watchOS macOS Linux Windows
✅ 🧪 style ✅ 🛠 ios ✅ 🛠 mac ✅ 🛠 wpe ✅ 🛠 win
✅ 🧪 bindings ✅ 🛠 ios-sim ✅ 🛠 mac-AS-debug ✅ 🧪 wpe-wk2 ✅ 🧪 win-tests
✅ 🧪 webkitperl ✅ 🧪 ios-wk2 ✅ 🧪 api-mac ✅ 🧪 api-wpe
✅ 🧪 ios-wk2-wpt ✅ 🧪 mac-wk1 ✅ 🛠 wpe-cairo
✅ 🧪 api-ios ✅ 🧪 mac-wk2 ✅ 🛠 gtk
✅ 🛠 vision   🧪 mac-AS-debug-wk2 ✅ 🧪 gtk-wk2
✅ 🛠 vision-sim ✅ 🧪 mac-wk2-stress ✅ 🧪 api-gtk
✅ 🛠 🧪 merge ✅ 🧪 vision-wk2 ✅ 🧪 mac-intel-wk2   🛠 playstation
✅ 🛠 tv   🛠 mac-safer-cpp
✅ 🛠 tv-sim
✅ 🛠 watch
✅ 🛠 watch-sim

@nt1m
nt1m requested review from a team, cdumez and rniwa as code owners February 7, 2025 09:31
@nt1m nt1m self-assigned this Feb 7, 2025
@nt1m nt1m added the CSS Cascading Style Sheets implementation label Feb 7, 2025
@nt1m
nt1m requested a review from a team February 7, 2025 09:33
@nt1m
nt1m force-pushed the eng/Remove-FullscreenManager-currentFullscreenElement branch from d31ea91 to be87351 Compare February 7, 2025 09:36
@nt1m
nt1m force-pushed the eng/Remove-FullscreenManager-currentFullscreenElement branch from be87351 to cf1852f Compare February 7, 2025 09:57
@nt1m
nt1m force-pushed the eng/Remove-FullscreenManager-currentFullscreenElement branch from cf1852f to 8082487 Compare February 7, 2025 10:32
@nt1m
nt1m force-pushed the eng/Remove-FullscreenManager-currentFullscreenElement branch from 8082487 to 2a4a0ed Compare February 7, 2025 11:02
@nt1m
nt1m requested a review from darinadler February 7, 2025 11:17
@nt1m nt1m added the merge-queue Applied to send a pull request to merge-queue label Feb 7, 2025
https://bugs.webkit.org/show_bug.cgi?id=268232
rdar://121753573

Reviewed by Jer Noble.

It's a misleading function, especially in the case of an iframe being implicitly fullscreened by it's children. `currentFullscreenElement` will not work in that case.

m_fullscreenElement will be removed in a separate change, since it requires a bit of refactoring of the internal logic.

* Source/WebCore/css/SelectorCheckerTestFunctions.h:
(WebCore::matchesAnimatingFullscreenTransitionPseudoClass):
(WebCore::matchesInWindowFullscreenPseudoClass):
* Source/WebCore/dom/Document.cpp:
(WebCore::eventTargetElementForDocument):
* Source/WebCore/dom/DocumentFullscreen.cpp:
(WebCore::DocumentFullscreen::webkitCurrentFullScreenElement):
* Source/WebCore/dom/FullscreenManager.cpp:
(WebCore::FullscreenManager::didEnterFullscreen):
(WebCore::FullscreenManager::didExitFullscreen):
(WebCore::FullscreenManager::setAnimatingFullscreen):
* Source/WebCore/dom/FullscreenManager.h:
* Source/WebCore/html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::elementIsHidden const):
(WebCore::HTMLMediaElement::isFullscreen const):
(WebCore::HTMLMediaElement::isStandardFullscreen const):
(WebCore::HTMLMediaElement::exitFullscreen):
* Source/WebCore/html/MediaElementSession.cpp:
(WebCore::MediaElementSession::canShowControlsManager const):
(WebCore::MediaElementSession::updateMediaUsageIfChanged):
* Source/WebCore/rendering/RenderLayerCompositor.cpp:
(WebCore::isDescendantOfFullScreenLayer):
* Source/WebCore/style/UserAgentStyle.cpp:
(WebCore::Style::UserAgentStyle::ensureDefaultStyleSheetsForElement):
The UA stylesheet needs to be initialized before checking for the fullscreen element.
Previously, the earlier timing of `currentFullscreenElement()` would achieve that.
Instead, initialize the UA stylesheet as soon as we have fullscreen manager.

* Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentGtk.cpp:
(webkit_dom_document_get_webkit_current_fullscreen_element):
* Source/WebKitLegacy/mac/WebCoreSupport/WebChromeClient.mm:
(WebChromeClient::createWindow):
* Source/WebKitLegacy/mac/WebView/WebView.mm:
(-[WebView _didStartProvisionalLoadForFrame:]):

Canonical link: https://commits.webkit.org/290008@main
@webkit-commit-queue
webkit-commit-queue force-pushed the eng/Remove-FullscreenManager-currentFullscreenElement branch from 2a4a0ed to 64f1b51 Compare February 7, 2025 16:44
@webkit-commit-queue

Copy link
Copy Markdown
Collaborator

Committed 290008@main (64f1b51): https://commits.webkit.org/290008@main

Reviewed commits have been landed. Closing PR #40201 and removing active labels.

@webkit-commit-queue
webkit-commit-queue merged commit 64f1b51 into WebKit:main Feb 7, 2025
@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Feb 7, 2025
@nt1m
nt1m deleted the eng/Remove-FullscreenManager-currentFullscreenElement branch February 7, 2025 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CSS Cascading Style Sheets implementation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants