[webkit-changes] [WebKit/WebKit] 94e2e0: [UnifiedPDF] Only update platform highlight data f...

Abrar Rahman Protyasha noreply at github.com
Mon Mar 18 20:53:03 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 94e2e0c433d20ef173dd08f404c1d3603b29c0db
      https://github.com/WebKit/WebKit/commit/94e2e0c433d20ef173dd08f404c1d3603b29c0db
  Author: Abrar Rahman Protyasha <a_protyasha at apple.com>
  Date:   2024-03-18 (Mon, 18 Mar 2024)

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

  Log Message:
  -----------
  [UnifiedPDF] Only update platform highlight data for page(s) of interest
https://bugs.webkit.org/show_bug.cgi?id=271203
rdar://124976470

Reviewed by Simon Fraser.

DDHighlightData is required for hit testing and to reflect zooming or
scrolling. As such, we only care about updating platform highlight data
on the page where we need to handle a mouse event, or on the page where
a zoom or scroll operation occurred.

This patch updates didInvalidateHighlightOverlayRects to accept an
optional page index to limit which page's platform highlight data
requires updating. If the caller fails to provide an index, or if that
index does not already exist in our highlight map, we fallback to the
existing behavior of updating the highlight data on all pages.

This is a performance optimization for large PDF files since we avoid
unnecessarily iterating through all pages containing data detector
results.

* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/PDFDataDetectorOverlayController.h:
* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/PDFDataDetectorOverlayController.mm:
(WebKit::PDFDataDetectorOverlayController::handleMouseEvent):
(WebKit::PDFDataDetectorOverlayController::updatePlatformHighlightData):
(WebKit::PDFDataDetectorOverlayController::didInvalidateHighlightOverlayRects):
* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.mm:
(WebKit::UnifiedPDFPlugin::didChangeScrollOffset):

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



To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications


More information about the webkit-changes mailing list