Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[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
- Loading branch information