blob: 0cb1ec5e84a03ca3df520a2afe614e4de68da62c [file] [log] [blame]
<!DOCTYPE html>
<script src="../../fast/dom/resources/event-sender-util.js"></script>
<script src="../../resources/js-test.js"></script>
<p>When selecting from a child of shadow host to an element in Shadow DOM, a crash should not be caused.
This is because the start position of Selection comes after the end position of Selection.</p>
<div contenteditable>
before host <span id="host" contenteditable="false">drag from here<span id="target"> </span> after host</span>
<pre id="console"></pre>
var shadowRoot = host.createShadowRoot();
shadowRoot.innerHTML = "<span id='shadow-host'>before shadow<shadow id='shadow'></shadow>after shadow</span>"
var nestedShadowHost = shadowRoot.getElementById('shadow-host');
var nestedShadowRoot = nestedShadowHost.createShadowRoot();
nestedShadowRoot.innerHTML = "<span contenteditable>before nested<shadow></shadow>after nested</span>"
// This should not cause a crash.
eventSender.mouseMoveTo(target.offsetLeft - 10, target.offsetTop + target.offsetHeight / 2);
eventSender.mouseMoveTo(nestedShadowHost.offsetLeft + 10, nestedShadowHost.offsetTop + nestedShadowHost.offsetHeight / 2);
var successfullyParsed = true;