Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 87adf3afd48f54e9fdcb7fa7f7806f2a4e19d9b0
      
https://github.com/WebKit/WebKit/commit/87adf3afd48f54e9fdcb7fa7f7806f2a4e19d9b0
  Author: Ryosuke Niwa <[email protected]>
  Date:   2026-09-30 (Wed, 30 Sep 2026)

  Changed paths:
    M Source/WebKit/UIProcess/WebPageProxy.cpp
    M Source/WebKit/UIProcess/WebPageProxy.h
    M Source/WebKit/UIProcess/WebPageProxy.messages.in
    M Source/WebKit/WebProcess/GPU/graphics/RemoteRenderingBackendProxy.cpp
    M Source/WebKit/WebProcess/GPU/graphics/RemoteRenderingBackendProxy.h
    M Source/WebKit/WebProcess/GPU/graphics/RemoteSnapshotRecorderProxy.cpp
    M Source/WebKit/WebProcess/GPU/graphics/RemoteSnapshotRecorderProxy.h
    M Source/WebKit/WebProcess/WebPage/Cocoa/WebPageCocoa.mm
    M Source/WebKit/WebProcess/WebPage/WebPage.cpp
    M Source/WebKit/WebProcess/WebPage/WebPage.h
    M Source/WebKit/WebProcess/WebPage/WebPage.messages.in
    M Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm
    M Tools/TestWebKitAPI/Tests/WebKit/WKWebView/DrawingToPDF.mm

  Log Message:
  -----------
  Enabling remote snapshotting causes two PDF drawing API tests to fail
https://bugs.webkit.org/show_bug.cgi?id=325707

Reviewed by Sihui Liu, Matt Woodrow, Megan Gardner, and Abrar Rahman Protyasha.

With RemoteSnapshottingEnabled, content is painted into a 
RemoteSnapshotRecorderProxy, and the GPU process later
replays the recording into a CG PDF context. The recorder always reported 
RenderingMode::DisplayList, so checks for
RenderingMode::PDFDocument in Page::preferredFilterRenderingModes, 
BackgroundPainter::paintFillLayer and
LegacyRenderSVGResourceGradient were skipped, bringing back the bugs they fixed 
(filter: invert() not applied,
background-clip: text drawn as a solid rectangle).

Pass a rendering mode when creating the snapshot recorder: 
RenderingMode::PDFDocument when the snapshot will be sunk
into a PDF (createPDF and printing to PDF), RenderingMode::DisplayList 
otherwise. Pass the mode through
DrawFrameToSnapshot so cross-site iframes are recorded the same way under site 
isolation.

Tests: DrawingToPDF.CSSFilterInvertAppliedOnPDFWithRemoteSnapshotting
       DrawingToPDF.BackgroundClipTextWithRemoteSnapshotting

* Source/WebKit/UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::drawFrameToSnapshot):
* Source/WebKit/UIProcess/WebPageProxy.h:
* Source/WebKit/UIProcess/WebPageProxy.messages.in:
* Source/WebKit/WebProcess/GPU/graphics/RemoteRenderingBackendProxy.cpp:
(WebKit::RemoteRenderingBackendProxy::createSnapshotRecorder):
* Source/WebKit/WebProcess/GPU/graphics/RemoteRenderingBackendProxy.h:
* Source/WebKit/WebProcess/GPU/graphics/RemoteSnapshotRecorderProxy.cpp:
(WebKit::RemoteSnapshotRecorderProxy::RemoteSnapshotRecorderProxy):
* Source/WebKit/WebProcess/GPU/graphics/RemoteSnapshotRecorderProxy.h:
* Source/WebKit/WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
(WebKit::WebPage::drawPrintingRectToSnapshot):
(WebKit::WebPage::drawPrintingPagesToSnapshot):
* Source/WebKit/WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::takeRemoteSnapshot):
(WebKit::WebPage::paintRemoteFrameContents):
(WebKit::WebPage::drawToSnapshot):
(WebKit::WebPage::drawFrameToSnapshot):
* Source/WebKit/WebProcess/WebPage/WebPage.h:
* Source/WebKit/WebProcess/WebPage/WebPage.messages.in:
* Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::drawPrintingToSnapshotiOS):
(WebKit::WebPage::drawPrintingPagesToSnapshotiOS):
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/DrawingToPDF.mm:
(TestWebKitAPI::enableFeature):
(TestWebKitAPI::runCSSFilterInvertAppliedOnPDFTest):
(TestWebKitAPI::TEST(DrawingToPDF, CSSFilterInvertAppliedOnPDF)):
(TestWebKitAPI::TEST(DrawingToPDF, 
CSSFilterInvertAppliedOnPDFWithRemoteSnapshotting)):
(TestWebKitAPI::runBackgroundClipTextTest):
(TestWebKitAPI::TEST(DrawingToPDF, BackgroundClipText)):
(TestWebKitAPI::TEST(DrawingToPDF, BackgroundClipTextWithRemoteSnapshotting)):
(TestWebKitAPI::TEST(DrawingToPDF, SiteIsolationFormControl)):
(TestWebKitAPI::enableSiteIsolation): Deleted.

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



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

Reply via email to