5 <script src=
"../../fast/dom/resources/event-sender-util.js"></script>
6 <script src=
"../../resources/js-test.js"></script>
8 <p>On the second time selecting
<span
>, it should not become non-contenteditable.
9 If it becomes non-contenteditable, the selection from
<span
> to
<table
>
10 will break editing boundaries and contain
"a".
11 This test checks the
<span
> does not changed to non-contenteditable element.
</p>
13 <div id=
"host" contenteditable
></div>
14 <pre id=
"console"></pre>
17 var shadowRoot
= host
.createShadowRoot();
18 shadowRoot
.innerHTML
= '<table border="1">' +
19 '<tr><td id="dst">aaaaa</td><td id="another">aaaaa</td></tr>' +
20 '<tr><td>aaaaa</td><td>aaaaa</td></tr>' +
21 '</table><span id="src" contenteditable>bbbbb</span>';
23 var src
= shadowRoot
.getElementById('src');
24 var dst
= shadowRoot
.getElementById('dst');
25 var another
= shadowRoot
.getElementById('another');
27 // 1. Select from src to dst.
29 eventSender
.mouseDown();
31 eventSender
.mouseUp();
33 // 2. Click some element.
34 mouseMoveToElem(another
);
35 eventSender
.mouseDown();
36 eventSender
.mouseUp();
38 // 3. Select from src to dst again.
40 eventSender
.mouseDown();
42 eventSender
.mouseUp();
44 function contains(str
, key
) {
45 return str
.indexOf(key
) >= 0;
48 var selectedString
= shadowRoot
.getSelection().toString();
49 shouldBeFalse('contains(selectedString, "a")');
51 var successfullyParsed
= true;