Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / editing / inserting / insert-before-link-1.html
blob5a08f4bfdb4b5d1b4bc4b39b1478a98f3ec9c7cf
1 <div id="description">This tests insertion before/after links. Text should always be inserted at the start or end of a link should be inserted outside of it.</div>
2 <div id="edit" contenteditable="true"><a id="link" href="http://www.google.com/">this should</a> <a href="http://www.google.com/">this should</a></div>
4 <script>
6 if (window.testRunner)
7 window.testRunner.dumpAsText();
9 var edit = document.getElementById("edit");
10 var sel = window.getSelection();
12 sel.collapse(edit, 0);
14 document.execCommand("InsertText", false, "this text should not be in a link");
15 sel.modify("move", "forward", "word");
16 sel.modify("move", "forward", "word");
18 document.execCommand("InsertText", false, "this should not");
20 sel.modify("move", "forward", "paragraphBoundary");
22 document.execCommand("InsertText", false, "this should not");
24 if (window.testRunner)
25 document.body.innerText = document.getElementById("description").innerText + "\n\n" + edit.innerHTML;
26 </script>