[webkit-changes] [WebKit/WebKit] cafa71: [iOS 17] Correction indicators persist after typing

Richard Robinson noreply at github.com
Fri Jul 7 10:29:38 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: cafa71ff1b125df7b66244ebaa0d1817b267c279
      https://github.com/WebKit/WebKit/commit/cafa71ff1b125df7b66244ebaa0d1817b267c279
  Author: Richard Robinson <richard_robinson2 at apple.com>
  Date:   2023-07-07 (Fri, 07 Jul 2023)

  Changed paths:
    M Source/WebCore/editing/AlternativeTextController.cpp
    M Source/WebCore/editing/AlternativeTextController.h
    M Source/WebCore/editing/Editor.cpp
    M Source/WebCore/testing/Internals.cpp
    M Source/WebCore/testing/Internals.h
    M Source/WebCore/testing/Internals.idl
    M Source/WebKit/UIProcess/API/ios/WKWebViewPrivateForTestingIOS.h
    M Source/WebKit/UIProcess/API/ios/WKWebViewTestingIOS.mm
    M Tools/TestWebKitAPI/Tests/ios/AutocorrectionTestsIOS.mm

  Log Message:
  -----------
  [iOS 17] Correction indicators persist after typing
https://bugs.webkit.org/show_bug.cgi?id=258954
rdar://111764235

Reviewed by Wenson Hsieh.

When upstreaming the autocorrection enhancements implementation, the code to dismiss the markers
was accidentally put inside a compile time guard which was only true for `PLATFORM(MAC)` and not iOS.

Fix by moving the code outside of the compile time guard.

Also refactors some methods in `Internals.cpp` to reduce duplication.

* Source/WebCore/editing/AlternativeTextController.cpp:
(WebCore::removeAutocorrectionIndictorMarkers):
(WebCore::AlternativeTextController::respondToAppliedEditing):
(WebCore::removeCorrectionIndicatorMarkers): Deleted.
* Source/WebCore/editing/AlternativeTextController.h:
* Source/WebCore/testing/Internals.cpp:
(WebCore::Internals::hasMarkerFor):
(WebCore::Internals::hasSpellingMarker):
(WebCore::Internals::hasGrammarMarker):
(WebCore::Internals::hasAutocorrectedMarker):
(WebCore::Internals::hasDictationAlternativesMarker):
(WebCore::Internals::hasCorrectionIndicatorMarker):
* Source/WebCore/testing/Internals.h:
* Source/WebCore/testing/Internals.idl:
* Source/WebKit/UIProcess/API/ios/WKWebViewPrivateForTestingIOS.h:
* Source/WebKit/UIProcess/API/ios/WKWebViewTestingIOS.mm:
(-[WKWebView applyAutocorrection:toString:isCandidate:withCompletionHandler:]):
* Tools/TestWebKitAPI/Tests/ios/AutocorrectionTestsIOS.mm:
(TEST):

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




More information about the webkit-changes mailing list