[webkit-changes] [WebKit/WebKit] e5936d: [UnifiedPDF] Annotation tracking stops working whe...

Sammy Gill noreply at github.com
Mon Feb 26 20:16:47 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: e5936dcccb934ed15938c9a6374dac5964f230ab
      https://github.com/WebKit/WebKit/commit/e5936dcccb934ed15938c9a6374dac5964f230ab
  Author: Sammy Gill <sammy.gill at apple.com>
  Date:   2024-02-26 (Mon, 26 Feb 2024)

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

  Log Message:
  -----------
  [UnifiedPDF] Annotation tracking stops working when the mouse leaves the annotation.
https://bugs.webkit.org/show_bug.cgi?id=270117
rdar://123123950

Reviewed by Simon Fraser.

Currently annotation tracking begins in two scenarios:
1.) Mouse over of a texxt annotation
2.) Left click on other types of annotations

For the latter we finish tracking the annotation when the left mouse
button is released or if it is dragged off the tracked annotation. The
second case is incorrect, however, and we should contiue to keep track
of the annotation.

If the mouse is dragged off of the tracked annotation it should not be
highlighted anymore unless the mouse is dragged back onto it. If the
left mouse button is relased on the annotation then we want to perform
the associated action (e.g. activating a checkbox), but if it is
released off of the annotation then we should do nothing and just stop
tracking the annotation.

To accomplish the first part all we need to do is stop calling
finishTrackingAnnotation and instead call a new method:
updateTrackedAnnotation. All this new method does is update the
highlight of the tracked annotation but it does not modify the
annotation tracking state. For the second change, we need to pass in
the annotation under the mouse to finishTrackingAnnotation so the
annotation tracking state will only perform the associated action if
the annotation under the mouse is the annotation it is tracking.

One other small change that I made is to not change the cursor type when
the mouse is dragged off the annotation to make it consistent with
shipping.

* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.h:
* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.mm:
(WebKit::UnifiedPDFPlugin::handleMouseEvent):
(WebKit::UnifiedPDFPlugin::updateTrackedAnnotation):
(WebKit::UnifiedPDFPlugin::finishTrackingAnnotation):
(WebKit::AnnotationTrackingState::finishAnnotationTracking):

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