Skip to content

[UnifiedPDF] Cursor updates are incorrect over text/image elements for untagged PDFs.#25064

Merged
webkit-commit-queue merged 1 commit intoWebKit:mainfrom
aprotyas:eng/265908
Feb 24, 2024
Merged

[UnifiedPDF] Cursor updates are incorrect over text/image elements for untagged PDFs.#25064
webkit-commit-queue merged 1 commit intoWebKit:mainfrom
aprotyas:eng/265908

Conversation

@aprotyas
Copy link
Member

@aprotyas aprotyas commented Feb 24, 2024

bcb2f89

[UnifiedPDF] Cursor updates are incorrect over text/image elements for untagged PDFs.
https://bugs.webkit.org/show_bug.cgi?id=265908
rdar://119217538

Reviewed by Tim Horton.

The CGPDFPageLayoutGetAreaOfInterestAtPoint interface does not correctly
identify text/image elements on Untagged PDF files. This made our hit
test results incomplete on said PDF files. To address this issue, we
adopt new PDFPage API `areaOfInterestAtPoint`, which not only hit tests
for annotations, but also for text and image on a page, thus subsuming
both -[PDFPage annotationAtPoint:] and CGPDFPageLayoutGetAreaOfInterestAtPoint
while maintaining correctness across tagged and untagged PDFs.

* Source/WebKit/Platform/spi/Cocoa/PDFKitSPI.h:
* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.mm:
(WebKit::UnifiedPDFPlugin::pdfElementTypesForPluginPoint const):

Canonical link: https://commits.webkit.org/275287@main

d5a5e06

Misc iOS, tvOS & watchOS macOS Linux Windows
✅ 🧪 style ✅ 🛠 ios ✅ 🛠 mac ✅ 🛠 wpe ✅ 🛠 wincairo
✅ 🛠 ios-sim ✅ 🛠 mac-AS-debug ✅ 🧪 wpe-wk2
✅ 🧪 webkitperl ✅ 🧪 ios-wk2 ✅ 🧪 api-mac ✅ 🧪 api-wpe
✅ 🧪 ios-wk2-wpt ✅ 🛠 gtk
✅ 🧪 api-ios ✅ 🧪 mac-wk2 ✅ 🧪 gtk-wk2
✅ 🛠 tv ✅ 🧪 mac-AS-debug-wk2 ✅ 🧪 api-gtk
✅ 🛠 tv-sim
✅ 🛠 🧪 merge ✅ 🛠 watch
✅ 🛠 watch-sim

@aprotyas aprotyas requested a review from cdumez as a code owner February 24, 2024 19:20
@aprotyas aprotyas self-assigned this Feb 24, 2024
@aprotyas aprotyas added the PDF For bugs in WebKit's built-in PDF support. label Feb 24, 2024
@webkit-early-warning-system
Copy link
Collaborator

webkit-early-warning-system commented Feb 24, 2024

@aprotyas aprotyas added the merge-queue Applied to send a pull request to merge-queue label Feb 24, 2024
@aprotyas
Copy link
Member Author

Thanks for the review!

…r untagged PDFs.

https://bugs.webkit.org/show_bug.cgi?id=265908
rdar://119217538

Reviewed by Tim Horton.

The CGPDFPageLayoutGetAreaOfInterestAtPoint interface does not correctly
identify text/image elements on Untagged PDF files. This made our hit
test results incomplete on said PDF files. To address this issue, we
adopt new PDFPage API `areaOfInterestAtPoint`, which not only hit tests
for annotations, but also for text and image on a page, thus subsuming
both -[PDFPage annotationAtPoint:] and CGPDFPageLayoutGetAreaOfInterestAtPoint
while maintaining correctness across tagged and untagged PDFs.

* Source/WebKit/Platform/spi/Cocoa/PDFKitSPI.h:
* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.mm:
(WebKit::UnifiedPDFPlugin::pdfElementTypesForPluginPoint const):

Canonical link: https://commits.webkit.org/275287@main
@webkit-commit-queue
Copy link
Collaborator

Committed 275287@main (bcb2f89): https://commits.webkit.org/275287@main

Reviewed commits have been landed. Closing PR #25064 and removing active labels.

@webkit-commit-queue webkit-commit-queue merged commit bcb2f89 into WebKit:main Feb 24, 2024
@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Feb 24, 2024
@aprotyas aprotyas deleted the eng/265908 branch February 24, 2024 22:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PDF For bugs in WebKit's built-in PDF support.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants