blob: 460c13cf56dff68db0b08263adc70e79d98c1ce8 [file] [log] [blame]
<!DOCTYPE html><!-- webkit-test-runner [ AttachmentElementEnabled=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 file promises onto an editable area, then attachments should not be inserted into the editable area since attachment elements are disabled.');
jsTestIsAsync = true;
var editable = document.getElementById("editable");
editable.addEventListener("drop", () => window.setTimeout(() => {
shouldBeUndefined('window.HTMLAttachmentElement');
shouldBeTrue('document.createElement("attachment") instanceof HTMLUnknownElement');
shouldBe('editable.querySelector("attachment")', 'null');
shouldBe('editable.textContent', '""');
editable.innerHTML = '';
finishJSTest();
}, 0));
if (window.eventSender)
dragFilesOntoEditable(['resources/apple.gif', 'resources/mozilla.gif', 'resources/drop-file-svg.svg']);
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.beginDragWithFilePromises(files);
moveMouseToCenterOfElement(editable);
eventSender.mouseUp();
}
var successfullyParsed = true;
</script>
<script src="../../resources/js-test-post.js"></script>
</body>
</html>