Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 41c908b6b6717d5dc5a4c82d87ec1e252e9cfe87
      
https://github.com/WebKit/WebKit/commit/41c908b6b6717d5dc5a4c82d87ec1e252e9cfe87
  Author: Ben Nham <[email protected]>
  Date:   2026-09-14 (Mon, 14 Sep 2026)

  Changed paths:
    A 
LayoutTests/http/tests/site-isolation/do-not-rebroadcast-unchanged-frame-geometry-expected.txt
    A 
LayoutTests/http/tests/site-isolation/do-not-rebroadcast-unchanged-frame-geometry.html
    M 
LayoutTests/http/tests/site-isolation/only-broadcast-frame-geometry-from-frames-with-cross-process-descendants.html
    M 
LayoutTests/http/tests/site-isolation/only-broadcast-scroll-position-if-remote-frame-exists.html
    M Source/WebCore/page/FrameGeometrySyncData.cpp
    M Source/WebCore/page/FrameGeometrySyncData.h
    M Source/WebCore/page/RemoteFrameLayoutInfo.cpp
    M Source/WebCore/page/RemoteFrameLayoutInfo.h
    M Source/WebKit/WebProcess/WebCoreSupport/WebLocalFrameLoaderClient.cpp
    M Source/WebKit/WebProcess/WebCoreSupport/WebLocalFrameLoaderClient.h
    M Source/WebKit/WebProcess/WebPage/WebPage.cpp

  Log Message:
  -----------
  [Site Isolation] Avoid re-broadcasting frame geometry if nothing changed
https://bugs.webkit.org/show_bug.cgi?id=324018
rdar://problem/187252338

Reviewed by Mike Wyrzykowski.

This patch makes WebLocalFrameLoaderClient keep track of the last FrameGeometry 
data we broadcast to
remote frame processes. If it hasn't changed, then we don't have to 
re-broadcast that info. This
part of the patch is very straightforward.

The complication with this is that when a frame navigates or is newly added to 
the page, UIProcess
broadcasts the FrameTreeSyncDataChangedInAnotherProcess message for that frame 
to all
processes. Since UIProcess doesn't store any geometry, this message contains 
empty
FrameGeometrySyncData for that frame.

If that frame is a local frame, then UIProcess just wiped any frame geometry we 
sent associated with
that frame from all other processes. If that frame is a remote frame, it might 
be from a newly
created frame in a new process that needs frame geometry from us.

To handle this, as part of the 
`WebPage::allFrameTreeSyncDataChangedInAnotherProcess`, we clear our
cache of the last FrameGeometry data we sent and trigger a rendering update. 
The rendering update
will force us to resend the frame geometry message.

Test: http/tests/site-isolation/do-not-rebroadcast-unchanged-frame-geometry.html

* 
LayoutTests/http/tests/site-isolation/do-not-rebroadcast-unchanged-frame-geometry-expected.txt:
 Added.
* 
LayoutTests/http/tests/site-isolation/do-not-rebroadcast-unchanged-frame-geometry.html:
 Added.
* 
LayoutTests/http/tests/site-isolation/only-broadcast-frame-geometry-from-frames-with-cross-process-descendants.html:
* 
LayoutTests/http/tests/site-isolation/only-broadcast-scroll-position-if-remote-frame-exists.html:
* Source/WebCore/page/FrameGeometrySyncData.cpp:
(WebCore::operator==):
* Source/WebCore/page/FrameGeometrySyncData.h:
* Source/WebCore/page/RemoteFrameLayoutInfo.cpp:
(WebCore::operator==):
* Source/WebCore/page/RemoteFrameLayoutInfo.h:
* Source/WebKit/WebProcess/WebCoreSupport/WebLocalFrameLoaderClient.cpp:
(WebKit::WebLocalFrameLoaderClient::broadcastFrameTreeSyncDataToOtherProcesses):
* Source/WebKit/WebProcess/WebCoreSupport/WebLocalFrameLoaderClient.h:
* Source/WebKit/WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::allFrameTreeSyncDataChangedInAnotherProcess):

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



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

Reply via email to