Bug 170168 - Implement the DataTransfer constructor
Summary: Implement the DataTransfer constructor
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
Depends on:
Reported: 2017-03-27 22:52 PDT by Domenic Denicola
Modified: 2019-12-30 01:13 PST (History)
6 users (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Domenic Denicola 2017-03-27 22:52:30 PDT
Spec change: https://github.com/whatwg/html/commit/688a102b52c7050a6808a05c5d8fe149c0937fd7
Tests: http://w3c-test.org/html/editing/dnd/datastore/datatransfer-constructor-001.html

This is part of a larger feature for async clipboard APIs; see discussion in https://github.com/w3c/clipboard-apis/issues/33. But it can be implemented independently.
Comment 1 Jonathan 2019-12-30 01:13:39 PST
This constructor will also allow the instanciation of a FileList (it currently works on Firefox / Chromium)

Without this API it's impossible to create a FileList from a File array 

  const data = new DataTransfer() // This is not working on webkit
  files.forEach(file => data.items.add(file))
  return data.files