Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 6ada1137f92bbf920f4c657cdb44251f3ea5aa41
      
https://github.com/WebKit/WebKit/commit/6ada1137f92bbf920f4c657cdb44251f3ea5aa41
  Author: Cole Carley <[email protected]>
  Date:   2026-04-14 (Tue, 14 Apr 2026)

  Changed paths:
    A 
LayoutTests/editing/selection/ios/touchmove-to-change-selection-with-prevent-default-expected.txt
    A 
LayoutTests/editing/selection/ios/touchmove-to-change-selection-with-prevent-default.html
    M Source/WebKit/UIProcess/ios/WKContentViewInteraction.h
    M Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm
    M Source/WebKit/UIProcess/ios/WKTextInteractionWrapper.h
    M Source/WebKit/UIProcess/ios/WKTextInteractionWrapper.mm

  Log Message:
  -----------
  outlook.live.com: Unable to change selected text
rdar://151851274
https://bugs.webkit.org/show_bug.cgi?id=311961

Reviewed by Wenson Hsieh.

When on outlook.live.com looking at a received or sent email on iOS,
you can create a selection, but it is tedious to change the selected text.
This is because the outlook JS has an event listener for touch events
that are used to transform: translate3d the page. In that listener callback
they call preventDefault, which blocks WebKit from using the touch
event to move the selection.

To solve this issue, I added a check to touchstart to see if it is near
a selection handle. If it is, then we set some state on the view, and
ensure that the touch start cannot prevent native gestures. Then, all
subsequent touchmove events will not be sent to JS, so they can be used
to adjust the text selection.

After all fingers are lifted, the state is reset, and touch events will
go back to normal until another touch start is near a selection handle.

Test: 
editing/selection/ios/touchmove-to-change-selection-with-prevent-default.html

* 
LayoutTests/editing/selection/ios/touchmove-to-change-selection-with-prevent-default-expected.txt:
 Added.
* 
LayoutTests/editing/selection/ios/touchmove-to-change-selection-with-prevent-default.html:
 Added.
* Source/WebKit/UIProcess/ios/WKContentViewInteraction.h:
* Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _touchEventsRecognized]):
(-[WKContentView _doneDeferringTouchStart:]):
(-[WKContentView _doneDeferringTouchMove:]):
(-[WKContentView _isTouchNearSelectionHandle:]):

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to