Reproduction: <textarea id="test" style="display: none" cols="50" rows="10"></textarea> <script type="text/javascript"> var textarea = document.querySelector('textarea'); textarea.value = "\nwebkit"; textarea.style.display = ""; textarea.focus(); textarea.selectionStart = textarea.selectionEnd = 0; document.execCommand('insertHTML', false, 'hello\nworld\n'); alert(textarea.value); </script> Alert doesn't have any line breaks :( http://crbug.com/104620
Created attachment 118468 [details] demo
Created attachment 118481 [details] Fixes the bug
Thanks for the review, Tony. Landing it now.
Committed r102392: <http://trac.webkit.org/changeset/102392>