[webkit-reviews] review granted: [Bug 240036] Enable TextCheckingType::Correction on MacCatalyst. : [Attachment 458755] Patch
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Tue May 3 15:27:45 PDT 2022
Wenson Hsieh <wenson_hsieh at apple.com> has granted Megan Gardner
<megan_gardner at apple.com>'s request for review:
Bug 240036: Enable TextCheckingType::Correction on MacCatalyst.
https://bugs.webkit.org/show_bug.cgi?id=240036
Attachment 458755: Patch
https://bugs.webkit.org/attachment.cgi?id=458755&action=review
--- Comment #3 from Wenson Hsieh <wenson_hsieh at apple.com> ---
Comment on attachment 458755
--> https://bugs.webkit.org/attachment.cgi?id=458755
Patch
View in context: https://bugs.webkit.org/attachment.cgi?id=458755&action=review
> Source/WebCore/editing/Editor.cpp:2886
> + for (const auto& range : previousGrammarRanges) {
> + if (range.location == resultLocation && range.length ==
resultLength) {
> + resultRangeIsAcceptableForReplacement = true;
> + break;
> + }
> + }
Nit - might be cleaner as
```
resultRangeIsAcceptableForReplacement =
previousGrammarRanges.containsIf([&](auto& range) {
return range.location == resultLocation && range.length == resultLength;
});
```
> Source/WebCore/editing/Editor.cpp:2909
> +
previousGrammarRanges.append(CharacterRange(resultLocation +
detail.range.location, detail.range.length));
Nit - I think we normally write this as `previousGrammarRanges.append({
resultLocation + detail.range.location, detail.range.length });`.
More information about the webkit-reviews
mailing list