c1d1b5c61b50ce2b95cfc88bc02f185bfdf177c5
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / editing / execCommand / 5164796.html
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>
4
5 <script>
6
7 if (window.testRunner)
8     testRunner.dumpAsText();
9
10 function log(message) {
11     var console = document.getElementById("console");
12     var text = document.createTextNode(message);
13     console.appendChild(text);
14 }
15
16 var div = document.getElementById("div");
17 var text = div.firstChild;
18 var selection = window.getSelection();
19 selection.setPosition(text, text.length - 1);
20
21 document.execCommand("CreateLink", false, "http://www.apple.com/");
22
23 log(div.innerHTML);
24
25 </script>