Automatic update from web-platform-tests
Support dragging JS File objects to native drop targets
When a web app places a JS File object (new File([bytes], 'photo.jpg'))
into a dragstart handler, the blob bytes were previously discarded in
DataObject::ToWebDragData().
This CL reads the blob bytes synchronously at drag-start time using
SyncedFileReaderAccumulator::Load() and passes them as a BinaryDataItem
through the IPC pipeline. Platform-specific delivery to native drop
targets is handled by the existing PrepareDragForFileContents() path,
which is already enabled for Linux, ChromeOS, and Windows via BUILDFLAG
guards in web_contents_view_aura.cc.
Currently, image file types are supported via the
GetSafeFilenameForImageFileContents() gate.
To enable this feature, launch Chrome with:
--enable-blink-features=DragAndDropJSFileObjects
Bug: 41120809
Change-Id: Ibe12d867f7d01a972b7aeb6ce55660adb7300b27
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7603160
Reviewed-by: Rohan Raja <roraja@microsoft.com>
Reviewed-by: Kent Tamura <tkent@chromium.org>
Commit-Queue: Joone Hur <joonehur@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#1627402}
--
wpt-commits: 6fd907a40e68c632146df346deba6ba60299e2d5
wpt-pr: 59744