By default, you can drag text (or even files) onto textarea, however, this action does not trigger the onDrop event. Steps to reproduce: * select arbitrary text * drop onto the textarea Expected results: * logging the action via the scripted ondrop event Assigned to Darin Adler for similarities to bug#3256 http://bugzilla.opendarwin.org/show_bug.cgi?id=3256
Created attachment 2413 [details] Testcase - drop text onto the textarea
I would add that it's not just onDrop, but any drag event (ondragover, ondragenter, ondragleave). Strangely only the border of the textarea (the 1 pixel line around the textarea) seems to fire these events but the body of the textarea does not. Also positioning elements above a textarea (absolutely positioned) causes events not to fire on that element either (seems as if the textarea below the elements is intercepting and sinking the events). Dropping text on a div, absolutely positioned above a textarea causes the text to appear in the textarea (instead of being handled by the upper element).
drop also seems to never fire for contentEditable regions.
The test case (<https://bugs.webkit.org/attachment.cgi?id=2413>) is invalid, because it does not listen for the dragenter and dragover events as required by section 7.9.1 of the HTML 5 spec, <http://dev.w3.org/html5/spec/Overview.html#introduction-4>. In particular, the spec. states, "to accept a drop, the drop target has to listen to at least three events: [dragenter, dragover, and drop]". When the above prerequisite is satisfied, we do not ignore ondrop events to textareas. Moreover, dragenter, dragover, and drop events are all delivered to the textarea. Actually, we fire the ondrop event so long as the textarea is listening for dragover events. We should probably file a separate bug to make dragenter also required.
Created attachment 43973 [details] Working example In this example, the textarea listens for dragenter, dragover, and drop events. When you successfully drop the text (in whole or in part) on the textarea, a JavaScript alert will be shown, "Caught drop."
Dan's analysis makes sense to me.