Closed Bug 1162775 Opened 9 years ago Closed 9 years ago

Make contentAreaDropListener.js use dataTransfer.files

Categories

(Core :: DOM: Events, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla41
Tracking Status
firefox41 --- fixed

People

(Reporter: mossop, Assigned: mossop)

References

Details

Attachments

(1 file, 1 obsolete file)

Currently it attempts to get an nsIFile from the data transfer in order to get a URL for the dropped file. With sandboxing using an nsIFile in the content process may be difficult. Instead we should use dataTransfer.files but then we need a way to get a URL for a File. Currently the way we construct file: URIs revolves around nsIFile (net_GetURLSpecFromActualFile is the root and is platform specific).
Attached patch patch (obsolete) — Splinter Review
I guess we do have a way to get a file URI without an nsIFile after all!
Assignee: nobody → dtownsend
Status: NEW → ASSIGNED
Attachment #8604187 - Flags: review?(bugs)
Blocks: 1160279
Comment on attachment 8604187 [details] [diff] [review]
patch

Interesting. Crossing fingers toFileURI does the right thing ;)
It really should.
Attachment #8604187 - Flags: review?(bugs) → review+
Attached patch patchSplinter Review
Missed that files can sometimes be null.
Attachment #8604187 - Attachment is obsolete: true
Flags: needinfo?(dtownsend)
Attachment #8605532 - Flags: review?(bugs)
Comment on attachment 8605532 [details] [diff] [review]
patch

Sorry, I should have noticed that.
Attachment #8605532 - Flags: review?(bugs) → review+
https://hg.mozilla.org/mozilla-central/rev/34a03726e059
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla41
You need to log in before you can comment on or make changes to this bug.