Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / editing / pasteboard / preserve-line-break-at-end-of-pasted-content.html
blobdbf80f67b937f7fec2d4d6b9530c83d9abdc546e
1 <!DOCTYPE html>
2 <html>
3 <body>
4 <p id="description">This tests for a bug where newlines would not be preserved during copy/paste. Below you should see two paragraphs containing "Hello World!" and an empty third paragraph with the caret in it.</p>
5 <div id="root" contenteditable="true">Hello World!<div id="div"><br></div></div>
6 <script src="../../resources/dump-as-markup.js"></script>
7 <script>
9 Markup.description(document.getElementById('description').textContent);
11 root = document.getElementById("root");
12 root.focus();
13 document.execCommand("SelectAll");
14 document.execCommand("Copy");
16 Markup.dump(root, 'Before copy and paste');
18 selection = window.getSelection();
19 div = document.getElementById("div");
20 selection.collapse(div, 0);
21 document.execCommand("Paste");
23 Markup.dump(root, 'After copy and paste');
24 </script>
25 </body>
26 </html>