Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 262e8c14578baaa683bc124f2f0fcc90f6671bb0
      
https://github.com/WebKit/WebKit/commit/262e8c14578baaa683bc124f2f0fcc90f6671bb0
  Author: Megan Gardner <[email protected]>
  Date:   2026-07-17 (Fri, 17 Jul 2026)

  Changed paths:
    M Source/WebCore/page/writing-tools/WritingToolsController.mm
    M Tools/TestWebKitAPI/Tests/WebKit/WKWebView/WritingTools.mm

  Log Message:
  -----------
  Cover more cases for correcting issues with AOP inserts on sites with rich 
text editors.
https://bugs.webkit.org/show_bug.cgi?id=319612
rdar://182439644

Reviewed by Wenson Hsieh.

Reworked the closest-match resolution in validatedRangeForSuggestionMarker so 
re-anchoring only commits when it's
confident. It now bails on an ambiguous tie (two occurrences equidistant from 
the stale offset) and when the
re-anchored range overlaps a different suggestion's marker, instead of silently 
taking the nearest one. A lone
non-overlapping wrong match can still slip through — inherent to a text search 
— but the two detectable cases are
covered now.

Test: Tools/TestWebKitAPI/Tests/WebKit/WKWebView/WritingTools.mm

* Source/WebCore/page/writing-tools/WritingToolsController.mm:
(WebCore::WritingToolsController::validatedRangeForSuggestionMarker const):
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/WritingTools.mm:
(TEST(WritingTools, ProofreadingReviewBailsOnAmbiguousDriftedMarker)):

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



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

Reply via email to