Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(87)

Side by Side Diff: LayoutTests/editing/input/paste-linebreak-into-initially-hidden-textarea.html

Issue 8907027: Line breaks are lost when pasted into textarea text starting with a blank line set while textarea... (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/963/
Patch Set: Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | LayoutTests/editing/input/paste-linebreak-into-initially-hidden-textarea-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <body> 3 <body>
4 <p>This tests pasting into a textarea that starts with a line break that didn't initially have a renderer (display: none). 4 <p>This tests pasting into a textarea that starts with a line break that didn't initially have a renderer (display: none).
5 WebKit should still be able to paste text with line breaks.</p> 5 WebKit should still be able to paste text with line breaks.</p>
6 <textarea id="test" style="display: none" cols="50" rows="10"></textarea> 6 <textarea id="test" style="display: none" cols="50" rows="10"></textarea>
7 <div id="log"></div> 7 <div id="log"></div>
8 <script type="text/javascript"> 8 <script type="text/javascript">
9 9
10 if (window.layoutTestController) 10 if (window.layoutTestController)
11 layoutTestController.dumpAsText(); 11 layoutTestController.dumpAsText();
12 12
13 var textarea = document.querySelector('textarea'); 13 var textarea = document.querySelector('textarea');
14 textarea.value = "\nwebkit"; 14 textarea.value = "\nwebkit";
15 textarea.style.display = ""; 15 textarea.style.display = "";
16 16
17 textarea.focus(); 17 textarea.focus();
18 textarea.selectionStart = textarea.selectionEnd = 0; 18 textarea.selectionStart = textarea.selectionEnd = 0;
19 document.execCommand('insertHTML', false, 'hello\nworld\n'); 19 document.execCommand('insertHTML', false, 'hello\nworld\n');
20 20
21 var expected = 'hello\nworld\nwebkit'; 21 var expected = 'hello\nworld\nwebkit';
22 if (textarea.value == expected) 22 if (textarea.value == expected)
23 document.getElementById('log').innerText = 'PASS'; 23 document.getElementById('log').innerText = 'PASS';
24 else 24 else
25 document.getElementById('log').innerText = 'FAILED: expected "' + expected + '" but got "' + textarea.value + '"'; 25 document.getElementById('log').innerText = 'FAILED: expected "' + expected + '" but got "' + textarea.value + '"';
26 26
27 </script> 27 </script>
28 </body> 28 </body>
29 </html> 29 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/editing/input/paste-linebreak-into-initially-hidden-textarea-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698