Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / editing / pasteboard / paste-list-003.html
blob93c950cb966aad4ad728eaee21b0918b347ba39d
1 <html>
2 <script src=../editing.js></script>
3 <script>
4 function escapeHTML(text)
6 return text.replace(/&/g, "&amp;").replace(/</g, "&lt;");
9 function editingTest()
11 // Select "one" and "two".
12 for (i = 0; i < 2; i++)
13 extendSelectionForwardByLineCommand();
14 copyCommand();
16 // Paste with the cursor right before "four" (insert between three and four)
17 for (i = 0; i < 2; i++)
18 moveSelectionForwardByLineCommand();
19 pasteCommand();
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.";
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);
34 document.getElementById("results").innerText = "PASS";
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>
51 <script>
52 if (window.testRunner)
53 testRunner.dumpAsText();
55 var elem = document.getElementById("test");
56 var selection = window.getSelection();
57 selection.collapse(elem, 0);
58 editingTest();
59 </script>
61 </body>
62 </html>