| Copy this text! |
| To manually test, copy the above text. The output below dumps DataTransfer state following each operation, |
| |
| described directly above the output text for each step. The DataTransfer state should be consistent with the |
| |
| operation performed at each step. |
| |
| |
| 1. After adding all items |
| { |
| "data": { |
| "Files": "", |
| "text/plain": "plain text string", |
| "text/uri-list": "https://webkit.org" |
| }, |
| "items": [ |
| { |
| "type": "text/plain", |
| "kind": "file", |
| "file": { |
| "name": "file.txt", |
| "bytes": 20, |
| "type": "text/plain" |
| } |
| }, |
| { |
| "type": "text/plain", |
| "kind": "file", |
| "file": { |
| "name": "file.txt", |
| "bytes": 20, |
| "type": "text/plain" |
| } |
| }, |
| { |
| "type": "text/plain", |
| "kind": "string", |
| "file": null |
| }, |
| { |
| "type": "text/uri-list", |
| "kind": "string", |
| "file": null |
| }, |
| { |
| "type": "text/plain", |
| "kind": "file", |
| "file": { |
| "name": "file.txt", |
| "bytes": 20, |
| "type": "text/plain" |
| } |
| }, |
| { |
| "type": "text/plain", |
| "kind": "file", |
| "file": { |
| "name": "file.txt", |
| "bytes": 20, |
| "type": "text/plain" |
| } |
| } |
| ], |
| "files": [ |
| { |
| "name": "file.txt", |
| "bytes": 20, |
| "type": "text/plain" |
| }, |
| { |
| "name": "file.txt", |
| "bytes": 20, |
| "type": "text/plain" |
| }, |
| { |
| "name": "file.txt", |
| "bytes": 20, |
| "type": "text/plain" |
| }, |
| { |
| "name": "file.txt", |
| "bytes": 20, |
| "type": "text/plain" |
| } |
| ] |
| } |
| |
| 2. After removing at index 4 |
| { |
| "data": { |
| "Files": "", |
| "text/plain": "plain text string", |
| "text/uri-list": "https://webkit.org" |
| }, |
| "items": [ |
| { |
| "type": "text/plain", |
| "kind": "file", |
| "file": { |
| "name": "file.txt", |
| "bytes": 20, |
| "type": "text/plain" |
| } |
| }, |
| { |
| "type": "text/plain", |
| "kind": "file", |
| "file": { |
| "name": "file.txt", |
| "bytes": 20, |
| "type": "text/plain" |
| } |
| }, |
| { |
| "type": "text/plain", |
| "kind": "string", |
| "file": null |
| }, |
| { |
| "type": "text/uri-list", |
| "kind": "string", |
| "file": null |
| }, |
| { |
| "type": "text/plain", |
| "kind": "file", |
| "file": { |
| "name": "file.txt", |
| "bytes": 20, |
| "type": "text/plain" |
| } |
| } |
| ], |
| "files": [ |
| { |
| "name": "file.txt", |
| "bytes": 20, |
| "type": "text/plain" |
| }, |
| { |
| "name": "file.txt", |
| "bytes": 20, |
| "type": "text/plain" |
| }, |
| { |
| "name": "file.txt", |
| "bytes": 20, |
| "type": "text/plain" |
| } |
| ] |
| } |
| removedItem.getAsFile() should be null: null |
| |
| 3. After removing at index 1 |
| { |
| "data": { |
| "Files": "", |
| "text/plain": "plain text string", |
| "text/uri-list": "https://webkit.org" |
| }, |
| "items": [ |
| { |
| "type": "text/plain", |
| "kind": "file", |
| "file": { |
| "name": "file.txt", |
| "bytes": 20, |
| "type": "text/plain" |
| } |
| }, |
| { |
| "type": "text/plain", |
| "kind": "string", |
| "file": null |
| }, |
| { |
| "type": "text/uri-list", |
| "kind": "string", |
| "file": null |
| }, |
| { |
| "type": "text/plain", |
| "kind": "file", |
| "file": { |
| "name": "file.txt", |
| "bytes": 20, |
| "type": "text/plain" |
| } |
| } |
| ], |
| "files": [ |
| { |
| "name": "file.txt", |
| "bytes": 20, |
| "type": "text/plain" |
| }, |
| { |
| "name": "file.txt", |
| "bytes": 20, |
| "type": "text/plain" |
| } |
| ] |
| } |
| removedItem.getAsFile() should be null: null |
| |
| 4. After removing at index 3 |
| { |
| "data": { |
| "Files": "", |
| "text/plain": "plain text string", |
| "text/uri-list": "https://webkit.org" |
| }, |
| "items": [ |
| { |
| "type": "text/plain", |
| "kind": "file", |
| "file": { |
| "name": "file.txt", |
| "bytes": 20, |
| "type": "text/plain" |
| } |
| }, |
| { |
| "type": "text/plain", |
| "kind": "string", |
| "file": null |
| }, |
| { |
| "type": "text/uri-list", |
| "kind": "string", |
| "file": null |
| } |
| ], |
| "files": [ |
| { |
| "name": "file.txt", |
| "bytes": 20, |
| "type": "text/plain" |
| } |
| ] |
| } |
| removedItem.getAsFile() should be null: null |
| |
| 5. After clearing items |
| { |
| "data": {}, |
| "items": [], |
| "files": [] |
| } |
| |
| 6. After adding two files and some string data again |
| { |
| "data": { |
| "Files": "", |
| "text/html": "<strong>some styled text</strong>", |
| "text/plain": "some plain text" |
| }, |
| "items": [ |
| { |
| "type": "text/plain", |
| "kind": "file", |
| "file": { |
| "name": "file.txt", |
| "bytes": 20, |
| "type": "text/plain" |
| } |
| }, |
| { |
| "type": "text/html", |
| "kind": "string", |
| "file": null |
| }, |
| { |
| "type": "text/plain", |
| "kind": "string", |
| "file": null |
| }, |
| { |
| "type": "text/plain", |
| "kind": "file", |
| "file": { |
| "name": "file.txt", |
| "bytes": 20, |
| "type": "text/plain" |
| } |
| } |
| ], |
| "files": [ |
| { |
| "name": "file.txt", |
| "bytes": 20, |
| "type": "text/plain" |
| }, |
| { |
| "name": "file.txt", |
| "bytes": 20, |
| "type": "text/plain" |
| } |
| ] |
| } |
| |
| 7. After removing at index 2 |
| { |
| "data": { |
| "Files": "", |
| "text/html": "<strong>some styled text</strong>" |
| }, |
| "items": [ |
| { |
| "type": "text/plain", |
| "kind": "file", |
| "file": { |
| "name": "file.txt", |
| "bytes": 20, |
| "type": "text/plain" |
| } |
| }, |
| { |
| "type": "text/html", |
| "kind": "string", |
| "file": null |
| }, |
| { |
| "type": "text/plain", |
| "kind": "file", |
| "file": { |
| "name": "file.txt", |
| "bytes": 20, |
| "type": "text/plain" |
| } |
| } |
| ], |
| "files": [ |
| { |
| "name": "file.txt", |
| "bytes": 20, |
| "type": "text/plain" |
| }, |
| { |
| "name": "file.txt", |
| "bytes": 20, |
| "type": "text/plain" |
| } |
| ] |
| } |
| removedItem.getAsFile() should be null: null |
| |
| 8. After removing at index 2 |
| { |
| "data": { |
| "Files": "", |
| "text/html": "<strong>some styled text</strong>" |
| }, |
| "items": [ |
| { |
| "type": "text/plain", |
| "kind": "file", |
| "file": { |
| "name": "file.txt", |
| "bytes": 20, |
| "type": "text/plain" |
| } |
| }, |
| { |
| "type": "text/html", |
| "kind": "string", |
| "file": null |
| } |
| ], |
| "files": [ |
| { |
| "name": "file.txt", |
| "bytes": 20, |
| "type": "text/plain" |
| } |
| ] |
| } |
| removedItem.getAsFile() should be null: null |
| |
| 9. After removing at index 1 |
| { |
| "data": { |
| "Files": "" |
| }, |
| "items": [ |
| { |
| "type": "text/plain", |
| "kind": "file", |
| "file": { |
| "name": "file.txt", |
| "bytes": 20, |
| "type": "text/plain" |
| } |
| } |
| ], |
| "files": [ |
| { |
| "name": "file.txt", |
| "bytes": 20, |
| "type": "text/plain" |
| } |
| ] |
| } |
| removedItem.getAsFile() should be null: null |
| |
| 10. After removing at index 0 |
| { |
| "data": {}, |
| "items": [], |
| "files": [] |
| } |
| removedItem.getAsFile() should be null: null |
| |