[webkit-changes] [WebKit/WebKit] 7cf110: [Writing Tools] Rewritten text gets reselected whe...

Aditya Keerthi noreply at github.com
Tue Jul 2 08:48:03 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 7cf1101f128db00e1ffd52c3b4e796be3e4580ec
      https://github.com/WebKit/WebKit/commit/7cf1101f128db00e1ffd52c3b4e796be3e4580ec
  Author: Aditya Keerthi <akeerthi at apple.com>
  Date:   2024-07-02 (Tue, 02 Jul 2024)

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

  Log Message:
  -----------
  [Writing Tools] Rewritten text gets reselected when trying to modify after rewrite
https://bugs.webkit.org/show_bug.cgi?id=276110
rdar://130782802

Reviewed by Richard Robinson and Abrar Rahman Protyasha.

Currently, the selection is set to the session's context range when Writing Tools
is ended. This is undesirable, as Writing Tools can be ended by clicking elsewhere
in web content, which itself changes the selection. This results in a scenario
where the user modifies the selection, Writing Tools ends, and then changes the
user's selection again.

Fix by removing the logic which modifies selection when Writing Tools ends. This
was never the intended behavior. Instead, the selection should simply be set when
rewriting has finished (but the panel is still visible), which continues to be the
case.

Adjust tests to reflect the correct behavior.

* Source/WebCore/page/writing-tools/WritingToolsController.mm:
(WebCore::WritingToolsController::didEndWritingToolsSession):
* Tools/TestWebKitAPI/Tests/WebKitCocoa/WritingTools.mm:
(TEST(WritingTools, ProofreadingAcceptReject)):
(TEST(WritingTools, ContextRangeFromCaretSelection)):

It does not make sense to rewrite to an empty string. Correct that.

(TEST(WritingTools, ContextRangeFromRangeSelection)):

Augment this test to modify the selection prior to ending Writing Tools,
ensuring test coverage for the change made this patch.

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