Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 4aebedeb66526aa469f882e0fae0e91b50833f99
      
https://github.com/WebKit/WebKit/commit/4aebedeb66526aa469f882e0fae0e91b50833f99
  Author: Sammy Gill <[email protected]>
  Date:   2024-10-10 (Thu, 10 Oct 2024)

  Changed paths:
    M Source/WebCore/page/ViewportConfiguration.cpp
    M Source/WebCore/page/ViewportConfiguration.h
    M Source/WebKit/WebProcess/Plugins/PluginView.cpp
    M Source/WebKit/WebProcess/WebPage/WebPage.h
    M Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm

  Log Message:
  -----------
  [UnifiedPDF][iOS] Create plugin specific viewport configuration.
https://bugs.webkit.org/show_bug.cgi?id=281167
rdar://137627221

Reviewed by Wenson Hsieh and Abrar Rahman Protyasha.

Main frame PDFs iOS currently have their viewport configuration set to 
ViewportConfiguration::webpageParameters
which uses defaultDesktopViewportWidth as the width of the content's viewport. 
This ends
up causing a number of issues that restrict us from getting any sort of scales 
correct
as we end up incorrectly sizing the plugin. In this patch we create a viewport 
configuration
that is specific to plugins so that we can tailor the parameters as appropriate 
for this
specific case.

This configuration is mostly the same as nativeWebpageParameters with the 
maximum scale
set to 1. We do this to avoid accidentally setting the page scale factor to any 
other
scales since the plugin is completely responsible for managing its scale. We 
may need to
fine tune this configuration a bit more in the future but this should hopefully 
serve as
a sane initial set that we can build upon.

We set this configuration when we initialize the plugin in 
PluginView::setParent by
informing the web page that we have initialized the plugin. The web page will 
then set
the viewport configuration to this new plugin specific one.

* Source/WebCore/page/ViewportConfiguration.cpp:
(WebCore::ViewportConfiguration::pluginParameters):
* Source/WebCore/page/ViewportConfiguration.h:
* Source/WebKit/WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::setParent):
* Source/WebKit/WebProcess/WebPage/WebPage.h:
* Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::resetViewportDefaultConfiguration):
(WebKit::WebPage::didInitializePlugin):

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to