RESOLVED FIXED 74126
Line breaks are lost when pasted into textarea text starting with a blank line set while textarea is hidden
https://bugs.webkit.org/show_bug.cgi?id=74126
Summary Line breaks are lost when pasted into textarea text starting with a blank lin...
Ryosuke Niwa
Reported 2011-12-08 14:18:14 PST
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
Attachments
demo (751 bytes, text/html)
2011-12-08 14:18 PST, Ryosuke Niwa
no flags
Fixes the bug (4.39 KB, patch)
2011-12-08 15:47 PST, Ryosuke Niwa
tony: review+
Ryosuke Niwa
Comment 1 2011-12-08 14:18:59 PST
Ryosuke Niwa
Comment 2 2011-12-08 15:47:17 PST
Created attachment 118481 [details] Fixes the bug
Ryosuke Niwa
Comment 3 2011-12-08 16:11:07 PST
Thanks for the review, Tony. Landing it now.
Ryosuke Niwa
Comment 4 2011-12-08 16:15:31 PST
Note You need to log in before you can comment on or make changes to this bug.