Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: c6e77058d1bc5a23b153506efa1238a568dfef1b
      
https://github.com/WebKit/WebKit/commit/c6e77058d1bc5a23b153506efa1238a568dfef1b
  Author: Abrar Rahman Protyasha <[email protected]>
  Date:   2025-08-25 (Mon, 25 Aug 2025)

  Changed paths:
    M Source/WebKit/Shared/ios/InteractionInformationAtPosition.h
    M Source/WebKit/Shared/ios/InteractionInformationAtPosition.serialization.in
    M Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm

  Log Message:
  -----------
  [iOS] Text selection is lost immediately when long pressing on a PDF document 
in a web app
https://bugs.webkit.org/show_bug.cgi?id=297849
rdar://157692157

Reviewed by Tim Horton.

Safari web apps configure WKWebViews with allowsLinkPreview == NO.

This knob toggles the enablement of the highlight long press GR on the
content view. On a long tap, when we eventually receive the "Ended"
state in the GR's action selector, we attempt a synthetic click at the
last touch point, which has the undesired effect of clearing out the
active text selection.

Ideally, the highlight is not activated when we're selecting text. We
explicitly handle this in textInteractionGesture:shouldBeginAtPoint:,
but out logic breaks down because we do not believe there is selectable
text under the last touch point. This happens because during position
information computating in the web process, the node (for PDF content)
fails the rectIsTooBigForSelection() check.

Given the rect size check was introduced in support of block selections
(c.f. 175893@main), which is no longer a supported text selection
modality, it seems fair for us to drop this check. This also has the
effect of the plugin no longer losing its text selection!

No new test coverage, sadly, because I could not figure out a working
combination of long press GR state transitions to reproduce the failure
case.

* Source/WebKit/Shared/ios/InteractionInformationAtPosition.h:
* Source/WebKit/Shared/ios/InteractionInformationAtPosition.serialization.in:
* Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::selectionPositionInformation):
(WebKit::rectIsTooBigForSelection): Deleted.

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



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

Reply via email to