6 var console
= document
.getElementById('console');
7 console
.appendChild(document
.createElement('div')).appendChild(document
.createTextNode(s
));
10 if (window
.testRunner
)
11 testRunner
.dumpAsText();
12 document
.body
.addEventListener('copy', onCopy
);
13 document
.body
.addEventListener('paste', onPaste
);
14 document
.execCommand('Copy');
15 document
.execCommand('PasteAndMatchStyle');
18 e
.clipboardData
.setData('text', 'Hello');
19 e
.clipboardData
.setData('text/html', 'World');
23 log('Types: ' + e
.clipboardData
.types
);
24 log('text/plain: "' + e
.clipboardData
.getData('text/plain') + '"');
25 log('text/html: "' + e
.clipboardData
.getData('text/html') + '"');
29 <body onload=
"startTest()">
30 <div>To run this test manually, simply try invoking the copy command on this
31 page followed by the paste as plain text command. If it works, text/plain should
32 be the only MIME type, 'Hello' should be associated with text/plain, and the
33 empty string should be associated with text/html.
</div>
34 <div id=
"console"></div>