1 <p>This tests to make sure that copying/pasting HTML results in URLs being full paths so
2 pasting between websites works. To test manually, copy the selection and paste it into
3 the blue box. If this is a file:/// url, the links should be relative. If this is an
4 http:// url, the links should be absolute.
</p>
6 <a href=
"../relative/path/foo.html">link
</a><img src=
"resources/abe.png">
8 <div id=
"pastehere" contenteditable=
"true" style=
"border: 1px solid blue" onpaste=
"paste()">
10 <div id=
"results"></div>
14 var s
= window
.getSelection();
15 var test
= document
.getElementById("test");
16 s
.selectAllChildren(test
);
18 if (!window
.testRunner
)
20 testRunner
.dumpAsText();
21 testRunner
.waitUntilDone();
23 document
.execCommand("Copy");
24 var pasteHere
= document
.getElementById("pastehere");
25 s
.collapse(pasteHere
, 0);
26 document
.execCommand("Paste");
31 setTimeout(afterPaste
, 0);
36 var pasteHere
= document
.getElementById("pastehere");
37 var results
= document
.getElementById("results");
38 results
.appendChild(document
.createTextNode(pasteHere
.innerHTML
));
39 if (window
.testRunner
)
40 testRunner
.notifyDone();