Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 0ae01ce5e5bc18dc665dc946a08afd35b767fdb0
      
https://github.com/WebKit/WebKit/commit/0ae01ce5e5bc18dc665dc946a08afd35b767fdb0
  Author: Cole Carley <[email protected]>
  Date:   2026-09-25 (Fri, 25 Sep 2026)

  Changed paths:
    M Source/WebCore/Modules/webauthn/AuthenticatorCoordinator.cpp
    M Source/WebCore/accessibility/AXObjectCache.cpp
    M Source/WebCore/accessibility/mac/AXObjectCacheMac.mm
    M Source/WebCore/dom/Document.cpp
    M Source/WebCore/dom/DocumentFullscreen.cpp
    M Source/WebCore/dom/UserGestureIndicator.cpp
    M Source/WebCore/html/HTMLFrameOwnerElement.cpp
    M Source/WebCore/loader/FrameLoader.cpp
    M Source/WebCore/loader/FrameLoader.h
    M Source/WebCore/page/FocusController.cpp
    M Source/WebCore/page/Frame.cpp
    M Source/WebCore/page/Frame.h
    M Source/WebCore/page/LocalDOMWindow.cpp
    M Source/WebCore/page/Location.cpp
    M Source/WebCore/page/SpatialNavigation.cpp
    M Source/WebCore/page/csp/ContentSecurityPolicyDirectiveList.cpp
    M Source/WebCore/workers/service/ServiceWorkerClientData.cpp
    M Source/WebKit/WebProcess/FullScreen/WebFullScreenManager.cpp
    M Source/WebKit/WebProcess/Network/WebLoaderStrategy.cpp

  Log Message:
  -----------
  Add a frame ancestor range for walking the frame tree
https://bugs.webkit.org/show_bug.cgi?id=325073
rdar://188234861

Reviewed by Ryosuke Niwa.

Many call sites walk the frame tree by hand:

    for (RefPtr ancestor = frame->tree().parent(); ancestor; ancestor = 
ancestor->tree().parent()) {
        RefPtr localAncestor = dynamicDowncast<LocalFrame>(ancestor);
        if (!localAncestor)
            continue;
        ...
    }

This patch introduces ancestorFrames() and inclusiveAncestorFrames(), which
return a range over a frame's ancestors. An optional FrameType type argument
skips ancestors of other types, so the loop above becomes:

    for (Ref localAncestor : ancestorFrames<LocalFrame>(*frame)) {
        ...
    }

The ranges are compatible with std::ranges functions.

* Source/WebCore/Modules/webauthn/AuthenticatorCoordinator.cpp:
(WebCore::AuthenticatorCoordinatorInternal::scopeAndCrossOriginParent):
* Source/WebCore/accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::updateAncestorFramesFocusedObject):
* Source/WebCore/accessibility/mac/AXObjectCacheMac.mm:
(WebCore::AXObjectCache::postTextSelectionChangePlatformNotification):
* Source/WebCore/dom/Document.cpp:
(WebCore::canAccessAncestor):
(WebCore::Document::isFullyActive const):
(WebCore::Document::sameOriginTopLevelTraversable const):
(WebCore::Document::isSecureContext const):
* Source/WebCore/dom/DocumentFullscreen.cpp:
(WebCore::DocumentFullscreen::willEnterFullscreen):
(WebCore::documentsToUnfullscreen):
* Source/WebCore/dom/UserGestureIndicator.cpp:
(WebCore::UserGestureIndicator::UserGestureIndicator):
* Source/WebCore/html/HTMLFrameOwnerElement.cpp:
(WebCore::HTMLFrameOwnerElement::isProhibitedSelfReference const):
* Source/WebCore/loader/FrameLoader.cpp:
(WebCore::FrameLoader::allAncestorsAreComplete const):
(WebCore::FrameLoader::started):
(WebCore::FrameLoader::shouldInterruptLoadForXFrameOptions):
* Source/WebCore/page/FocusController.cpp:
(WebCore::FocusController::setFocusedFrame):
* Source/WebCore/page/Frame.cpp:
* Source/WebCore/page/Frame.h:
(WebCore::FrameAncestorIterator::FrameAncestorIterator):
(WebCore::FrameAncestorIterator::operator* const):
(WebCore::FrameAncestorIterator::operator-> const):
(WebCore::FrameAncestorIterator::operator== const):
(WebCore::FrameAncestorIterator::operator++):
(WebCore::FrameAncestorIterator::firstOfType):
(WebCore::FrameAncestorRange::FrameAncestorRange):
(WebCore::FrameAncestorRange::begin const):
(WebCore::FrameAncestorRange::end):
(WebCore::ancestorFrames):
(WebCore::inclusiveAncestorFrames):
* Source/WebCore/page/LocalDOMWindow.cpp:
(WebCore::LocalDOMWindow::notifyActivated):
* Source/WebCore/page/Location.cpp:
(WebCore::Location::ancestorOrigins const):
* Source/WebCore/page/SpatialNavigation.cpp:
(WebCore::rectToAbsoluteCoordinates):
* Source/WebCore/page/csp/ContentSecurityPolicyDirectiveList.cpp:
(WebCore::checkFrameAncestors):
* Source/WebCore/workers/service/ServiceWorkerClientData.cpp:
(WebCore::ServiceWorkerClientData::from):
* Source/WebKit/WebProcess/FullScreen/WebFullScreenManager.cpp:
(WebKit::WebFullScreenManager::enterFullScreenForOwnerElements):
* Source/WebKit/WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to