forked from WebKit/WebKit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[UnifiedPDF] [iOS] Add support for Share/Translate with selected text
https://bugs.webkit.org/show_bug.cgi?id=284646 rdar://141448279 Reviewed by Abrar Rahman Protyasha and Aditya Keerthi. Add support for extracting text from unified PDF plugins, so that text services on iOS (e.g. translate, share, look up) work properly. * Source/WebKit/WebProcess/Plugins/PDF/PDFPluginBase.h: (WebKit::PDFPluginBase::fullDocumentString const): * Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.h: * Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.mm: (WebKit::UnifiedPDFPlugin::fullDocumentString const): * Source/WebKit/WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::fullDocumentString const): * Source/WebKit/WebProcess/Plugins/PluginView.h: * Source/WebKit/WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::getSelectionOrContentsAsString): Defer to the PDF plugin if needed — this returns the `selectionString()` if present, and otherwise falls back to `fullDocumentString()` if there is no selection. * Tools/TestWebKitAPI/Tests/WebKitCocoa/UnifiedPDFTests.mm: (TestWebKitAPI::UNIFIED_PDF_TEST): * Tools/TestWebKitAPI/cocoa/TestWKWebView.h: * Tools/TestWebKitAPI/cocoa/TestWKWebView.mm: (-[TestWKWebView textForSpeakSelection]): Add a new API test hook to synchronously request the text content for "Speak Selection". (-[TestWKWebView _accessibilityDidGetSpeakSelectionContent:]): Use the above testing helper to verify that "Speak Selection" (which exercises this same codepath) now works when Unified PDF is enabled. Canonical link: https://commits.webkit.org/287819@main
- Loading branch information
Showing
9 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters