[webkit-changes] [WebKit/WebKit] 2689d1: [UnifiedPDF] [iOS] REGRESSION(290293 at main): Main f...

Abrar Rahman Protyasha noreply at github.com
Tue Feb 18 14:54:12 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 2689d158dbf1cd53cb306f6732a9f1fc1de90de7
      https://github.com/WebKit/WebKit/commit/2689d158dbf1cd53cb306f6732a9f1fc1de90de7
  Author: Abrar Rahman Protyasha <a_protyasha at apple.com>
  Date:   2025-02-18 (Tue, 18 Feb 2025)

  Changed paths:
    M Source/WebCore/platform/graphics/IntPoint.h
    M Source/WebKit/WebProcess/Plugins/PluginView.cpp
    M Source/WebKit/WebProcess/WebPage/WebPage.cpp
    M Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm

  Log Message:
  -----------
  [UnifiedPDF] [iOS] REGRESSION(290293 at main): Main frame PDF content is not sharp on pinch zoom
https://bugs.webkit.org/show_bug.cgi?id=287511
rdar://144640298

Reviewed by Wenson Hsieh.

In 290293 at main, we opted out of applying page scale factor updates on
main frame plugins in the iOS family. However, we did not adequately
replace this with scale factor application on the core page instead,
which resulted in entirely dropping page scale factor updates when a
main frame plugin is displayed. The most notable symptom of this root
cause is PDF content that is not sharp.

We address the issue in this patch as such:

1. During visible content rect updates, if the page has a main frame
   plugin that does not handle page scale factors, actually apply this
   factor on the core page instead.
2. ... with the caveat that we want to gate this application behind a
   stable state, i.e. not intermediate pinch zoom updates.
3. Ignore the root view to plugin transformation for full main frame
   plugins that do not handle scale factor updates. Without this, text
   selections (and likely annotations had we supported them fully) look
   out of place during pinch gestures, almost as if they were double
   zoomed. This approach likely papers over the real transformation
   issue at hand and would probably not fly if we supported text
   selections on embedded PDFs in iOS, but that is a bridge to cross for
   later.

* Source/WebCore/platform/graphics/IntPoint.h:
(WebCore::IntPoint::scaled const):

Introduce a constexpr const method of receiving a scaled IntPoint
instance, then adopt said methods in PluginView::viewGeometryDidChange.

* Source/WebKit/WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::viewGeometryDidChange):
* Source/WebKit/WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::didScalePage):

Drive-by fix: Make sure to call into platformDidScalePage() whenever
scale factor is changed, so as to not mess up layer tree transaction
bookkeeping.

* Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::updateVisibleContentRects):

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