Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: b3ccba3d047d8f956609df0364fd5b7b95a71efa
      
https://github.com/WebKit/WebKit/commit/b3ccba3d047d8f956609df0364fd5b7b95a71efa
  Author: Abrar Rahman Protyasha <a_protya...@apple.com>
  Date:   2023-12-04 (Mon, 04 Dec 2023)

  Changed paths:
    M Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/PDFDocumentLayout.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

  Log Message:
  -----------
  [UnifiedPDF] UnifiedPDFPlugin should be able to query PDFKit for annotations 
under a page point
https://bugs.webkit.org/show_bug.cgi?id=265810
rdar://119147700

Reviewed by Tim Horton.

We currently don't perform the required transformations to map a point
from the root view to the page space, and as such cannot perform
hit-testing to get the PDFAnnotation objects of interest under a page
point.

This commit introduces the required coordinate space plumbing so that
UnifiedPDFPlugin is able to reason in the PDFPage space. This allows us
to query PDFPage for annotations under a given point, which we need in
anticipation of getting cursor updates to work correctly over text and
other annotation types.

* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/PDFDocumentLayout.h:
(WebKit::PDFDocumentLayout::displayMode const):

Make displayMode publicly accessible.

* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/PDFDocumentLayout.mm:
(WebKit::PDFDocumentLayout::updateLayout):
(WebKit::PDFDocumentLayout::layoutSingleColumn):
(WebKit::PDFDocumentLayout::layoutTwoUpColumn):
(WebKit::PDFDocumentLayout::documentMargin): Deleted.
(WebKit::PDFDocumentLayout::pageMargin): Deleted.

Move these to just be static constexpr properties on PDFDocumentLayout,
and adopt the change at call-sites.

* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.h:
* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.mm:
(WebKit::UnifiedPDFPlugin::convertFromPluginToDocument const):
(WebKit::UnifiedPDFPlugin::nearestPageIndexForDocumentPoint const):
(WebKit::UnifiedPDFPlugin::convertFromDocumentToPage const):
(WebKit::UnifiedPDFPlugin::pdfElementTypesForPluginPoint const):

Introduce functions that return the data reflected by their names, all
to be consumed by pdfElementTypesForPluginPoint in anticipation of
cursor updates.

(WebKit::UnifiedPDFPlugin::performContextMenuAction const):
(WebKit::UnifiedPDFPlugin::handleContextMenuEvent):

Drive-by fix, make `#endif` scopes clearer.

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


_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to