Changes between Initial Version and Version 1 of Ticket #11460, comment 4


Ignore:
Timestamp:
Feb 10, 2014, 1:12:32 PM (10 years ago)
Author:
Piotr Jasiun
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #11460, comment 4

    initial v1  
    2222>     * content of text file.
    2323
    24 I did such research for dropping few days ago. I will repeat it for pasting and send result in the next comment.
     24Research is avaible in #11526.
    2525
    2626>
     
    3030>
    3131
    32 Well... the problem now is that specification is far from reality. Event in introduction they are writing about attributes and solutions not supported in some or any browser (like `dropzone` or custom data type). So probably one day in the future browsers will be closer to the specification but it is far future. The main problem is (of course) IE. Anyway:
     32Well... the problem now is that specification is far from reality. Event in introduction they are writing about attributes and solutions not supported in some or any browser (like `dropzone` or custom data type). So probably one day in the future browsers will be closer to the specification but it is far future. The main problem is (of course) IE. Anyway W3C APIs are described in #11526.
    3333
    34 Both drop and paste events can contain [http://www.w3.org/TR/html5/editing.html#datatransfer DataTransfer] object which is most important for us. Basically it a list of 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:
    35   - if you drop file you will get two items, both of them are "file", so they are two part of data,
    36   - 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 Chrome).
    37 Specification does not said if  data should be thread as a one piece of data in multiple format 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.".
    38 
    39 `DataTransfer` support also old interface with separate list of file and list of string data in types (IMHO old interface is cleaner).
    40 
    41 There are also a lot of cool features like drag icon or `droparea` which allows only defined types to be drop. One more good new is that there are both asynchronous and synchronous `FileReader` to read dropped file.
    42  
    4334> 4. Question: do we need “drop file here” area? File should be dropped under the cursor, just like inline widget is dropped. It works this way when I drop image into TextEdit - I see a caret and image is inserted at that position. It works differently in Gmail, but image is an attachment there, so it’s a different case. MS Word should be checked.
    4435
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy