Open Bug 1437126 Opened 8 years ago Updated 4 days ago

drag/dropping image from one tab into another should drop the image, not the URL.

Categories

(Core :: DOM: Copy & Paste and Drag & Drop, enhancement, P5)

enhancement

Tracking

()

Tracking Status
firefox109 --- fixed
firefox110 --- disabled
firefox111 --- disabled

People

(Reporter: mhoye, Unassigned)

References

Details

Attachments

(2 files)

Feature request: If you've got an image in one tab and an input box that accepts it in another (e.g. Slack) then dragging an image out of one tab into another should bring over the image, not the URL.
Priority: -- → P5
Severity: normal → S3
Depends on: 1801499
Blocks: 1801499
No longer depends on: 1801499

When using images with drag & drop (or the clipboard) we use two or more different types:

  • When dragging an image we put it into the DataTransfer object using the
    type kNativeImageMime and the data as an imgIContainer object.
  • When dropping an image we want to have some kind of image/ type,
    but the data is already supposed to be a File or nsIInputStream when it comes from the OS.

This weird split usually works fine, because in our GTK, Windows and macOS code
we first convert imgIContainer to whatever native image format is required when
dragging something and then convert back to a file (or stream) when dropping.

What however doesn't work is when we never actually round-trip through the OS.
In that case we have the imgIContainer that we can't drop in a meaningful way.

(I actually already ran into this issue in bug 1396587 with the clipboard,
but we kind of resolved this by always doing the roundtrip through the OS's clipboard)

Assignee: nobody → evilpies
Status: NEW → ASSIGNED

The only real downside of this approach is that we aren't dragging the original file, but that would probably be harder to solve. We would have to

  • Actually download the file from the promise URL
  • or, actually put the original image bytes onto DataTransfer (not sure if those still exists when dragging)
Pushed by evilpies@gmail.com: https://hg.mozilla.org/integration/autoland/rev/045be3cab17d Support imgIContainer as a file type in DataTransfer. r=nika
Duplicate of this bug: 1801499
No longer blocks: 1801499
No longer blocks: 1787627
Duplicate of this bug: 1787627

Backed out for causing mochitests failures on test_drag_image_file.html.

Flags: needinfo?(evilpies)
Pushed by evilpies@gmail.com: https://hg.mozilla.org/integration/autoland/rev/0b1c624fed3f Support imgIContainer as a file type in DataTransfer. r=nika
Flags: needinfo?(evilpies)
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 109 Branch
Regressions: 1802904
Duplicate of this bug: 1000690

This was disabled by default in bug 1812611. Not sure when I will have time to fix these issues.

Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Status: REOPENED → NEW
Target Milestone: 109 Branch → ---
Duplicate of this bug: 1864756

Tom, can you please raise the priority of this bug? It's still set to P5, even though you worked on dom.events.dataTransfer.imageAsFile.enabled years ago.

This feature is supported by Chromium browsers and is more relevant now - with the proliferation of web apps - than it was back when this issue was created.

See Also: → 1948388
Assignee: evilpies → nobody
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: