[Webkit-unassigned] [Bug 166955] AX: WKContentView needs to implement UITextInput methods to make speak selection highlighting work

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sat Jan 28 23:34:32 PST 2017


--- Comment #27 from Darin Adler <darin at apple.com> ---
Comment on attachment 300061
  --> https://bugs.webkit.org/attachment.cgi?id=300061

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

> Source/WebCore/dom/Range.h:128
> +    WEBCORE_EXPORT int collectSelectionRectsWithoutUnionInteriorLines(Vector<SelectionRect>&);

Seems like line number should be unsigned rather than int.

> Source/WebCore/editing/TextIterator.cpp:2681
> +static Ref<Range> findPlainTextMatchesInRange(const Range& range, const String& target, FindOptions options, size_t& matchStart, size_t& matchLength, const std::function<bool(size_t, size_t)>& matches)

I find the design of this function quite peculiar and not straightforward as it should be. The idea that the function’s job is to fill in the two values, matchStart and matchLength, as a side effect, is super-strange. Can we find a more straightforward design pattern?

> Source/WebCore/editing/TextIterator.cpp:2704
> +    auto result = std::pair<size_t, size_t> { matchStart, matchLength };

What’s the point of putting this into a pair, since we just break the pair apart below?

You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20170129/87039dd9/attachment.html>

More information about the webkit-unassigned mailing list