Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / editing / pasteboard / paste-table-003.html
blob38233ab7e5cd57dd3d50a2d91800bf7c04118a31
1 <html>
2 <head>
4 <style>
5 .editing {
6 border: 2px solid red;
7 font-size: 24px;
9 .explanation {
10 border: 2px solid blue;
11 padding: 12px;
12 font-size: 24px;
13 margin-bottom: 24px;
15 .scenario { margin-bottom: 16px;}
16 .scenario:first-line { font-weight: bold; margin-bottom: 16px;}
17 .expected-results:first-line { font-weight: bold }
18 </style>
19 <script src=../editing.js language="JavaScript" type="text/JavaScript" ></script>
21 <script>
22 function editingTest() {
23 var t = document.getElementById("test");
24 setSelectionCommand(t, 0, t, t.childNodes.length);
25 copyCommand();
27 var e = document.getElementById("target");
28 setSelectionCommand(e, 0, e, 1);
29 pasteCommand();
32 </script>
34 <title>Editing Test</title>
35 </head>
36 <body>
37 <p>This tests pasting a table to replace some text. <b>It demonstrates two bugs: 1) selecting a table without also selecting the line break after programmatically is impossible when its followed by a div because of the way DOM positions are mapped to visible positions, 2) pasting content that ends in a table places the caret in the last table cell instead of after the table, so the interchange newline is placed in the last table cell and not after the table.</b></p>
38 <div id="root" contenteditable>
39 <table id="test">
40 <tbody><tr><td>one</td><td>two</td></tr></tbody></table>
41 <div id="target">replaceme</div>
42 </div>
43 <script>
44 runDumpAsTextEditingTest(true);
45 </script>
47 </body>
48 </html>