5 <p>This test confirms some combination of editing command with Shadow DOM does not cause a crash.
6 To test manually, select from (before nested) to (after nested), then press Italic, and InsertUnorderedList.
</p>
8 <div id=
"container" contenteditable
>
9 <div><p>(before host)
</p></div>
10 <div id=
"host"> <span contenteditable=
"false">not editable
</span></div>
11 <div>(after host)
</div>
13 <input type=
"button" value=
"Italic" onclick=
"document.execCommand('Italic')" />
14 <input type=
"button" value=
"InsertUnorderedList" onclick=
"document.execCommand('InsertUnorderedList')" />
18 if (window
.testRunner
)
19 testRunner
.dumpAsText();
21 var shadowRoot
= host
.createShadowRoot();
22 var div
= document
.createElement('div');
23 shadowRoot
.appendChild(div
);
24 div
.innerHTML
= "<span contenteditable>(before shadow)</span><shadow></shadow>(after shadow)";
26 var nestedShadowRoot
= div
.createShadowRoot();
27 nestedShadowRoot
.innerHTML
= "<div contenteditable>(before <span id='src'></span>nested)<shadow></shadow>(nested <span id='dst'></span>after)</div>";
29 var src
= nestedShadowRoot
.getElementById('src');
30 var dst
= nestedShadowRoot
.getElementById('dst');
32 if (window
.eventSender
) {
33 eventSender
.mouseMoveTo(src
.offsetLeft
+ src
.offsetWidth
/ 2, src
.offsetTop
+ src
.offsetHeight
/ 2);
34 eventSender
.mouseDown();
35 eventSender
.mouseMoveTo(dst
.offsetLeft
+ dst
.offsetWidth
/ 2, dst
.offsetTop
+ dst
.offsetHeight
/ 2);
36 eventSender
.mouseUp();
38 document
.execCommand('Italic');
39 document
.execCommand('InsertUnorderedList');
41 container
.innerHTML
= "PASS";
44 var successfullyParsed
= true;