Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: bbd3a8dd40bdb2cbbe6d8f20cf98bf18ee430619
      
https://github.com/WebKit/WebKit/commit/bbd3a8dd40bdb2cbbe6d8f20cf98bf18ee430619
  Author: Aditya Keerthi <akeer...@apple.com>
  Date:   2024-04-15 (Mon, 15 Apr 2024)

  Changed paths:
    M Source/WebKit/WebProcess/Plugins/PDF/PDFPluginBase.h
    M Source/WebKit/WebProcess/Plugins/PDF/PDFPluginBase.mm
    M 
Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/PDFDataDetectorOverlayController.mm
    M Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.h
    M Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.mm

  Log Message:
  -----------
  [Unified PDF] Data Detectors are offset from detected items on embedded PDFs
https://bugs.webkit.org/show_bug.cgi?id=272684
rdar://126232906

Reviewed by Abrar Rahman Protyasha.

276131@main added support for Data Detectors for Unified PDF. However, the
geometry used for highlights was using the plugin's coordinate space. This is
incorrect for embedded PDFs, as the `PageOverlay` uses `OverlayType::Document`.

Fix by ensuring all highlight geometry uses the main frame's contents
coordinate space.

* Source/WebKit/WebProcess/Plugins/PDF/PDFPluginBase.h:
* Source/WebKit/WebProcess/Plugins/PDF/PDFPluginBase.mm:
(WebKit::PDFPluginBase::lastKnownMousePositionInView const):
(WebKit::PDFPluginBase::mousePositionInView const): Deleted.

Revert the change made in 276131@main, as this method now has a single use,
inside the same class.

* 
Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/PDFDataDetectorOverlayController.mm:
(WebKit::PDFDataDetectorOverlayController::createPlatformDataDetectorHighlight 
const):
(WebKit::PDFDataDetectorOverlayController::handleMouseEvent):
(WebKit::PDFDataDetectorOverlayController::handleDataDetectorAction):

Click information should be in the window's coordinate space.

(WebKit::PDFDataDetectorOverlayController::didInvalidateHighlightOverlayRects):
* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.h:
* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.mm:
(WebKit::UnifiedPDFPlugin::mainFrameView const):

Expose the main frame's `FrameView`, so that the overlay controller can get
the `visibleContentRect`, and convert between coordinate spaces.

(WebKit::UnifiedPDFPlugin::rectForSelectionInMainFrameContentsSpace const):

Similar to `ServicesOverlayController`, the only way to convert to document
coordinates is to call `contentsToWindow` and then `windowToContents`.

(WebKit::UnifiedPDFPlugin::rectForSelectionInPluginSpace const): Deleted.

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to