[webkit-changes] [WebKit/WebKit] fc167f: [UnifiedPDF] [iOS] Support text selection adjustme...
Wenson Hsieh
noreply at github.com
Thu Dec 12 20:24:47 PST 2024
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: fc167fd5d50cfa0a26daf54b11a68055355d85d5
https://github.com/WebKit/WebKit/commit/fc167fd5d50cfa0a26daf54b11a68055355d85d5
Author: Wenson Hsieh <wenson_hsieh at apple.com>
Date: 2024-12-12 (Thu, 12 Dec 2024)
Changed paths:
M Source/WebKit/Shared/ios/GestureTypes.h
M Source/WebKit/WebProcess/Plugins/PDF/PDFPluginBase.h
M Source/WebKit/WebProcess/Plugins/PDF/PDFPluginBase.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/ios/WebPageIOS.mm
Log Message:
-----------
[UnifiedPDF] [iOS] Support text selection adjustment with selection handles
https://bugs.webkit.org/show_bug.cgi?id=284582
rdar://141324936
Reviewed by Abrar Rahman Protyasha.
Add support for range adjustment text interactions (i.e. dragging selection handles to select text)
when using unified PDF on iOS. See below for more details.
* Source/WebKit/Shared/ios/GestureTypes.h:
Add a couple new selection-related enum types to help clarify the parameter/return type in the new
`moveSelectionEndpoint` method (see below).
* Source/WebKit/WebProcess/Plugins/PDF/PDFPluginBase.h:
* Source/WebKit/WebProcess/Plugins/PDF/PDFPluginBase.mm:
(WebKit::PDFPluginBase::moveSelectionEndpoint):
* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.h:
* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.mm:
(WebKit::UnifiedPDFPlugin::setSelectionRange):
Adopt the new `rootViewToPage` helper below.
(WebKit::UnifiedPDFPlugin::moveSelectionEndpoint):
Add a new helper method to handle selection changes triggered by the user moving one of the
selection endpoints with a loupe gesture on iOS. This handles selection flipping by detecting when
the location of the selection base (i.e. the stationary selection range endpoint) has moved, and
surfaces `SelectionWasFlipped::Yes` back to UIKit in order to allow the system text interaction UI
to swap the selection start and end handles on the fly.
(WebKit::UnifiedPDFPlugin::selectionCaretPointInPage):
(WebKit::UnifiedPDFPlugin::selectionCaretPointInPage const):
Add a couple of helper methods to compute the selection start/end points, relative to page
coordinates. Returns both a point, and a `PDFPage` that is the the point's coordinate space.
(WebKit::UnifiedPDFPlugin::rootViewToPage const):
Pull out some existing code to map a point from root view coordinates to a PDF page out into a
separate helper. This returns both the new mapped point, as well as the `PDFPage` that the point is
relative to.
* Source/WebKit/WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::moveSelectionEndpoint):
* Source/WebKit/WebProcess/Plugins/PluginView.h:
* Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::updateSelectionWithTouches):
Add a hook to defer to the PDF plugin, if present.
Canonical link: https://commits.webkit.org/287780@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