[webkit-changes] [WebKit/WebKit] d8546c: [Unified PDF] Viewport pushed to the side when zoo...

Rupin Mittal noreply at github.com
Fri Feb 21 02:05:10 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: d8546c304004058e1934ab9c08ee4c5b73f10791
      https://github.com/WebKit/WebKit/commit/d8546c304004058e1934ab9c08ee4c5b73f10791
  Author: Rupin Mittal <rupin at apple.com>
  Date:   2025-02-21 (Fri, 21 Feb 2025)

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

  Log Message:
  -----------
  [Unified PDF] Viewport pushed to the side when zooming and change to landscape
https://bugs.webkit.org/show_bug.cgi?id=288161
rdar://144616173

Reviewed by Wenson Hsieh.

Previously, we set the width of the HTMLPluginElement to be exactly the
width of the content (the PDFDocument in this case). This meant that
upon rotating to landscape, the HTMLPluginElement's width wouldn't change.
But the ViewPort's width would increase, so the HTMLPluginElement would
have a smaller width and make it appear as if it's off to the side.

To ensure that the HTMLPluginElement is centered, we now ensure that
it's width matches the width of the ViewPort. We do this by removing
the line that makes the width match the content's width. Without this,
the HTMLPluginElement will use the ViewPort's width.

* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.mm:
(WebKit::UnifiedPDFPlugin::sizeToFitContentsIfNeeded):

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