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>
10 <ol id=
"host" contenteditable
>
11 <li id=
"list1">ABCDE
</li>
12 <li id=
"list2">abcde
</li>
13 <li id=
"list3">12345</li>
16 <pre id=
"console"></pre>
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
= "";