Changes between Version 2 and Version 3 of Ticket #11526, comment 2


Ignore:
Timestamp:
Feb 12, 2014, 10:11:45 AM (11 years ago)
Author:
Piotrek Koszuliński
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #11526, comment 2

    v2 v3  
    55 - in `dragstart`, `drop` etc. events as `evt.dataTransfer`.
    66
    7 DataTransfer object support both old and new API.
     7DataTransfer object supports both old and new API.
    88
    99== New API ==
    1010
    11 Basically it a list of items (`dataTransfer.items`). Every item can be a file or a string data in certain type. Data type might be MIME types but it is not necessary. Theoretically it is possible to have mixed files and string data. I wrote "theoretically", because it is not defined how such data should be thread:
     11Basically it is a list of items (`dataTransfer.items`). Every item can be a file or a string data in certain type. Data type might be a MIME type but it is not necessary. Theoretically it is possible to have mixed files and string data. I wrote "theoretically", because it is not defined how such data should be treated:
    1212  - if you drop 2 files you will get two items, both of them are "file", so they are two part of data,
    1313  - if you drop html you can get also two items, both of them are strings: one in text/html type, second one in text/plain, so this is the same data in two format (this is what we get in Blink).
    14 Specification does not said if data should be thread as a one piece of data in multiple formats of multiple pieces of data. It depend on data. The only information we get is: "The drag data store item list is ordered in the order that the items were added to the list; most recently added last.".
    1514
    16 Blink is now the only engine which support new API for now.
     15Specification does not state if data should be treated as a one piece of data in multiple formats of multiple pieces of data. It depends on data. The only information we get is: "The drag data store item list, in the order that the items were added to the list; most recently added last.".
     16
     17Blink is now the only engine which supports new API.
    1718
    1819== Old API ==
    1920
    20 Old API is move complex. DataTransfer contains:
     21Old API is more complex. `DataTransfer` contains:
    2122
    22   - `types` - array of string ex. ['plain/text','plain/html'] or ['Files'],
    23   - `files` - array of files, if files array contains any element then `types` contains 'Files' element,
     23  - `types` - an array of string e.g. ['plain/text','plain/html'] or ['Files'],
     24  - `files` - an array of files, if files array contains any element then `types` contains 'Files' element,
    2425  - `getData(format)` - get string data, format is a string type from `types` array,
    2526  - `setData(format, data)` - set data by format.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy