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

  Changed paths:
    M Source/WebKit/UIProcess/API/ios/WKWebViewIOS.mm
    M Source/WebKit/UIProcess/WebPageProxy.cpp
    M Source/WebKit/UIProcess/WebPageProxy.h
    M Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.mm
    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] Zooming is broken if you scroll.
https://bugs.webkit.org/show_bug.cgi?id=280391
rdar://136700050

Reviewed by Abrar Rahman Protyasha and Wenson Hsieh.

In 283888@main, we attempted an initial implementation of zooming on iOS 
UnifiedPDF. This
implementation revolved around taking the new visible content rect from UIKit 
and having
the plugin scroll directly to the new rect's origin. While this was a decent 
first attempt,
this approach comes with some glaring issues that would require a drastic 
approach to
fix.

For example, if you scroll and then attempt to zoom in, then the plugin would 
end up
zooming into the first page. This issue and others seem to be due to the fact 
that the
plugin itself is a subscroller, and thus any scrolling offsets are not properly 
reflected
in the root UIScrollView and end up getting incorrect geometry for the visible 
content
rect.

In this patch, we opt to rework this approach and dedicate more of the work to 
the plugin.
This is done by giving the plugin the origin of the gesture in the scroll view 
along with
the scale factor. Instead of updating the plugin's scale factor via visible 
content rect
updates, we will send the scale and origin through a new IPC as we get them. 
This brings
our iOS logic more in line with our macOS implementation, and we can actually 
end up
reusing much of the scale factor logic we already had in the plugin.

Overall, this approach seems to be a much better improvement from our first 
attempt.
Zooming in and out of the PDF seems to be much more stable. There are still 
some wrinkles
that need to be ironed out, but from a first glance, the issues do seem to be 
much more
manageable.

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