Bug 74126 - Line breaks are lost when pasted into textarea text starting with a blank line set while textarea is hidden
Summary: Line breaks are lost when pasted into textarea text starting with a blank lin...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P1 Normal
Assignee: Ryosuke Niwa
URL:
Keywords: HasReduction
Depends on:
Blocks:
 
Reported: 2011-12-08 14:18 PST by Ryosuke Niwa
Modified: 2011-12-08 16:15 PST (History)
7 users (show)

See Also:


Attachments
demo (751 bytes, text/html)
2011-12-08 14:18 PST, Ryosuke Niwa
no flags Details
Fixes the bug (4.39 KB, patch)
2011-12-08 15:47 PST, Ryosuke Niwa
tony: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>