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+

Description Ryosuke Niwa 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
Comment 1 Ryosuke Niwa 2011-12-08 14:18:59 PST
Created attachment 118468 [details]
demo
Comment 2 Ryosuke Niwa 2011-12-08 15:47:17 PST
Created attachment 118481 [details]
Fixes the bug
Comment 3 Ryosuke Niwa 2011-12-08 16:11:07 PST
Thanks for the review, Tony. Landing it now.
Comment 4 Ryosuke Niwa 2011-12-08 16:15:31 PST
Committed r102392: <http://trac.webkit.org/changeset/102392>