6 var log
= document
.getElementById('log');
7 log
.appendChild(document
.createTextNode(text
));
8 log
.appendChild(document
.createElement('br'));
11 function copyTest(e
) {
12 e
.clipboardData
.setData('text/plain', 'copy test');
13 if (event
.clipboardData
.types
.indexOf('text/plain') < 0 ||
14 event
.clipboardData
.getData('text/plain') != 'copy test')
21 e
.clipboardData
.setData('text/plain', 'cut test');
22 if (event
.clipboardData
.types
.indexOf('text/plain') < 0 ||
23 event
.clipboardData
.getData('text/plain') != 'cut test')
30 if (!window
.testRunner
)
32 testRunner
.dumpAsText();
33 document
.execCommand('copy');
34 document
.execCommand('cut');
38 <body onload=
"runTest()" oncopy=
"copyTest(event)" oncut=
"cutTest(event)">
39 <p>Simple test that data set during a copy/cut event can be read back. To run
40 the test manually, simply select any text and initiate a copy/cut operation.