Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: e58064d5589fd61dcaacef2e008a5611a4592e52
https://github.com/WebKit/WebKit/commit/e58064d5589fd61dcaacef2e008a5611a4592e52
Author: Matt Woodrow <[email protected]>
Date: 2025-09-23 (Tue, 23 Sep 2025)
Changed paths:
A LayoutTests/http/tests/site-isolation/print-with-iframe-expected.txt
A LayoutTests/http/tests/site-isolation/print-with-iframe.html
A
LayoutTests/http/tests/site-isolation/resources/green-square-if-printed.html
A
LayoutTests/platform/ios/http/tests/site-isolation/print-with-iframe-expected.txt
M Source/WebCore/loader/EmptyClients.cpp
M Source/WebCore/loader/EmptyFrameLoaderClient.h
M Source/WebCore/loader/FrameLoaderClient.h
M Source/WebCore/page/Frame.cpp
M Source/WebCore/page/Frame.h
M Source/WebCore/page/LocalFrame.cpp
M Source/WebCore/page/LocalFrame.h
M Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in
M Source/WebKit/UIProcess/WebPageProxy.cpp
M Source/WebKit/UIProcess/WebPageProxy.h
M Source/WebKit/UIProcess/WebPageProxy.messages.in
M Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
M Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.h
M Source/WebKit/WebProcess/WebCoreSupport/WebLocalFrameLoaderClient.cpp
M Source/WebKit/WebProcess/WebCoreSupport/WebLocalFrameLoaderClient.h
M Source/WebKit/WebProcess/WebCoreSupport/WebRemoteFrameClient.cpp
M Source/WebKit/WebProcess/WebCoreSupport/WebRemoteFrameClient.h
M Source/WebKit/WebProcess/WebPage/WebPage.cpp
M Source/WebKit/WebProcess/WebPage/WebPage.h
M Source/WebKit/WebProcess/WebPage/WebPage.messages.in
M Source/WebKitLegacy/mac/WebCoreSupport/WebFrameLoaderClient.h
Log Message:
-----------
LocalFrame::setPrinting doesn't set printing state on remote frame children.
https://bugs.webkit.org/show_bug.cgi?id=299049
<rdar://problem/160808134>
Reviewed by Alex Christensen.
Makes the recursive setPrinting frame walk work correctly across local/remote
frame boundaries, and also synchronizes the boolean printing state to all
processes such that LocalFrame::shouldUsePrintingLayout can correctly detect if
it's the root printing frame.
The latter of these would be a good candidate for being moved to
FrameTreeSyncData, once that supports broadcasting mutations from a web process.
Adds a new test that checks that the print bool state is propagated recursively
into remote descendants by using an @media print rule in a cross origin iframe.
It also checks that LocalFrame::shouldUsePrintingLayout correctly reads the bool
printing state from remote ancestors by using a percentage width in the iframe.
If remote ancestor state isn't available, the frame contents will layout to the
page size instead of the viewport created by the iframe element (since it will
think it is the print root).
Test: http/tests/site-isolation/print-with-iframe.html
* LayoutTests/http/tests/site-isolation/print-with-iframe-expected.txt: Added.
* LayoutTests/http/tests/site-isolation/print-with-iframe.html: Added.
* LayoutTests/http/tests/site-isolation/resources/green-square-if-printed.html:
Added.
* Source/WebCore/loader/EmptyClients.cpp:
(WebCore::EmptyFrameLoaderClient::setPrinting):
* Source/WebCore/loader/EmptyFrameLoaderClient.h:
* Source/WebCore/loader/FrameLoaderClient.h:
* Source/WebCore/page/Frame.cpp:
(WebCore::Frame::isPrinting const):
(WebCore::Frame::setPrinting):
* Source/WebCore/page/Frame.h:
* Source/WebCore/page/LocalFrame.cpp:
(WebCore::LocalFrame::setPrinting):
(WebCore::LocalFrame::shouldUsePrintingLayout const):
* Source/WebCore/page/LocalFrame.h:
* Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in:
* Source/WebKit/UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::setFramePrinting):
* Source/WebKit/UIProcess/WebPageProxy.h:
* Source/WebKit/UIProcess/WebPageProxy.messages.in:
* Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::setPrinting):
* Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
* Source/WebKit/WebProcess/WebCoreSupport/WebLocalFrameLoaderClient.cpp:
(WebKit::WebLocalFrameLoaderClient::setPrinting):
* Source/WebKit/WebProcess/WebCoreSupport/WebLocalFrameLoaderClient.h:
* Source/WebKit/WebProcess/WebCoreSupport/WebRemoteFrameClient.cpp:
(WebKit::WebRemoteFrameClient::setPrinting):
* Source/WebKit/WebProcess/WebCoreSupport/WebRemoteFrameClient.h:
* Source/WebKit/WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updateOpener):
(WebKit::WebPage::setFramePrinting):
* Source/WebKit/WebProcess/WebPage/WebPage.h:
* Source/WebKit/WebProcess/WebPage/WebPage.messages.in:
* Source/WebKitLegacy/mac/WebCoreSupport/WebFrameLoaderClient.h:
(WebFrameLoaderClient::setPrinting):
Canonical link: https://commits.webkit.org/300374@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes