Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: d59fcec2dc3b52bc4ee17efb43945f604e9cbcd0
https://github.com/WebKit/WebKit/commit/d59fcec2dc3b52bc4ee17efb43945f604e9cbcd0
Author: Abrar Rahman Protyasha <[email protected]>
Date: 2026-05-14 (Thu, 14 May 2026)
Changed paths:
M Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.mm
M Tools/TestWebKitAPI/Helpers/cocoa/WebPage+Extras.swift
M Tools/TestWebKitAPI/Tests/WebKit/WKWebView/UnifiedPDFTests.mm
M Tools/TestWebKitAPI/Tests/WebKit/WebPage/AppKitGesturesTests.swift
Log Message:
-----------
[AppKit Gestures] Triple click does not generate a line selection on a PDF
file
https://bugs.webkit.org/show_bug.cgi?id=314804
rdar://177052413
Reviewed by Aditya Keerthi and Richard Robinson.
Right now, a triple click action leads to a .ParagraphGranularity
selection request from WebCore, but we fail to respect that and fallback
to a character granularity selection. Triple clicks, however, are used to
produce line selections for PDF content elsewhere in the system, namely
in Preview.app.
Since PDFKit performs this same decomposition from
NSTextSelectionGranularityParagraph to PDFSelectionGranularityLine for
this purpose, we just follow suit in this patch.
Test: AppKitGestureTests.tripleClickingInPDFSelectsLine
UnifiedPDF.TripleClickSelectsLineInPDF
* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.mm:
(WebKit::UnifiedPDFPlugin::documentEditingContext const):
* Tools/TestWebKitAPI/Helpers/cocoa/WebPage+Extras.swift:
(copySelection):
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/UnifiedPDFTests.mm:
(TestWebKitAPI::UNIFIED_PDF_TEST):
* Tools/TestWebKitAPI/Tests/WebKit/WebPage/AppKitGesturesTests.swift:
(AppKitGesturesTests.tripleClickingInPDFSelectsLine):
Canonical link: https://commits.webkit.org/313288@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications