[webkit-changes] [WebKit/WebKit] 8147bb: [UnifiedPDF] Text annotations do not have blue bac...

Sammy Gill noreply at github.com
Wed Feb 7 22:49:45 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 8147bb3d60a35215dcb9493678a34f1673f9329d
      https://github.com/WebKit/WebKit/commit/8147bb3d60a35215dcb9493678a34f1673f9329d
  Author: Sammy Gill <sammy.gill at apple.com>
  Date:   2024-02-07 (Wed, 07 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] Text annotations do not have blue background on hover
https://bugs.webkit.org/show_bug.cgi?id=268497
rdar://problem/122041412

Reviewed by Tim Horton.

In order to display the blue rectangle that appears when a mouse cursor
is over a text annotation we must first start keeping track of that
in AnnotationTrackingState. We can simply add a new field there that
keepts track of this and can be queried later on when we need to check
if we need to paint it over the text annotation field.

startAnnotationTracking will set this field if the mouse event type
is a mouse move and no mouse button was pressed. This bit will get
reset when the client determines the mouse has moved off the text
annotation and calls finishAnnotationTracking().

If the mouse cursor is hovering over a text annotation and the left
mouse button is clicked to bring up the HTML input, then the blue
rectangle should still appear after the text has been inputted and if
the cursor did not move off the annotation. If the cursor moves off
the annotation then the blue rectangle should not appear the text has
been inputted even if it is brought back on top of the cursor while the
HTML input is up.

* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.h:
(WebKit::AnnotationTrackingState::trackedAnnotation const):
* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.mm:
(WebKit::UnifiedPDFPlugin::paintPDFContent):
(WebKit::textAnnotationHoverColor):
(WebKit::UnifiedPDFPlugin::paintPDFOverlays):
(WebKit::UnifiedPDFPlugin::handleMouseEvent):
(WebKit::AnnotationTrackingState::startAnnotationTracking):
(WebKit::AnnotationTrackingState::finishAnnotationTracking):
(WebKit::AnnotationTrackingState::handleMouseDraggedOffTrackedAnnotation):
(WebKit::AnnotationTrackingState::isBeingHovered const):
(WebKit::AnnotationTrackingState::resetAnnotationTrackingState):

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




More information about the webkit-changes mailing list