blob: d5d02432ce97ff6c8dbc73f73b46b36115d525e7 [file] [log] [blame]
<!DOCTYPE html><!-- webkit-test-runner [ enableAttachmentElement=false ] -->
<html>
<body>
<p id="description"></p>
<div id="console"></div>
<div id="editable" contentEditable=true style="width:200px; height:200px"></div>
<script src="../../resources/js-test-pre.js"></script>
<script>
description('If we drag files onto an editable area, then attachments should not be inserted into the editable area since attachment elements are disabled.');
var editable = document.getElementById("editable");
if (window.eventSender) {
dragFilesOntoEditable(['foo', 'bar', 'baz']);
shouldBeUndefined('window.HTMLAttachmentElement');
shouldBeTrue('document.createElement("attachment") instanceof HTMLUnknownElement');
shouldBe('editable.querySelector("attachment")', 'null');
shouldBe('editable.textContent', '""');
editable.innerHTML = '';
}
function moveMouseToCenterOfElement(element)
{
var centerX = element.offsetLeft + element.offsetWidth / 2;
var centerY = element.offsetTop + element.offsetHeight / 2;
eventSender.mouseMoveTo(centerX, centerY);
}
function dragFilesOntoEditable(files)
{
eventSender.beginDragWithFiles(files);
moveMouseToCenterOfElement(editable);
eventSender.mouseUp();
}
var successfullyParsed = true;
</script>
<script src="../../resources/js-test-post.js"></script>
</body>
</html>