[webkit-changes] [WebKit/WebKit] 01c71b: [Writing Tools] Toggling Show Original / Show Rewr...

Richard Robinson noreply at github.com
Wed Oct 23 11:06:26 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 01c71b9e11790a1f701b95e1c2b23aff53543234
      https://github.com/WebKit/WebKit/commit/01c71b9e11790a1f701b95e1c2b23aff53543234
  Author: Richard Robinson <richard_robinson2 at apple.com>
  Date:   2024-10-23 (Wed, 23 Oct 2024)

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

  Log Message:
  -----------
  [Writing Tools] Toggling Show Original / Show Rewritten doesn't work for suggestions which contain multiple words
https://bugs.webkit.org/show_bug.cgi?id=281951
rdar://138455527

Reviewed by Aditya Keerthi.

When adding or removing a document marker that spans multiple words, in actuality multiple markers are added/removed.

Doing this type of modification inside a loop that is also iterating through the markers, especially with the ranges
of the markers changing, leads to irregular and incorrect behavior resulting in markers being erroneously removed and skipped.

Fix by not modifying the markers while they are being traversed, instead doing so in a separate operation.

* Source/WebCore/page/writing-tools/WritingToolsController.mm:
(WebCore::WritingToolsController::writingToolsSessionDidReceiveAction<WritingTools::Session::Type::Proofreading>):
* Tools/TestWebKitAPI/Tests/WebKitCocoa/WritingTools.mm:
(TEST(WritingTools, ProofreadingShowOriginalWithMultiwordSuggestions)):

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