4 <script src=
"../../fast/dom/resources/event-sender-util.js"></script>
6 <p>Applying document.execCommand('Bold') to elements having insertion points (
<shadow
> or
<content
>) shoud not cause a crash.
</p>
7 <p>To test manually, make a selection from somewhere in
"nested before" to somehwere in
"nested after", then press Ctrl+B twice. It should not cause a crash.
</p>
9 <div id=
"container" contenteditable
>
11 <div id=
"host"> <span contenteditable=
"false">not editable
<span></div>
14 <pre id=
"console"></pre>
17 if (window
.testRunner
)
18 testRunner
.dumpAsText();
20 var shadowRoot
= host
.createShadowRoot();
21 shadowRoot
.innerHTML
= '<div id="shadow-host"><span contenteditable>shadow before</span><shadow></shadow>shadow (after)</div>';
23 var nestedShadowHost
= shadowRoot
.getElementById('shadow-host');
24 var nestedShadowRoot
= nestedShadowHost
.createShadowRoot();
25 nestedShadowRoot
.innerHTML
= '<div id="inner" contenteditable>nested before<shadow></shadow>nested after</div>';
27 if (window
.eventSender
) {
28 var div
= nestedShadowRoot
.getElementById('inner');
30 eventSender
.mouseMoveTo(div
.offsetLeft
+ 5, div
.offsetTop
+ div
.offsetHeight
/ 2);
31 eventSender
.mouseDown();
32 eventSender
.mouseMoveTo(div
.offsetLeft
+ div
.offsetWidth
- 5, div
.offsetTop
+ div
.offsetHeight
/ 2);
33 eventSender
.mouseUp();
35 document
.execCommand('Bold');
36 document
.execCommand('Bold');
38 container
.innerHTML
= "PASS";