Change log level: info -> debug
[framework/web/webkit-efl.git] / LayoutTests / editing / pasteboard / paste-list-003.html
1 <html>
2 <script src=../editing.js></script>
3 <script>
4 function escapeHTML(text)
5 {
6     return text.replace(/&/g, "&amp;").replace(/</g, "&lt;");
7 }
8
9 function editingTest()
10 {
11     // Select "one" and "two".
12     for (i = 0; i < 2; i++)
13         extendSelectionForwardByLineCommand();
14     copyCommand();
15
16     // Paste with the cursor right before "four" (insert between three and four)
17     for (i = 0; i < 2; i++)
18         moveSelectionForwardByLineCommand();
19     pasteCommand();
20
21     // Verify that the cursor is in the right place (still before four).
22     var selection = window.getSelection();
23     if (selection.baseNode.parentNode.parentNode.parentNode != document.getElementById("four") ||
24         selection.baseOffset != 0 || !selection.isCollapsed)
25         throw "Wrong selection position on before paste.";
26
27     // Make sure the styles were preserved in the copy by updating the list items.
28     var items = document.getElementsByTagName("li");
29     for (var i = 0; i < items.length; ++i) {
30         var li = items[i];
31         li.innerHTML += ": " + escapeHTML(li.innerHTML);
32     }
33
34     document.getElementById("results").innerText = "PASS";
35 }
36
37 </script>
38 <body>
39 <div contentEditable="true">
40 <p>Copy/pasting list items in a list.  This test should be run with DRT for pasteboard access.</p>
41 <p id="results">FAIL</p>
42 <ul id="test">
43     <li><b>one</b></li>
44     <li><span style="background-color: green">two</span></li>
45     <li>three</li>
46     <li id="four"><span style="background-color: orange"><i>four</i></span></li>
47     <li>i love counting, counting to the number four</li>
48 </ul>
49 </div>
50
51 <script>
52 if (window.testRunner)
53     testRunner.dumpAsText();
54
55 var elem = document.getElementById("test");
56 var selection = window.getSelection();
57 selection.setPosition(elem, 0);
58 editingTest();
59 </script>
60
61 </body>
62 </html>