[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
Fri May 17 07:25:52 PDT 2019


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

--- Comment #20 from Andres Gonzalez <andresg_22 at apple.com> ---
(In reply to Andres Gonzalez from comment #18)
> Created attachment 370116 [details]
> Patch

creatFragmentFromText, in markup.cpp, was splitting the string ā€œ\nā€ into two strings, one empty, and thus creating two elements to represent the line break, one empty <div> and one <br>. This resulted in the emission of an additional ā€œ\nā€ corresponding to the empty <div> during text extraction (TextIterator.cpp line 1152). The change in CharacterIterator::range is to properly handle the case where a text run consists of a <br> element. Before It was treated as CharacterData and not as a node range.

-- 
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/20190517/41e1c415/attachment.html>


More information about the webkit-unassigned mailing list