[webkit-changes] [WebKit/WebKit] 31189e: [UnifiedPDF] [iOS] Plugin should not handle scale ...

Abrar Rahman Protyasha noreply at github.com
Wed Feb 12 12:28:10 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 31189e349c98f949823e56eb195be961c19b5650
      https://github.com/WebKit/WebKit/commit/31189e349c98f949823e56eb195be961c19b5650
  Author: Abrar Rahman Protyasha <a_protyasha at apple.com>
  Date:   2025-02-12 (Wed, 12 Feb 2025)

  Changed paths:
    M Source/WebKit/UIProcess/API/ios/WKWebViewIOS.h
    M Source/WebKit/UIProcess/API/ios/WKWebViewIOS.mm
    M Source/WebKit/UIProcess/PageClient.h
    M Source/WebKit/UIProcess/WebPageProxy.cpp
    M Source/WebKit/UIProcess/WebPageProxy.h
    M Source/WebKit/UIProcess/WebPageProxy.messages.in
    M Source/WebKit/UIProcess/ios/PageClientImplIOS.h
    M Source/WebKit/UIProcess/ios/PageClientImplIOS.mm
    M Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm
    M Source/WebKit/WebProcess/Plugins/PDF/PDFPluginBase.h
    M Source/WebKit/WebProcess/Plugins/PDF/PDFPluginBase.mm
    M Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/PDFScrollingPresentationController.mm
    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
    M Source/WebKit/WebProcess/WebPage/WebPage.cpp
    M Source/WebKit/WebProcess/WebPage/WebPage.h
    M Source/WebKit/WebProcess/WebPage/WebPage.messages.in
    M Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm

  Log Message:
  -----------
  [UnifiedPDF] [iOS] Plugin should not handle scale factor updates
https://bugs.webkit.org/show_bug.cgi?id=287475
rdar://144415916

Reviewed by Sammy Gill.

On iOS, we are currently applying scale factor updates on both the main
frame and on the plugin. This causes the subscrollable region under the
plugin to assume a separate scale factor (and independent scroll bar!),
which manifests in issues such as unstable pinch zoom origins, broken
keyboard scrolling, and unexpected rubberbanding.

This patch continues the direction set by 288932 at main. We persist the
"plugin fits content" behavior on scale factor updates (either through
pinch zoom gestures or through programmatic zooming) by opting _out_ of
handling said scale factor updates. Note that we do so only for iOS
family. This makes main frame PDF plugin behavior (on iOS) align with
subframe PDF plugin behavior (on all platforms).

This patch needs to be followed up with more polish. Currently, we do
not respect the scale limits for the plugin (min: 1, max: 6) and instead
fall back to those for general web content (max: 5). This is tracked in
webkit.org/b/287508. Moreover, we need to actually apply page scale
updates to the core Page object under updateVisibleContentRects. We omit
that change from this patch because currently that causes us to easily
exhaust the GPU process. This is being tracked in webkit.org/b/287511.

* Source/WebKit/UIProcess/API/ios/WKWebViewIOS.h:
* Source/WebKit/UIProcess/API/ios/WKWebViewIOS.mm:
(-[WKWebView scrollViewWillBeginZooming:withView:]):
(-[WKWebView scrollViewDidZoom:]):
(-[WKWebView scrollViewDidEndZooming:withView:atScale:]):
(-[WKWebView _pluginDidInstallPDFDocument:]): Deleted.
* Source/WebKit/UIProcess/PageClient.h:
(WebKit::PageClient::pluginDidInstallPDFDocument): Deleted.
* Source/WebKit/UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::minPageZoomFactor const):
(WebKit::WebPageProxy::maxPageZoomFactor const):
(WebKit::WebPageProxy::didCommitLoadForFrame):
(WebKit::WebPageProxy::mainFramePluginHandlesPageScaleGestureDidChange):
(WebKit::WebPageProxy::setPluginScaleFactor): Deleted.
* Source/WebKit/UIProcess/WebPageProxy.h:
* Source/WebKit/UIProcess/WebPageProxy.messages.in:
* Source/WebKit/UIProcess/ios/PageClientImplIOS.h:
* Source/WebKit/UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::pluginDidInstallPDFDocument): Deleted.
* Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::pluginDidInstallPDFDocument): Deleted.
* Source/WebKit/WebProcess/Plugins/PDF/PDFPluginBase.h:
(WebKit::PDFPluginBase::shouldRespectPageScaleAdjustments const): Deleted.
* Source/WebKit/WebProcess/Plugins/PDF/PDFPluginBase.mm:
(WebKit::PDFPluginBase::handlesPageScaleFactor const):
* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/PDFScrollingPresentationController.mm:
(WebKit::PDFScrollingPresentationController::paintContents):
* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.h:
* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.mm:
(WebKit::UnifiedPDFPlugin::installPDFDocument):
(WebKit::UnifiedPDFPlugin::didEndMagnificationGesture):
(WebKit::UnifiedPDFPlugin::shouldRespectPageScaleAdjustments const): Deleted.
* Source/WebKit/WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::pluginScaleFactorDidChange):
(WebKit::PluginView::initializePlugin):
(WebKit::PluginView::pluginHandlesPageScaleFactor const):
(WebKit::PluginView::pluginDidInstallPDFDocument): Deleted.
(WebKit::PluginView::shouldRespectPageScaleAdjustments const): Deleted.
* Source/WebKit/WebProcess/Plugins/PluginView.h:
* Source/WebKit/WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::textZoomFactor const):
(WebKit::WebPage::didSetTextZoomFactor):
(WebKit::WebPage::pageZoomFactor const):
(WebKit::WebPage::didSetPageZoomFactor):
(WebKit::WebPage::didScalePage):
(WebKit::WebPage::totalScaleFactor const):
(WebKit::WebPage::scaleView):
(WebKit::WebPage::handlesPageScaleGesture):
(WebKit::WebPage::setPluginScaleFactor): Deleted.
(WebKit::WebPage::pluginDidInstallPDFDocument): Deleted.
* Source/WebKit/WebProcess/WebPage/WebPage.h:
* Source/WebKit/WebProcess/WebPage/WebPage.messages.in:
* Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::updateVisibleContentRects):
(WebKit::WebPage::willStartUserTriggeredZooming):

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