4 <script src=
"../../resources/js-test.js"></script>
5 <script src=
"../../fast/dom/resources/event-sender-util.js"></script>
7 <p>This test confirms that selecting an element having Shadow DOM doesn't cross editing boundaries errornously.
</p>
10 <div id=
"before">BEFORE
</div>
11 <div id=
"host" contenteditable
>HOST
</div>
12 <div id=
"after">AFTER
</div>
15 <pre id=
"console"></pre>
19 var shadowRoot
= host
.createShadowRoot();
20 shadowRoot
.innerHTML
= "SHADOW DOM";
22 var selection
= shadowRoot
.getSelection();
24 debug('Move mouse from BEFORE to HOST');
26 mouseMoveToElem(before
);
27 eventSender
.mouseDown();
28 mouseMoveToElem(host
);
29 eventSender
.mouseUp();
30 shouldBeNull('selection.anchorNode');
31 shouldBeNull('selection.focusNode');
33 // Check crash won't happen.
34 document
.execCommand('delete');
35 debug('PASS document.execCommand("delete") did not crash.');
38 debug('Move mouse from AFTER to HOST');
40 mouseMoveToElem(after
);
41 eventSender
.mouseDown();
42 mouseMoveToElem(host
);
43 eventSender
.mouseUp();
44 shouldBeNull('selection.anchorNode');
45 shouldBeNull('selection.focusNode');
46 // Check crash won't happen.
47 document
.execCommand('delete');
48 debug('PASS document.execCommand("delete") did not crash.');
50 var successfullyParsed
= true;