[webkit-changes] [WebKit/WebKit] 43c15c: [iOS] Selection disappears on login.live.com when ...

Wenson Hsieh noreply at github.com
Sat Oct 19 20:22:02 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 43c15c8949412ea14aecc29a5e182be908d861ef
      https://github.com/WebKit/WebKit/commit/43c15c8949412ea14aecc29a5e182be908d861ef
  Author: Wenson Hsieh <wenson_hsieh at apple.com>
  Date:   2024-10-19 (Sat, 19 Oct 2024)

  Changed paths:
    A LayoutTests/editing/selection/ios/selection-moves-between-composited-layers-expected.txt
    A LayoutTests/editing/selection/ios/selection-moves-between-composited-layers.html
    M Source/WebKit/UIProcess/ios/WKContentViewInteraction.h
    M Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm

  Log Message:
  -----------
  [iOS] Selection disappears on login.live.com when SelectionHonorsOverflowScrolling is enabled
https://bugs.webkit.org/show_bug.cgi?id=281828
rdar://138255535

Reviewed by Abrar Rahman Protyasha and Richard Robinson.

When SelectionHonorsOverflowScrolling is enabled, it's possible for selection views to be removed
from the view hierarchy, even though the selection still exists in the DOM. If the layer
corresponding to an element containing one of the selection endpoints goes from being composited to
non-composited but the selection otherwise remains in the same place (i.e. same selection rects), we
currently bail from `-[WKContentView _updateChangedSelection:]`. However, an update here is
necessary in order to reparent the text selection display interaction's managed views in its new
compositing layer.

To fix this, we add a member to `WKSelectionDrawingInfo` to keep track of the platform layer where
the selection is being displayed; if this changes, then we'll consider the selection drawing info
changed, and update the selection accordingly.

* LayoutTests/editing/selection/ios/selection-moves-between-composited-layers-expected.txt: Added.
* LayoutTests/editing/selection/ios/selection-moves-between-composited-layers.html: Added.

Add a test to exercise the change (the button and event handler are for manual testing only).

* Source/WebKit/UIProcess/ios/WKContentViewInteraction.h:
* Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:
(WebKit::WKSelectionDrawingInfo::WKSelectionDrawingInfo):
(WebKit::operator==):

Implement the main fix here, by invalidating selection drawing info when the compositing layer ID
changes.

(WebKit::operator<<):

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



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


More information about the webkit-changes mailing list