Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 73bbfe7d99dcbb569522d02857be1051ae5014f5
      
https://github.com/WebKit/WebKit/commit/73bbfe7d99dcbb569522d02857be1051ae5014f5
  Author: Jessica Cheung <[email protected]>
  Date:   2026-05-19 (Tue, 19 May 2026)

  Changed paths:
    M Source/WebKit/WebProcess/Plugins/PDF/PDFPluginBase.h
    M Source/WebKit/WebProcess/Plugins/PDF/PDFPluginBase.mm
    M Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.mm
    M Tools/TestWebKitAPI/Helpers/PlatformUtilities.h
    M Tools/TestWebKitAPI/Tests/WebKit/WKWebView/UnifiedPDFTests.mm

  Log Message:
  -----------
  Scroll view background color doesn't adapt with rest of background on PDFs
https://bugs.webkit.org/show_bug.cgi?id=315051
rdar://171223676

Reviewed by Lily Spiniolas, Tim Horton, and Abrar Rahman Protyasha.

Currently, when switching from light mode to dark mode,
the tab bar remains light and there is a white gap at
the top when scrolling. This is particularly noticable with
a dark colored PDF.

This is because when the effectiveAppearanceDidChange, we do not
update the body background. The body background color is initially set
upon creation via the PDFPluginBase constructor and that's it.

So, extract that logic from the constructor and put it in a function
that can be called from effectiveAppearanceDidChange and the constructor.
Now, when the appearance mode is changed, the background reflects this
change.

Add an API test that checks for this body background color change. Add
a helper in PlatformUtilities.h that does the inverse of EXPECT_WK_STREQ.

* Source/WebKit/WebProcess/Plugins/PDF/PDFPluginBase.h:
* Source/WebKit/WebProcess/Plugins/PDF/PDFPluginBase.mm:
(WebKit::PDFPluginBase::PDFPluginBase):
(WebKit::PDFPluginBase::updateFullFramePluginBackgroundColor):
* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.mm:
(WebKit::UnifiedPDFPlugin::effectiveAppearanceDidChange):
* Tools/TestWebKitAPI/Helpers/PlatformUtilities.h:
(TestWebKitAPI::Util::assertWKStringNotEqual):
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/UnifiedPDFTests.mm:
(TestWebKitAPI::UNIFIED_PDF_TEST):

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



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

Reply via email to