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>
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/");