blob: 05fbfb3a2c4a010f065cecb75c4399afaec31190 [file] [log] [blame]
<!DOCTYPE html>
<style>
body {
-webkit-user-select: none;
}
.editing {
border: 2px solid red;
padding: 12px;
font-size: 24px;
-webkit-user-select: text;
-webkit-user-modify: read-write-plaintext-only;
}
</style>
<script src=../../resources/js-test.js></script>
<div id="container">
<p>To test manually, copy "Test Passed" into clipboard, and paste in below box.</p>
<input id="textfield" value="Test Passed">
<div id="sample" class="editing"></div>
</div>
<script>
description('This tests that you can paste into a plain-text editable area even if the body has user-select:none set on it.');
document.getElementById('textfield').select();
document.execCommand('copy');
var sample = document.getElementById('sample');
sample.focus();
document.execCommand('paste');
shouldBeEqualToString('sample.textContent', 'Test Passed');
</script>