Resolving the dataTransfer.files[n].text promise when triggered from a drag and drop event causes a NS_ERROR_FAILURE error
Categories
(Core :: DOM: File, defect, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox71 | --- | fixed |
People
(Reporter: bluebottel, Assigned: baku)
References
Details
Attachments
(3 files)
User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:69.0) Gecko/20100101 Firefox/69.0
Steps to reproduce:
Demo here: http://jsfiddle.net/0q5k6m9d/
Set up a drop zone and add a ondrop handler. In the ondrop handler function attempt to resolve the promise to get the file content like so
event.dataTransfer.files[0].text(fileContent => { ... }
I tested this on Ubuntu 18.04 and Windows 10 with Firefox 69.01
Actual results:
"NS_ERROR_FAILURE" is written to the console and the execution of the script is halted.
Expected results:
The file's content should be accessible after the promise resolves.
Updated•5 years ago
|
Comment 1•5 years ago
•
|
||
Looks the NS_ERROR_FAILURE may be thrown from Blob implementation... moving this bug to DOM:File ...
Comment 2•5 years ago
|
||
Looks like baku (somewhat recently) implemented this in bug 1557121 so he may have the most informed opinion.
Updated•5 years ago
|
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Comment 3•5 years ago
|
||
Assignee | ||
Comment 4•5 years ago
|
||
Assignee | ||
Comment 5•5 years ago
|
||
Pushed by amarchesini@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/30100f2c6128 Use nsIGlobalObject in any Blob/File CTOR, r=smaug https://hg.mozilla.org/integration/autoland/rev/bee7aebbca69 Use BlobImpl in MutableBlobStorage instead of Blob, r=smaug https://hg.mozilla.org/integration/autoland/rev/87469bcb7a13 Force global in Blob CTOR, r=smaug
Comment 7•5 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/30100f2c6128
https://hg.mozilla.org/mozilla-central/rev/bee7aebbca69
https://hg.mozilla.org/mozilla-central/rev/87469bcb7a13
Updated•3 years ago
|
Description
•