Bug 240036 - Enable TextCheckingType::Correction on MacCatalyst.
Summary: Enable TextCheckingType::Correction on MacCatalyst.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Megan Gardner
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-05-03 13:58 PDT by Megan Gardner
Modified: 2022-05-04 01:34 PDT (History)
4 users (show)

See Also:


Attachments
Patch (7.59 KB, patch)
2022-05-03 14:00 PDT, Megan Gardner
no flags Details | Formatted Diff | Diff
Patch (7.52 KB, patch)
2022-05-03 22:58 PDT, Megan Gardner
no flags Details | Formatted Diff | Diff
Patch for landing (7.52 KB, patch)
2022-05-03 23:22 PDT, Megan Gardner
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Megan Gardner 2022-05-03 13:58:24 PDT
Enable TextCheckingType::Correction on MacCatalyst.
Comment 1 Megan Gardner 2022-05-03 14:00:11 PDT
Created attachment 458755 [details]
Patch
Comment 2 Wenson Hsieh 2022-05-03 14:03:22 PDT
rdar://92691014
Comment 3 Wenson Hsieh 2022-05-03 15:27:45 PDT
Comment on attachment 458755 [details]
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 });`.
Comment 4 Megan Gardner 2022-05-03 22:58:32 PDT
Created attachment 458772 [details]
Patch
Comment 5 Megan Gardner 2022-05-03 23:22:50 PDT
Created attachment 458774 [details]
Patch for landing
Comment 6 EWS 2022-05-04 01:34:57 PDT
Committed r293766 (250245@main): <https://commits.webkit.org/250245@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 458774 [details].