[webkit-changes] [WebKit/WebKit] 917864: UnifiedPDF: Paint wash and holes for find matches
Tim Horton
noreply at github.com
Thu Feb 15 17:13:52 PST 2024
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 9178642d517556d27941c905e8a8255af40fcc71
https://github.com/WebKit/WebKit/commit/9178642d517556d27941c905e8a8255af40fcc71
Author: Tim Horton <thorton at apple.com>
Date: 2024-02-15 (Thu, 15 Feb 2024)
Changed paths:
M Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.h
M Source/WebKit/WebProcess/Plugins/PDF/PDFPluginBase.h
M Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/PDFDocumentLayout.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/WebCoreSupport/WebChromeClient.cpp
M Source/WebKit/WebProcess/WebPage/FindController.cpp
M Source/WebKit/WebProcess/WebPage/FindController.h
Log Message:
-----------
UnifiedPDF: Paint wash and holes for find matches
https://bugs.webkit.org/show_bug.cgi?id=269493
rdar://123028742
Reviewed by Simon Fraser.
* Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.h:
* Source/WebKit/WebProcess/Plugins/PDF/PDFPluginBase.h:
(WebKit::PDFPluginBase::rectsForTextMatchesInRect):
* Source/WebKit/WebProcess/WebPage/FindController.cpp:
(WebKit::FindController::updateFindUIAfterPageScroll):
(WebKit::FindController::rectsForTextMatchesInRect):
(WebKit::FindController::didInvalidateFindRects):
(WebKit::FindController::didInvalidateDocumentMarkerRects): Deleted.
* Source/WebKit/WebProcess/WebPage/FindController.h:
* Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::didInvalidateDocumentMarkerRects):
* Source/WebKit/WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::rectsForTextMatchesInRect):
(WebKit::PluginView::drawsFindOverlay const):
* Source/WebKit/WebProcess/Plugins/PluginView.h:
Have FindController defer to the plugin as to whether it wants the find overlay,
and to retrieve the rectangles for the holes.
* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/PDFDocumentLayout.mm:
(WebKit::PDFDocumentLayout::pdfPageRectToDocumentRect const):
Actually flip this rectangle, instead of just moving it.
* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.h:
* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.mm:
(WebKit::UnifiedPDFPlugin::didChangeScrollOffset):
Invalidate find rects when we scroll. For now they'll scroll asynchronously
in the main find overlay, but we should move them into an overlay layer that\
scrolls with the PDF instead.
(WebKit::compareOptionsForFindOptions):
Factor this conversion out of findString.
(WebKit::UnifiedPDFPlugin::findString):
When the find string changes, rebuild the cached set of match rects.
(WebKit::UnifiedPDFPlugin::collectFindMatchRects):
Maintain a set of rects for all of the matches, in document coordinates.
(WebKit::UnifiedPDFPlugin::rectsForTextMatchesInRect):
Convert and return the rects in plugin coordinates. This only works for
the main frame plugin, but FindController is only hooked up for the main
frame plugin for now.
(WebKit::UnifiedPDFPlugin::pluginBoundsForAnnotation const):
Un-work-around the missing flip in pdfPageRectToDocumentRect.
Canonical link: https://commits.webkit.org/274781@main
More information about the webkit-changes
mailing list