| <!DOCTYPE html><!-- webkit-test-runner [ runSingly=true ] --> |
| <html> |
| <head> |
| <script> |
| function runTest() |
| { |
| if (window.testRunner && window.eventSender) { |
| testRunner.dumpAsText(); |
| |
| const link = document.getElementById("link"); |
| const x = link.offsetLeft + link.offsetWidth / 2; |
| const y = link.offsetTop + link.offsetHeight / 2; |
| |
| eventSender.mouseMoveTo(x, y); |
| items = eventSender.contextClick(); |
| |
| link.href = 'file:///etc/passwd'; |
| |
| for (var i = 0; i < items.length; i++) |
| { |
| if (items[i].title.match("Copy Link")) { |
| items[i].click(); |
| } |
| } |
| |
| const pastedContent = document.getElementById("pasted-content"); |
| pastedContent.focus(); |
| document.execCommand("paste"); |
| } |
| } |
| </script> |
| </head> |
| <body onload="runTest();"> |
| <a id="link" href='https://www.webkit.org' style='background: #000000; display: block; width: 200px; height: 200px;'></a> |
| <p id="description">File URLs should not be copied to the clipboard. There should be no pasted content below.</p> |
| <input id="pasted-content"/> |
| </body> |
| </html> |