Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 71159ca28c24ddd39ba1891b9ec54f60a5e8413b
https://github.com/WebKit/WebKit/commit/71159ca28c24ddd39ba1891b9ec54f60a5e8413b
Author: Abrar Rahman Protyasha <[email protected]>
Date: 2025-05-01 (Thu, 01 May 2025)
Changed paths:
M Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.mm
M Tools/TestWebKitAPI/Tests/WebKitCocoa/UnifiedPDFTests.mm
Log Message:
-----------
WritingTools.PDFTextSelections API test crashes on debug iOS simulator
configuration
https://bugs.webkit.org/show_bug.cgi?id=292384
rdar://150456348
Reviewed by Aditya Keerthi and Wenson Hsieh.
The test was invoking `-[WKWebView selectTextInGranularity:atPoint:]`
with `UITextGranularityDocument`. This ends up being plumbed as a
`TextGranularity::DocumentGranularity` granularity argument in
`UnifiedPDFPlugin::selectionBetweenPoints()`. Since we previously
adopted the `-[PDFDocument selectionFromPage:...]` version with a
granualrity argument, we did not know how to handle document
granularity, and hit a debug assertion expressing as such.
While it's still inappropriate for us to call selectionFromPage: for the
DocumentGranularity case, this patch fixes the crash by reading the
`selectionForEntireDocument` property of PDFDocument, instead.
* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.mm:
(WebKit::UnifiedPDFPlugin::selectionBetweenPoints const):
* Tools/TestWebKitAPI/Tests/WebKitCocoa/UnifiedPDFTests.mm:
(TestWebKitAPI::UNIFIED_PDF_TEST):
New test: UnifiedPDF.SelectAllText
This test verifies that API users can either `selectAll:` or
`selectTextInGranularity:UITextGranularityDocument` to retrieve the full
text when a web view is presenting a main frame PDF document.
Canonical link: https://commits.webkit.org/294409@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