Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 098787f88f637b0502012859a539860e2bd3f2be
      
https://github.com/WebKit/WebKit/commit/098787f88f637b0502012859a539860e2bd3f2be
  Author: Abrar Rahman Protyasha <[email protected]>
  Date:   2026-04-13 (Mon, 13 Apr 2026)

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

  Log Message:
  -----------
  REGRESSION(306364@main): [macOS] PDF text selection color becomes darker when 
system is in dark appearance
https://bugs.webkit.org/show_bug.cgi?id=312186
rdar://174654854

Reviewed by Aditya Keerthi and Megan Gardner.

In 306364@main, we added a <meta color-scheme="light dark"> element to
(main frame) plugin documents, which opted us into appearance change
adaptations. While this is generally correct, this bucks the established
behavior where text selection colors do not adapt.

In this patch, we revert the behavior change introduced in the
regressing commit for PDF text selections only by removing the relevant
style color option (UseDarkAppearance) when querying RenderStyle for the
platform selection color.

Tests: TestWebKitAPI.UnifiedPDF.SelectionHighlightColorDoesNotAdaptToColorScheme

* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.mm:
(WebKit::UnifiedPDFPlugin::paintPDFSelection):
* Tools/TestWebKitAPI/Helpers/cocoa/TestWKWebView.h:
* Tools/TestWebKitAPI/Helpers/cocoa/TestWKWebView.mm:
(-[WKWebView snapshotAfterScreenUpdates]):
(-[WKWebView snapshotAfterScreenUpdatesInRect:]):
(-[TestWKWebView sampleColorsInRect:]):
(-[TestWKWebView sampleColorsWithInterval:]):
(-[TestWKWebView sampleColorsInRect:withInterval:]):

To service the new test case, we introduce API support to sample colors
within a given rect in the web view.

* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/UnifiedPDFTests.mm:
(TestWebKitAPI::UNIFIED_PDF_TEST):

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



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

Reply via email to