Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: ac9a639e7434eae4d509fad494dc25b379759db5
      
https://github.com/WebKit/WebKit/commit/ac9a639e7434eae4d509fad494dc25b379759db5
  Author: Wenson Hsieh <wenson_hs...@apple.com>
  Date:   2025-08-21 (Thu, 21 Aug 2025)

  Changed paths:
    A 
LayoutTests/editing/selection/ios/selection-after-resizing-composited-layer-expected.txt
    A 
LayoutTests/editing/selection/ios/selection-after-resizing-composited-layer.html
    M Source/WebKit/UIProcess/ios/WKContentViewInteraction.h
    M Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm

  Log Message:
  -----------
  [iOS] mail.yahoo.com: Typing in the search field causes text cursor to appear 
in the wrong places
https://bugs.webkit.org/show_bug.cgi?id=297703
rdar://157696497

Reviewed by Ryosuke Niwa.

Currently, the UI-side selection views on iOS only update when the selection 
rects change. In this
specific scenario on Yahoo Mail, the layer containing the selection becomes 
wider, but the caret
rect in root view coordinates remains the exact same (i.e. the layer containing 
the text field
expands from the center).

This means that the selection geometry (in the composited selection container 
view's coordinate
space) doesn't change when it needs to, in order to account for the fact that 
the origin has
shifted, causing the selection caret rect to become stale.

To fix this, we identify this case where the selection container view's origin 
is shifted, and call
`-setNeedsSelectionUpdate` to force UIKit to recalculate and layout selection 
views again.

* 
LayoutTests/editing/selection/ios/selection-after-resizing-composited-layer-expected.txt:
 Added.
* 
LayoutTests/editing/selection/ios/selection-after-resizing-composited-layer.html:
 Added.

Add a layout test to exercise this fix.

* Source/WebKit/UIProcess/ios/WKContentViewInteraction.h:
* Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView cleanUpInteraction]):
(-[WKContentView _updateChangedSelection:]):
(-[WKContentView _updateSelectionViewsIfNeeded]):

Rename this to `-_updateSelectionViewsIfNeeded`, since we now 
`-setNeedsSelectionUpdate` if the
containing subscroller has scrolled since the last selection update, or the 
origin of the selection
container changes.

(-[WKContentView _updateSelectionViewsInChildScrollViewIfNeeded]): Deleted.

Canonical link: https://commits.webkit.org/299011@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