Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: a1a50b098fc374d17ffdaa715cdd949d5a659e88
      
https://github.com/WebKit/WebKit/commit/a1a50b098fc374d17ffdaa715cdd949d5a659e88
  Author: Zak Ridouh <[email protected]>
  Date:   2026-08-13 (Thu, 13 Aug 2026)

  Changed paths:
    M LayoutTests/TestExpectations
    R LayoutTests/http/tests/site-isolation/iframe-dark-mode-print-expected.html
    A LayoutTests/http/tests/site-isolation/iframe-dark-mode-print-expected.txt
    M LayoutTests/http/tests/site-isolation/iframe-dark-mode-print.html
    M Source/WebCore/page/Page.cpp

  Log Message:
  -----------
  [Site Isolation] Dark mode is not disabled for printing when the main frame 
is remote
https://bugs.webkit.org/show_bug.cgi?id=320020
rdar://182952197

Reviewed by Kiet Ho.

Page::useDarkAppearance() only applied the "printing uses light appearance"
rule inside an `if (localMainFrame())` block, so under site isolation a
cross-origin iframe (whose process has a RemoteFrame as its main frame)
kept using dark appearance while printing. prefers-color-scheme: dark then
still matched inside the iframe and it painted with its dark background.

The printing flag is synced to remote main frames via SetFramePrinting, so
consult mainFrame().isPrinting() before the localMainFrame()-only logic.

iframe-dark-mode-print.html was an image-only reftest, which cannot work for a
printing test under site isolation. WebKitTestRunner captures the pixel result
of a printing test in the main frame's WebContent process (a printing snapshot
taken in the injected bundle), and that process paints nothing for a remote
frame; printing also forces backgrounds to white unless ShouldPrintBackgrounds
is enabled, so the snapshot is blank white with or without this change. Convert
it into a render tree dump test, following print-with-iframe.html: a remote
frame's render tree is collected across processes, so the used background color
inside the cross-origin iframe is visible in the dump (red for light appearance
rather than green for dark).

* LayoutTests/TestExpectations:
* LayoutTests/http/tests/site-isolation/iframe-dark-mode-print-expected.html: 
Removed.
* LayoutTests/http/tests/site-isolation/iframe-dark-mode-print-expected.txt: 
Added.
* LayoutTests/http/tests/site-isolation/iframe-dark-mode-print.html:
* Source/WebCore/page/Page.cpp:
(WebCore::Page::useDarkAppearance const):

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



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

Reply via email to