Fix webkitdropzone to accept file drops on non-file: page.

Most of webkitdropzone's implementation is in findDropZone() in
core/input/EventHandler.cpp. The implementation relies on two functions
in DataTransfer that only work for DataTransfer instances that allow all
the drop data to be read. According to the drag-and-drop specification,
this should only be the case in the event handlers for dragstart (when
the DataTransfer instance is writable) and for drop. In all other cases,
the DataTransfer instance only allows limited metadata to be read.

For some reason we let DataTransfer instances be readable most of the
time for pages served from file: origins. This will be fixed in a
follow-up CL. Out LayoutTest covering file drops into a webkitdropzone
element passes due to this glitch, combined with the fact that the test
is served from a file: origin.

This CL fixes the functions in webkitdropzone's implementation, mostly
to clear the way for fixing DataTransfer's permissions.

BUG=104681

Review-Url: https://codereview.chromium.org/2575303002
Cr-Commit-Position: refs/heads/master@{#439280}
3 files changed