Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / editing / deleting / 4922367.html
1 <head><style>
2 table, td {
3     border: 1px solid #bbb;
4 }
5 </style></head>
6 <p>This tests selecting and deleting the paragraph before a table.  You should see only a table in the editable region below, with the caret just before it.</p>
7 <div contenteditable="true">
8 <div><br></div>
9 <table id="table">
10 <tr><td>1</td><td>2</td></tr>
11 </table>
12 </div>
13 <ul id="console"></ul>
14
15 <script>
16 function log(str) {
17     var li = document.createElement("li");
18     var text = document.createTextNode(str);
19     var console = document.getElementById("console");
20     li.appendChild(text);
21     console.appendChild(li);
22 }
23
24 var sel = window.getSelection();
25 var table = document.getElementById("table");
26 var parent = table.parentNode;
27 if (parent.childNodes[3] != table)
28     log("Error: the table is not at index 3 of its parent.");
29 sel.collapse(parent, 3);
30 sel.modify("extend", "backward", "paragraph");
31 document.execCommand("Delete");
32 </script>