paste-event-manual.html (869B)
1 <!doctype html> 2 <title>The paste event</title> 3 <link rel="help" href="https://w3c.github.io/clipboard-apis/#clipboard-event-paste"> 4 <script src="/resources/testharness.js"></script> 5 <script src="/resources/testharnessreport.js"></script> 6 <div id=log></div> 7 <input placeholder="Paste any text here to continue" size="100"> 8 <p>Some pre-selected text to copy for convenience</p> 9 <script> 10 setup({explicit_timeout: true}); 11 async_test(t => { 12 getSelection().selectAllChildren(document.querySelector('p')); 13 document.onpaste = t.step_func_done(event => { 14 // Nothing can be asserted about the event target until 15 // https://github.com/w3c/clipboard-apis/issues/70 is resolved. 16 // assert_equals(event.target, document.body, 'event.target'); 17 assert_true(event.isTrusted, 'event.isTrusted'); 18 assert_true(event.composed, 'event.composed'); 19 }); 20 }); 21 </script>