Bug 74126

Summary: Line breaks are lost when pasted into textarea text starting with a blank line set while textarea is hidden
Product: WebKit Reporter: Ryosuke Niwa <rniwa>
Component: HTML EditingAssignee: Ryosuke Niwa <rniwa>
Status: RESOLVED FIXED    
Severity: Normal CC: darin, enrica, eric, morrita, ojan, tkent, tony
Priority: P1 Keywords: HasReduction
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
demo
none
Fixes the bug tony: review+

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.