[webkit-changes] [WebKit/WebKit] 2bcded: Unified PDF: HUD zoom buttons don't work on embedd...

Tim Horton noreply at github.com
Tue Mar 5 15:10:07 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 2bcded219334d8aa6965b3ccb3ce6c52282f3732
      https://github.com/WebKit/WebKit/commit/2bcded219334d8aa6965b3ccb3ce6c52282f3732
  Author: Tim Horton <thorton at apple.com>
  Date:   2024-03-05 (Tue, 05 Mar 2024)

  Changed paths:
    M Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.h
    M Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.mm
    M Source/WebKit/WebProcess/Plugins/PluginView.cpp
    M Source/WebKit/WebProcess/Plugins/PluginView.h

  Log Message:
  -----------
  Unified PDF: HUD zoom buttons don't work on embedded pdfs
https://bugs.webkit.org/show_bug.cgi?id=270536
rdar://122034458

Reviewed by Abrar Rahman Protyasha.

* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.h:
Document the scale factors.

* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.mm:
(WebKit::UnifiedPDFPlugin::ensureLayers):
Always apply the "page scale" (which is actually determined by us, not the page)
to the root layer, even for embedded plugins.

(WebKit::UnifiedPDFPlugin::setScaleFactor):
(WebKit::UnifiedPDFPlugin::performContextMenuAction):
(WebKit::UnifiedPDFPlugin::zoomIn):
(WebKit::UnifiedPDFPlugin::zoomOut):
(WebKit::UnifiedPDFPlugin::resetZoom):
(WebKit::UnifiedPDFPlugin::updateLayout):
Factor setScaleFactor (for the UnifiedPDF-owned scale) out, and adopt it internally.

(WebKit::UnifiedPDFPlugin::setPageScaleFactor):
For actual page scale changes, bail if we are an embedded plugin. We don't want
the PDF content to follow page scale changes for embeds, only for the main frame,
where page scale and UnifiedPDF-scale are synchronized.

* Source/WebKit/WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::setPageScaleFactor):
(WebKit::PluginView::pluginScaleFactorDidChange):
Factor pluginScaleFactorDidChange out of setPageScaleFactor so that we can
call it from setScaleFactor in UnifiedPDFPlugin instead of having to round-trip
through PluginView::setPageScaleFactor, which allows us to correctly identify
UnifiedPDFPlugin-originated scales vs. changes to the main frame page scale.

* Source/WebKit/WebProcess/Plugins/PluginView.h:

Canonical link: https://commits.webkit.org/275712@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