Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / editing / shadow / breaking-editing-boundary-with-table.html
bloba4d73723f987409d36b86fb976009884144c0561
1 <!DOCTYPE html>
3 <html>
4 <body>
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 &lt;span&gt;, it should not become non-contenteditable.
9 If it becomes non-contenteditable, the selection from &lt;span&gt; to &lt;table&gt;
10 will break editing boundaries and contain "a".
11 This test checks the &lt;span&gt; does not changed to non-contenteditable element.</p>
13 <div id="host" contenteditable></div>
14 <pre id="console"></pre>
16 <script>
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.
28 mouseMoveToElem(src);
29 eventSender.mouseDown();
30 mouseMoveToElem(dst);
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.
39 mouseMoveToElem(src);
40 eventSender.mouseDown();
41 mouseMoveToElem(dst);
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;
52 </script>
53 </body>
54 </html>