Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 3f208b767511e8954e014937f310c7be4b5cc422
      
https://github.com/WebKit/WebKit/commit/3f208b767511e8954e014937f310c7be4b5cc422
  Author: Cole Carley <[email protected]>
  Date:   2026-09-26 (Sat, 26 Sep 2026)

  Changed paths:
    M Source/WebCore/loader/FrameLoader.cpp
    M Source/WebCore/loader/HistoryController.cpp
    M Source/WebCore/page/Frame.h
    M Source/WebCore/page/FrameTree.cpp
    M Source/WebCore/page/LocalFrameView.cpp
    M Source/WebCore/page/Page.cpp
    M Source/WebCore/page/SettingsBase.cpp
    M Source/WebCore/rendering/RenderLayerCompositor.cpp

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

Reviewed by Ryosuke Niwa.

This is a continuation of https://commits.webkit.org/321915@main

Many call sites walk the frame tree by hand:

    for (RefPtr descendantFrame = frame.ptr(); descendantFrame; descendantFrame 
= descendantFrame->tree().traverseNext(frame.ptr())) {
        RefPtr localDescendant = dynamicDowncast<LocalFrame>(descendantFrame);
        if (!localDescendant)
            continue;
        ...
    }

This patch introduces descendantFrames() and inclusiveDescendantFrames(), 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 localDescendant : descendantFrames<LocalFrame>(frame)) {
        ...
    }

* Source/WebCore/loader/FrameLoader.cpp:
(WebCore::FrameLoader::setFirstPartyForCookies):
(WebCore::FrameLoader::completed):
* Source/WebCore/loader/HistoryController.cpp:
(WebCore::HistoryController::saveDocumentAndScrollState):
* Source/WebCore/page/Frame.h:
(WebCore::FrameDescendantIterator::FrameDescendantIterator):
(WebCore::FrameDescendantIterator::operator* const):
(WebCore::FrameDescendantIterator::operator-> const):
(WebCore::FrameDescendantIterator::operator== const):
(WebCore::FrameDescendantIterator::operator++):
(WebCore::FrameDescendantIterator::firstOfType):
(WebCore::FrameDescendantRange::FrameDescendantRange):
(WebCore::FrameDescendantRange::begin const):
(WebCore::FrameDescendantRange::end):
(WebCore::ancestorFrames):
(WebCore::inclusiveAncestorFrames):
(WebCore::descendantFrames):
(WebCore::inclusiveDescendantFrames):
* Source/WebCore/page/FrameTree.cpp:
(WebCore::FrameTree::adjustRemoteFrameDescendantCountForSelfAndAncestors):
(WebCore::FrameTree::find const):
(WebCore::FrameTree::hasRemoteFrameAncestor const):
(WebCore::FrameTree::uniqueName const):
* Source/WebCore/page/LocalFrameView.cpp:
(WebCore::LocalFrameView::updateCanBlitOnScrollRecursively):
(WebCore::LocalFrameView::updateBackgroundRecursively):
* Source/WebCore/page/Page.cpp:
(WebCore::Page::takeAnyMediaCanStartListener):
(WebCore::Page::setDefersLoading):
* Source/WebCore/page/SettingsBase.cpp:
(WebCore::SettingsBase::setMinimumDOMTimerInterval):
* Source/WebCore/rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateScrollCoordinatedLayersAfterFlushIncludingSubframes):

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



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

Reply via email to