OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <body> | 3 <body> |
4 <script src="../../fast/dom/resources/event-sender-util.js"></script> | 4 <script src="../../fast/dom/resources/event-sender-util.js"></script> |
5 <script src="../../resources/js-test.js"></script> | 5 <script src="../../resources/js-test.js"></script> |
6 | 6 |
7 <p>When selecting from a child of shadow host to an element in Shadow DOM, a cra
sh should not be caused. | 7 <p>When selecting from a child of shadow host to an element in Shadow DOM, a cra
sh should not be caused. |
8 This is because the start position of Selection comes after the end position of
Selection.</p> | 8 This is because the start position of Selection comes after the end position of
Selection.</p> |
9 | 9 |
10 <div contenteditable> | 10 <div contenteditable> |
11 before host <span id="host" contenteditable="false">drag from here<span id="
target"> </span> after host</span> | 11 before host <span id="host" contenteditable="false">drag from here<span id="
target"> </span> after host</span> |
12 </div> | 12 </div> |
13 <pre id="console"></pre> | 13 <pre id="console"></pre> |
14 | 14 |
15 <script> | 15 <script> |
16 var shadowRoot = host.createShadowRoot(); | 16 var shadowRoot = host.createShadowRoot(); |
17 shadowRoot.innerHTML = "<span id='shadow-host'>before shadow<shadow id='shadow'>
<content></content></shadow>after shadow</span>" | 17 shadowRoot.innerHTML = "<span id='shadow-host'>before shadow<shadow id='shadow'>
</shadow>after shadow</span>" |
18 | 18 |
19 var nestedShadowHost = shadowRoot.getElementById('shadow-host'); | 19 var nestedShadowHost = shadowRoot.getElementById('shadow-host'); |
20 var nestedShadowRoot = nestedShadowHost.createShadowRoot(); | 20 var nestedShadowRoot = nestedShadowHost.createShadowRoot(); |
21 nestedShadowRoot.innerHTML = "<span contenteditable>before nested<shadow><conten
t></content></shadow>after nested</span>" | 21 nestedShadowRoot.innerHTML = "<span contenteditable>before nested<shadow></shado
w>after nested</span>" |
22 | 22 |
23 // This should not cause a crash. | 23 // This should not cause a crash. |
24 eventSender.mouseMoveTo(target.offsetLeft - 10, target.offsetTop + target.offset
Height / 2); | 24 eventSender.mouseMoveTo(target.offsetLeft - 10, target.offsetTop + target.offset
Height / 2); |
25 eventSender.mouseDown(); | 25 eventSender.mouseDown(); |
26 eventSender.mouseMoveTo(nestedShadowHost.offsetLeft + 10, nestedShadowHost.offse
tTop + nestedShadowHost.offsetHeight / 2); | 26 eventSender.mouseMoveTo(nestedShadowHost.offsetLeft + 10, nestedShadowHost.offse
tTop + nestedShadowHost.offsetHeight / 2); |
27 eventSender.mouseUp(); | 27 eventSender.mouseUp(); |
28 debug('PASS'); | 28 debug('PASS'); |
29 | 29 |
30 var successfullyParsed = true; | 30 var successfullyParsed = true; |
31 </script> | 31 </script> |
32 | 32 |
33 </body> | 33 </body> |
34 </html> | 34 </html> |
OLD | NEW |