[webkit-changes] [WebKit/WebKit] 0d71b3: [UnifiedPDF] PDF plugin should set background colo...

Abrar Rahman Protyasha noreply at github.com
Thu Jan 16 09:36:41 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 0d71b3d9d2b58719eceb9d45035e3d9c43939ea0
      https://github.com/WebKit/WebKit/commit/0d71b3d9d2b58719eceb9d45035e3d9c43939ea0
  Author: Abrar Rahman Protyasha <a_protyasha at apple.com>
  Date:   2025-01-16 (Thu, 16 Jan 2025)

  Changed paths:
    M Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm
    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

  Log Message:
  -----------
  [UnifiedPDF] PDF plugin should set background color on the PluginDocument
https://bugs.webkit.org/show_bug.cgi?id=286040
rdar://143008114

Reviewed by Aditya Keerthi.

In 235203 at main, we started overriding the plugin document's background
color in full main frame PDF plugins, allowing us to align with the
PDFLayerController layer backgrounds.

For UnifiedPDF, we want this same behavior, otherwise there are often
abrupt color transitions on orientation changes (among other things) on
iOS, since there is now a mismatch between the plugin's background layer
color (rgb(127, 127, 127)) and the plugin document's background color
(rgb(217, 224, 233)).

To facilitate this, we introduce PDFPluginBase::pluginBackgroundColor(),
which just ends up consulting [NS|UI]Color.grayColor, and adopt that
across the various codepaths where we assign background colors in the
PDF plugin.

* Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm:
(WebKit::PDFPlugin::PDFPlugin):
* Source/WebKit/WebProcess/Plugins/PDF/PDFPluginBase.h:
* Source/WebKit/WebProcess/Plugins/PDF/PDFPluginBase.mm:
(WebKit::PDFPluginBase::PDFPluginBase):
(WebKit::PDFPluginBase::pluginBackgroundColor):
* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.mm:
(WebKit::UnifiedPDFPlugin::ensureLayers):
(WebKit::UnifiedPDFPlugin::paint):

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



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


More information about the webkit-changes mailing list