When dragging files from Finder or elsewhere over an element, the dragenter/dragover events fire as expected, but the `e.dataTransfer.items` list is empty. This means that it's impossible to only accept drops of certain file types. The only information available is that the `dataTransfer.types` property includes "Files", but this doesn't tell us the actual file types. While I wouldn't expect to be able to read the dragged content until drop, I would expect to be able to read their types to determine if the drop should be accepted. In both Chrome and Firefox the `items` list includes DataTransferItem objects that include a `kind` of "file" and a `type` property containing the mime type of the files being dragged. In addition, when dragging non-files (e.g. the `kind` is "string"), the items list is not empty and does allow access to the types. Steps to reproduce: 1. Open https://codepen.io/devongovett/pen/jOVjRdJ 2. Drag a PNG file from Finder over the drop zone. 3. Notice that the drop zone does not turn green because the `e.dataTransfer.items` list does not contain any items with type "image/png". Dropping the file also does nothing. The result is that no files can be dropped. 4. Open the same page in Chrome and Firefox. Notice that it does turn green when dragging a PNG file over the drop zone. Also notice that it does not turn green when dragging non PNG files over the drop zone. Looking at the spec, I think the data transfer should be in protected mode during these events rather than disabled mode. This means the list of items can be enumerated, but the actual data is not readable. See https://html.spec.whatwg.org/multipage/dnd.html#drag-data-store. See also https://html.spec.whatwg.org/multipage/dnd.html#dndevents. Unfortunately, the only workaround to this bug is not to filter by file type at all, and instead accept drops of all file types. This leads to a sub-optimal user experience where drop zones highlight to indicate that a user can drop files there but on drop nothing happens or an error message must be shown to indicate that the files were not accepts. If this bug were fixed, we could only highlight the drop zone when supported files are dragged.
<rdar://problem/75886386>
Adding 'BrowserCompat' and I am able to reproduce this on WebKit ToT (272499@main) with changes to 'IDL' files as per Web-Spec for 'DataTransferItemList' as well (as per bug 266893).