[webkit-changes] [WebKit/WebKit] 1f4e15: [UnifiedPDF] Data detector borders are unstable du...

Abrar Rahman Protyasha noreply at github.com
Fri May 31 08:49:25 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 1f4e1577f355f4a93eb0f3c0a34e08459356654c
      https://github.com/WebKit/WebKit/commit/1f4e1577f355f4a93eb0f3c0a34e08459356654c
  Author: Abrar Rahman Protyasha <a_protyasha at apple.com>
  Date:   2024-05-31 (Fri, 31 May 2024)

  Changed paths:
    M Source/WebCore/platform/mac/DataDetectorHighlight.h
    M Source/WebCore/platform/mac/DataDetectorHighlight.mm
    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.h
    M Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.mm

  Log Message:
  -----------
  [UnifiedPDF] Data detector borders are unstable during zoom
https://bugs.webkit.org/show_bug.cgi?id=274942
rdar://128865849

Reviewed by Simon Fraser.

Any active data detector overlay is constantly repainted during a
magnification gesture because we used to call into
didInvalidateHighlightOverlayRects whenever we were in the plugin's
setScaleFactor method. This resulted in the overlay looking unstable and
a little jumpy when pinching in/out.

To deal with this, we follow the precedent set by ImageOverlayController
and dismiss any active highlight during a magnification gesture. In
addition, we disallow the DD overlay controller to present DD overlay
rects in general during a pinch zoom.

We achieve this by:

1. Introducing the canShowDataDetectorHighlightOverlays method on the
   plugin, which is consulted before highlight presentation.

2. Providing WebCore::DataDetectorHighlight instances the ability to be
   dismissed immediately, rather than just being faded out.

* Source/WebCore/platform/mac/DataDetectorHighlight.h:
* Source/WebCore/platform/mac/DataDetectorHighlight.mm:
(WebCore::DataDetectorHighlight::dismissImmediately):
* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/PDFDataDetectorOverlayController.h:
* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/PDFDataDetectorOverlayController.mm:
(WebKit::PDFDataDetectorOverlayController::hideActiveHighlightOverlay):
(WebKit::PDFDataDetectorOverlayController::didInvalidateHighlightOverlayRects):
* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.h:
* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.mm:
(WebKit::UnifiedPDFPlugin::canShowDataDetectorHighlightOverlays const):
(WebKit::UnifiedPDFPlugin::didBeginMagnificationGesture):
(WebKit::UnifiedPDFPlugin::setScaleFactor):

Canonical link: https://commits.webkit.org/279581@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