[webkit-changes] [WebKit/WebKit] 8250b6: [UnifiedPDF] Selections should no longer be tracke...

Abrar Rahman Protyasha noreply at github.com
Sun Feb 11 02:26:26 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 8250b6757382e71497e86efb939be39112150fc0
      https://github.com/WebKit/WebKit/commit/8250b6757382e71497e86efb939be39112150fc0
  Author: Abrar Rahman Protyasha <a_protyasha at apple.com>
  Date:   2024-02-11 (Sun, 11 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] Selections should no longer be tracked when window loses focus
https://bugs.webkit.org/show_bug.cgi?id=269149
rdar://122722850

Reviewed by Tim Horton.

We were not formally distinguishing when a selection should be tracked,
with the wrong assumption that all selection tracking interactions would
start with a mousedown event. This means that we may pick up bogus
selections when we click on the PDF while out of focus, since that sends
a mousemove event to the plugin, which causes us to extend the selection
based on stale selection tracking data.

This commit corrects against such cases by ensuring we stay aware of
when a selection is being actively tracked. We only activate selection
tracking if we execute beginTrackingSelection, and explicitly deactivate
selection tracking if we receive a mouseup event or we have interacted
with a context menu.

* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.h:
* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.mm:
(WebKit::UnifiedPDFPlugin::handleMouseEvent):
(WebKit::UnifiedPDFPlugin::handleContextMenuEvent):
(WebKit::UnifiedPDFPlugin::extendCurrentSelectionIfNeeded):
(WebKit::UnifiedPDFPlugin::continueTrackingSelection):

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




More information about the webkit-changes mailing list