Bug 238529

Summary: Test passing in offset for searchFunction.
Product: WebKit Reporter: Megan Gardner <megan_gardner>
Component: New BugsAssignee: Megan Gardner <megan_gardner>
Status: RESOLVED INVALID    
Severity: Normal CC: darin, ews-watchlist, mifenton
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch ews-feeder: commit-queue-

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.