blob: d3c7587246346ac7776a2fac2279e4185fd76905 [file] [log] [blame]
<!DOCTYPE html>
<script src="../../fast/dom/resources/event-sender-util.js"></script>
<div id="container" contenteditable>
<table border="1" id="host" contenteditable>
<tr><td>host 1</td></tr>
<tr><td>host 2</td></tr>
<p id="description">Selecting around a table which is distributed from shadow subtree to nested shadow subtree will trigger an assertion. To try manually, select from "shadow 2" to around "after" and confirm a crash does not occur.</p>
if (window.testRunner)
var shadowRoot = host.createShadowRoot();
var div = document.createElement('div');
div.innerHTML = "<table border='1'><tr><td>shadow 1</td></tr><tr><td id='src'>shadow 2</td></tr></table>";
var nestedShadowRoot = div.createShadowRoot();
nestedShadowRoot.innerHTML = "<div contenteditable>before<shadow></shadow>after</div>";
var src = shadowRoot.getElementById('src');
if (window.eventSender) {
eventSender.mouseMoveTo(src.offsetLeft + 10, src.offsetTop + src.offsetHeight / 2);
eventSender.mouseMoveTo(src.offsetLeft - 10, src.offsetTop + src.offsetHeight / 2);
container.innerHTML = "PASS";
// When description comes before container, this test will not fail if code is wrong. So let's move here.
container.parentNode.insertBefore(description, container);