[Webkit-unassigned] [Bug 197894] Inserting a newline in contenteditable causes two characters to be added instead of one

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Jun 19 23:40:16 PDT 2019


https://bugs.webkit.org/show_bug.cgi?id=197894

--- Comment #44 from Ryosuke Niwa <rniwa at webkit.org> ---
Comment on attachment 371007
  --> https://bugs.webkit.org/attachment.cgi?id=371007
Patch

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

> Source/WebCore/editing/Editing.cpp:1131
> +        if (range->startPosition() == range->endPosition()) {
> +            it.advance(1);
> +            return VisiblePosition(it.range()->startPosition());
> +        }

This code is correct. it.advance(1) can put the text iterator at the end, and if so, calling it.range() would result in a crash.

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


More information about the webkit-unassigned mailing list