Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 6b1f3f671bb6681539ec15539de2c48c9c373ab5
https://github.com/WebKit/WebKit/commit/6b1f3f671bb6681539ec15539de2c48c9c373ab5
Author: Megan Gardner <[email protected]>
Date: 2026-05-07 (Thu, 07 May 2026)
Changed paths:
M LayoutTests/TestExpectations
A
LayoutTests/editing/spelling/grammar-text-effect-not-reapplied-expected.txt
A LayoutTests/editing/spelling/grammar-text-effect-not-reapplied.html
M Source/WebCore/dom/DocumentMarker.h
M Source/WebCore/dom/DocumentMarkerController.cpp
M Source/WebCore/dom/DocumentMarkerController.h
M Source/WebCore/editing/Editor.cpp
M Source/WebCore/editing/TextCheckingHelper.cpp
M Source/WebCore/platform/text/TextChecking.h
M Source/WebCore/testing/Internals.cpp
M Source/WebCore/testing/Internals.h
M Source/WebCore/testing/Internals.idl
M Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in
M Source/WebKit/UIProcess/ios/TextCheckerIOS.mm
M Source/WebKit/UIProcess/mac/TextCheckerMac.mm
M Source/WebKitLegacy/mac/WebCoreSupport/WebEditorClient.mm
M Tools/TestRunnerShared/cocoa/LayoutTestSpellChecker.mm
Log Message:
-----------
Use grammar UUID to deduplicate text effects instead of ranges.
https://bugs.webkit.org/show_bug.cgi?id=314018
rdar://176211949
Reviewed by Aditya Keerthi.
The previous approach in 310132@main tracked applied grammar
text effect ranges to avoid reapplying animations. However,
the grammar checking API provides a UUID (NSGrammarUUID) for
each grammar issue that is stable across re-checks of the same
sentence. Using this UUID is simpler and more reliable than
comparing ranges.
If the UUID is not present, we fall back to always applying
the effect, since we have no way to deduplicate without an
identifier.
Test: editing/spelling/grammar-text-effect-not-reapplied.html
* LayoutTests/TestExpectations:
* LayoutTests/editing/spelling/grammar-text-effect-not-reapplied-expected.txt:
Added.
* LayoutTests/editing/spelling/grammar-text-effect-not-reapplied.html: Added.
* Source/WebCore/dom/DocumentMarker.h:
(WebCore::DocumentMarker::description const):
* Source/WebCore/dom/DocumentMarkerController.cpp:
(WebCore::DocumentMarkerController::detach):
(WebCore::DocumentMarkerController::addMarker):
(WebCore::DocumentMarkerController::appliedGrammarTextEffectCount const):
* Source/WebCore/dom/DocumentMarkerController.h:
* Source/WebCore/editing/Editor.cpp:
(WebCore::Editor::advanceToNextMisspelling):
(WebCore::Editor::markAndReplaceFor):
* Source/WebCore/editing/TextCheckingHelper.cpp:
(WebCore::TextCheckingHelper::findUngrammaticalPhrases const):
* Source/WebCore/platform/text/TextChecking.h:
(WebCore::GrammarDetail::isolatedCopy):
* Source/WebCore/testing/Internals.cpp:
(WebCore::Internals::appliedGrammarTextEffectCount const):
* Source/WebCore/testing/Internals.h:
* Source/WebCore/testing/Internals.idl:
* Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in:
* Source/WebKit/UIProcess/ios/TextCheckerIOS.mm:
(WebKit::TextChecker::checkTextOfParagraph):
(WebKit::convertExtendedCheckingResults):
* Source/WebKit/UIProcess/mac/TextCheckerMac.mm:
(WebKit::TextChecker::checkTextOfParagraph):
(WebKit::convertExtendedCheckingResults):
* Source/WebKitLegacy/mac/WebCoreSupport/WebEditorClient.mm:
(core):
* Tools/TestRunnerShared/cocoa/LayoutTestSpellChecker.mm:
(-[LayoutTestSpellChecker setResultsFromJSValue:inContext:]):
Canonical link: https://commits.webkit.org/312774@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications