[webkit-changes] [WebKit/WebKit] 183910: Rename topDocument() and make it return a pointer ...
Brady Eidson
noreply at github.com
Wed Jan 15 19:28:42 PST 2025
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 18391053bff1f5c0ebc6597d9fc3e693e6168cdd
https://github.com/WebKit/WebKit/commit/18391053bff1f5c0ebc6597d9fc3e693e6168cdd
Author: Brady Eidson <beidson at apple.com>
Date: 2025-01-15 (Wed, 15 Jan 2025)
Changed paths:
M Source/WTF/wtf/Assertions.h
M Source/WebCore/Modules/applepay/PaymentSession.cpp
M Source/WebCore/Modules/webaudio/AudioContext.cpp
M Source/WebCore/SaferCPPExpectations/UncountedLocalVarsCheckerExpectations
M Source/WebCore/accessibility/AccessibilityObject.cpp
M Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm
M Source/WebCore/dom/Document.cpp
M Source/WebCore/dom/Document.h
M Source/WebCore/dom/Element.cpp
M Source/WebCore/dom/FullscreenManager.cpp
M Source/WebCore/dom/FullscreenManager.h
M Source/WebCore/dom/UserGestureIndicator.cpp
M Source/WebCore/html/HTMLDialogElement.cpp
M Source/WebCore/html/HTMLElement.cpp
M Source/WebCore/html/HTMLMediaElement.cpp
M Source/WebCore/html/HTMLMediaElement.h
M Source/WebCore/html/HTMLPlugInElement.cpp
M Source/WebCore/html/MediaElementSession.cpp
M Source/WebCore/page/EventHandler.cpp
M Source/WebCore/page/LocalDOMWindow.cpp
M Source/WebCore/page/Quirks.cpp
M Source/WebCore/page/ios/ContentChangeObserver.cpp
M Source/WebCore/platform/Logging.h
M Source/WebCore/rendering/RenderView.cpp
M Source/WebKit/Platform/Logging.h
M Source/WebKit/WebProcess/WebPage/WebFrame.cpp
M Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm
Log Message:
-----------
Rename topDocument() and make it return a pointer instead of a reference
rdar://142888352
https://bugs.webkit.org/show_bug.cgi?id=285917
Reviewed by Alex Christensen.
This accomplishes two things:
1 - Makes searching for true "topDocument()" uses in the codebase much easier since the phrase "mainFrameDocument" doesn't otherwise exist.
2 - Instead of always returning a Document& even if it's actually wrong, this forces us to confront the reality that a mainFrameDocument
often doesn't exist with site isolation enabled, so we have to handle each case reasonably.
* Source/WTF/wtf/Assertions.h:
* Source/WebCore/Modules/applepay/PaymentSession.cpp:
(WebCore::PaymentSession::canCreateSession):
* Source/WebCore/Modules/webaudio/AudioContext.cpp:
(WebCore::shouldDocumentAllowWebAudioToAutoPlay):
(WebCore::AudioContext::constructCommon):
* Source/WebCore/accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::topDocument const):
* Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper accessibilityContainer]):
* Source/WebCore/dom/Document.cpp:
(WebCore::Document::~Document):
(WebCore::Document::topOrigin const):
(WebCore::Document::createRenderTree):
(WebCore::Document::destroyRenderTree):
(WebCore::Document::willBeRemovedFromFrame):
(WebCore::Document::clearAXObjectCache):
(WebCore::Document::existingAXObjectCacheSlow const):
(WebCore::Document::axObjectCache const):
(WebCore::Document::implicitClose):
(WebCore::Document::urlForBindings):
(WebCore::Document::flushAutofocusCandidates):
(WebCore::Document::referrerForBindings):
(WebCore::Document::mainFrameDocument const):
(WebCore::Document::shouldForceNoOpenerBasedOnCOOP const):
(WebCore::Document::mainFrameDocumentHasHadUserInteraction const):
(WebCore::Document::processingUserGestureForMedia const):
(WebCore::Document::deviceOrientationAndMotionAccessController):
(WebCore::Document::isRunningUserScripts const):
(WebCore::Document::setAsRunningUserScripts):
(WebCore::Document::crossOriginOpenerPolicy const):
(WebCore::Document::advancedPrivacyProtections const):
(WebCore::Document::topDocument const): Deleted.
* Source/WebCore/dom/Document.h:
(WebCore::Document::protectedMainFrameDocument const):
(WebCore::Document::isTopDocumentLegacy const):
(WebCore::Document::protectedTopDocument const): Deleted.
* Source/WebCore/dom/Element.cpp:
(WebCore::Element::insertedIntoAncestor):
* Source/WebCore/dom/FullscreenManager.cpp:
(WebCore::FullscreenManager::mainFrameDocument):
(WebCore::FullscreenManager::protectedMainFrameDocument):
(WebCore::FullscreenManager::requestFullscreenForElement):
(WebCore::FullscreenManager::cancelFullscreen):
(WebCore::FullscreenManager::exitFullscreen):
(WebCore::FullscreenManager::didExitFullscreen):
(WebCore::FullscreenManager::protectedTopDocument): Deleted.
* Source/WebCore/dom/FullscreenManager.h:
* Source/WebCore/dom/UserGestureIndicator.cpp:
* Source/WebCore/html/HTMLDialogElement.cpp:
(WebCore::HTMLDialogElement::runFocusingSteps):
* Source/WebCore/html/HTMLElement.cpp:
(WebCore::runPopoverFocusingSteps):
* Source/WebCore/html/HTMLMediaElement.cpp:
(WebCore::m_remote):
(WebCore::HTMLMediaElement::removeBehaviorRestrictionsAfterFirstUserGesture):
(WebCore::HTMLMediaElement::updateRateChangeRestrictions):
* Source/WebCore/html/HTMLMediaElement.h:
* Source/WebCore/html/HTMLPlugInElement.cpp:
(WebCore::HTMLPlugInElement::isReplacementObscured):
* Source/WebCore/html/MediaElementSession.cpp:
(WebCore::MediaElementSession::playbackStateChangePermitted const):
* Source/WebCore/page/EventHandler.cpp:
(WebCore::EventHandler::keyEvent):
* Source/WebCore/page/LocalDOMWindow.cpp:
(WebCore::LocalDOMWindow::crossOriginIsolated const):
(WebCore::LocalDOMWindow::incrementScrollEventListenersCount):
(WebCore::LocalDOMWindow::decrementScrollEventListenersCount):
* Source/WebCore/page/Quirks.cpp:
(WebCore::allowedAutoplayQuirks):
(WebCore::Quirks::needsAutoplayPlayPauseEvents const):
(WebCore::Quirks::needsPerDocumentAutoplayBehavior const):
* Source/WebCore/page/ios/ContentChangeObserver.cpp:
(WebCore::isHiddenBehindFullscreenElement):
* Source/WebCore/platform/Logging.h:
* Source/WebCore/rendering/RenderView.cpp:
(WebCore::RenderView::RepaintRegionAccumulator::RepaintRegionAccumulator):
* Source/WebKit/Platform/Logging.h:
* Source/WebKit/WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::policySourceDocumentLoader const):
* Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::isObscuredElement):
Canonical link: https://commits.webkit.org/288984@main
To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications
More information about the webkit-changes
mailing list