Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 9da7290f216c59af48811f6a5e3fad3d468dfbb8
      
https://github.com/WebKit/WebKit/commit/9da7290f216c59af48811f6a5e3fad3d468dfbb8
  Author: Abrar Rahman Protyasha <a_protya...@apple.com>
  Date:   2024-04-05 (Fri, 05 Apr 2024)

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

  Log Message:
  -----------
  [UnifiedPDF] Selection needs to keep tracking the mouse when it's dragged 
outside of the page area
https://bugs.webkit.org/show_bug.cgi?id=269012
rdar://122574603

Reviewed by Darin Adler.

Our selection tracking logic was robust to mouse events outside of the
page area, but we were limited by shortcutting out of our mouse event
handling logic if the received event was not on the page area.

This patch follows the fixes in 276852@main and adopts
PDFDocumentLayout::nearestPageIndexForDocumentPoint to determine which
is the actionable page for a mouse event. This way we don't early return
from our mouse event handling logic if the event is not on the page
area, and our selection tracking can keep track even when dragged
outside of the page area.

Finally, we make a small refactor in handleMouseEvent to call
stopTrackingSelection as appropriate whenever we leave the method. This
is necessitated by the fact that we may _want_ to clear selection
tracking state, but we return early in certain display modes. This is
explained in the inline comment.

* Source/WebKit/WebProcess/Plugins/PDF/UnifiedPDF/UnifiedPDFPlugin.mm:
(WebKit::UnifiedPDFPlugin::handleMouseEvent):

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to