4 <script src=
"../../fast/dom/resources/event-sender-util.js"></script>
5 <script src=
"../../resources/js-test.js"></script>
7 <p>When selecting from a child of shadow host to an element in Shadow DOM, a crash should not be caused.
8 This is because the start position of Selection comes after the end position of Selection.
</p>
11 before host
<span id=
"host" contenteditable=
"false">drag from here
<span id=
"target"> </span> after host
</span>
13 <pre id=
"console"></pre>
16 var shadowRoot
= host
.createShadowRoot();
17 shadowRoot
.innerHTML
= "<span id='shadow-host'>before shadow<shadow id='shadow'></shadow>after shadow</span>"
19 var nestedShadowHost
= shadowRoot
.getElementById('shadow-host');
20 var nestedShadowRoot
= nestedShadowHost
.createShadowRoot();
21 nestedShadowRoot
.innerHTML
= "<span contenteditable>before nested<shadow></shadow>after nested</span>"
23 // This should not cause a crash.
24 eventSender
.mouseMoveTo(target
.offsetLeft
- 10, target
.offsetTop
+ target
.offsetHeight
/ 2);
25 eventSender
.mouseDown();
26 eventSender
.mouseMoveTo(nestedShadowHost
.offsetLeft
+ 10, nestedShadowHost
.offsetTop
+ nestedShadowHost
.offsetHeight
/ 2);
27 eventSender
.mouseUp();
30 var successfullyParsed
= true;