Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 94f9b7905e3ce9a3d7497f26b563adcad6b7525f
      
https://github.com/WebKit/WebKit/commit/94f9b7905e3ce9a3d7497f26b563adcad6b7525f
  Author: Ben Nham <[email protected]>
  Date:   2026-09-10 (Thu, 10 Sep 2026)

  Changed paths:
    M Source/WebCore/dom/Document.cpp
    M Source/WebCore/editing/cocoa/EditorCocoa.mm
    M Source/WebCore/page/Frame.cpp
    M Source/WebCore/page/FrameTree.cpp
    M Source/WebCore/page/FrameTree.h
    M Source/WebCore/page/LocalDOMWindow.cpp
    M Source/WebCore/page/LocalFrameView.cpp
    M Source/WebCore/page/Page.cpp
    M Source/WebCore/page/Page.h
    M Source/WebCore/page/RemoteFrame.cpp

  Log Message:
  -----------
  Speed up FrameTree::containsRemoteFrame and related methods
https://bugs.webkit.org/show_bug.cgi?id=323516
rdar://186752700

Reviewed by Alex Christensen.

We are starting to use FrameTree::containsRemoteFrame and related methods as 
part of various site
isolation patches. Make this a constant time operation instead of requiring a 
frame tree walk. We do
this by maintaining a remote frame descendant count for every FrameTree. This 
is updated every time
a frame is added or removed from the tree.

Also remove:

 - Page::hasRemoteFrames: callers can use FrameTree::containsRemoteFrame instead
 - The hasRemoteFrames memoization loop in Page::syncLocalFrameInfoToRemote

* Source/WebCore/dom/Document.cpp:
(WebCore::Document::enforceSandboxFlags):
(WebCore::Document::updateRemoteIntersectionObservers):
* Source/WebCore/editing/cocoa/EditorCocoa.mm:
(WebCore::Editor::writeSelectionToPasteboard):
* Source/WebCore/page/Frame.cpp:
(WebCore::Frame::detachFromPage):
* Source/WebCore/page/FrameTree.cpp:
(WebCore::FrameTree::remoteFrameCountIncludingSelf const):
(WebCore::FrameTree::adjustRemoteFrameDescendantCountForSelfAndAncestors):
(WebCore::FrameTree::remoteFrameDescendantCountSlow const):
(WebCore::FrameTree::detachFromParent):
(WebCore::FrameTree::appendChild):
(WebCore::FrameTree::removeChild):
(WebCore::FrameTree::replaceChild):
(WebCore::FrameTree::containsRemoteFrame const):
(WebCore::FrameTree::hasRemoteFrameDescendant const): Deleted.
* Source/WebCore/page/FrameTree.h:
(WebCore::FrameTree::hasRemoteFrameDescendant const):
(WebCore::FrameTree::detachFromParent): Deleted.
* Source/WebCore/page/LocalDOMWindow.cpp:
(WebCore::LocalDOMWindow::consumeTransientActivation):
(WebCore::LocalDOMWindow::notifyActivated):
* Source/WebCore/page/LocalFrameView.cpp:
(WebCore::LocalFrameView::scrollPositionChanged):
* Source/WebCore/page/Page.cpp:
(WebCore::Page::syncLocalFrameInfoToRemote):
(WebCore::Page::doAfterUpdateRendering):
(WebCore::Page::hasRemoteFrames const): Deleted.
* Source/WebCore/page/Page.h:
(WebCore::Page::didAttachRemoteFrame): Deleted.
(WebCore::Page::didDetachRemoteFrame): Deleted.
* Source/WebCore/page/RemoteFrame.cpp:
(WebCore::m_colorSchemePreference):

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



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

Reply via email to