Bug 238529 - Test passing in offset for searchFunction.
Summary: Test passing in offset for searchFunction.
Status: RESOLVED INVALID
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:
Depends on:
Blocks:
 
Reported: 2022-03-29 16:16 PDT by Megan Gardner
Modified: 2022-04-05 13:44 PDT (History)
3 users (show)

See Also:


Attachments
Patch (2.59 KB, patch)
2022-03-29 16:18 PDT, Megan Gardner
ews-feeder: commit-queue-
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-03-29 16:16:35 PDT
Test passing in offset for searchFunction.
Comment 1 Megan Gardner 2022-03-29 16:18:08 PDT
Created attachment 456077 [details]
Patch
Comment 2 Darin Adler 2022-03-29 17:31:07 PDT
Comment on attachment 456077 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=456077&action=review

Looks right.

> Source/WebCore/editing/VisibleUnits.cpp:1073
> -    return ubrk_preceding(sentenceBreakIterator(text), text.length());
> +    return ubrk_preceding(sentenceBreakIterator(text), offset);

Do we need to clamp the offset so to guarantee it’s <= length?

> Source/WebCore/editing/VisibleUnits.cpp:1096
> -    return ubrk_preceding(sentenceBreakIterator(text), text.length());
> +    return ubrk_preceding(sentenceBreakIterator(text), offset);

Same question.
Comment 3 Megan Gardner 2022-04-05 13:44:52 PDT
Failed experiment.