Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / editing / execCommand / 5164796.html
blob05c799ef7b660a5eb77634ca19bf98d3b3508e12
1 <p>This tests CreateLink for caret selections. A link containing the url text should be inserted.</p>
2 <div contenteditable="true" id="div">There should be a link between these two braces: {}</div>
3 <p id="console"></p>
5 <script>
7 if (window.testRunner)
8 testRunner.dumpAsText();
10 function log(message) {
11 var console = document.getElementById("console");
12 var text = document.createTextNode(message);
13 console.appendChild(text);
16 var div = document.getElementById("div");
17 var text = div.firstChild;
18 var selection = window.getSelection();
19 selection.collapse(text, text.length - 1);
21 document.execCommand("CreateLink", false, "http://www.apple.com/");
23 log(div.innerHTML);
25 </script>