Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / editing / shadow / delete-list-in-shadow.html
blob1eca93142753c6b0c5afc7e73dc023d6da5b1af8
1 <!DOCTYPE html>
2 <html>
3 <body>
4 <script src="../../resources/js-test.js"></script>
6 <p>Elements distributed to Shadow DOM should be deleted correctly when pressing delete key.</p>
7 <p>To test manually, select somewhere in ABCDE from somehwere in 12345, and press delete, and check the selected text is deleted correctly.</p>
9 <div id="container">
10 <ol id="host" contenteditable>
11 <li id="list1">ABCDE</li>
12 <li id="list2">abcde</li>
13 <li id="list3">12345</li>
14 </ol>
15 </div>
16 <pre id="console"></pre>
18 <script>
19 if (window.testRunner)
20 testRunner.dumpAsText();
22 var shadowRoot = host.createShadowRoot();
23 var li = document.createElement('li');
24 li.innerHTML = 'hogehoge';
25 shadowRoot.appendChild(li);
26 var shadow = document.createElement('shadow');
27 shadow.appendChild(document.createElement('content'));
28 shadowRoot.appendChild(shadow);
30 if (window.eventSender) {
31 eventSender.mouseMoveTo(list1.offsetLeft + 20, list1.offsetTop + list1.offsetHeight / 2);
32 eventSender.mouseDown();
33 eventSender.mouseMoveTo(list3.offsetLeft + 20, list3.offsetTop + list3.offsetHeight / 2);
34 eventSender.mouseUp();
36 eventSender.keyDown('delete');
38 var hostTextContent = host.textContent.replace(/^\s+|\s+$/g, '');
39 shouldBe("hostTextContent", "'AB345'");
40 container.innerHTML = "";
42 </script>
44 </body>
45 </html>