Closed Bug 1150519 Opened 9 years ago Closed 8 years ago

Drag-drop images in github doesn't work

Categories

(Core :: DOM: UI Events & Focus Handling, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla50

People

(Reporter: marcosc, Unassigned)

References

Details

Attachments

(1 file)

Reproduce:
0. log into github.
1. go to a github page where you can comment.
2. drag and drop an image into the comment area.
3. Github should complain that the image is too large (doesn't matter of the image size, always complains). 

Expect: 
The image to upload.
I *think* this is a dupe of Bug 1143857. What version are you running Marcos? (Dan Callahan wrote a cool hacks post of debugging this same issue: https://hacks.mozilla.org/2015/03/using-the-firefox-devtools-to-debug-fetch-on-github/
I'm on 38.0a2 (2015-03-26) - developer edition.
FWIW, I think you might be correct that this is a dup.
This still isn't working (tested on 44), though you no longer get the error message. I don't know what the issue is. Moving to Core::Untriaged, and ni'ing Dan based on comment #1, to see if he knows what's going on here. Maybe this needs to be Tech Evangelism instead?
Blocks: 1143857
Component: General → Untriaged
Flags: needinfo?(dan.callahan)
Product: Firefox → Core
I can't repro this on my end. Tested with current stable (43), beta, dev edition, and nightly, using both an existing and a fresh profile.

Gijs: Can you try please again with a fresh profile, and check on each channel to see if it's ubiquitous for you? And if it is, maybe provide more verbose STRs?
Flags: needinfo?(dan.callahan) → needinfo?(gijskruitbosch+bugs)
FWIW, when you drop the file, it should trigger a POST to https://github.com/upload/policies/assets with the file's metadata, and you should get back JSON with that same metadata and AWS S3 info for the upload. What are you seeing instead?

STR on a clean profile of 44 rc (soon to be release):

0) go to https://github.com/mozilla/readability/pull/262
1) log in to github using the button at the top right
2) ensure you end up back on https://github.com/mozilla/readability/pull/262
3) at the comment box, drag an image from another web page (say, https://en.m.wikipedia.org/wiki/Einsteinium#/media/File%3AEinsteinium.jpg ) to the comment box. The comment box lights up as if this is going to work
4) drop the image

ER:
it works!

AR:
it doesn't work. :-(


In Chrome, this adds the image into your post.

I just realized that maybe the STR from comment #0 are strictly about local image files (say, from your desktop), and that does work. But if you drag an image on the web itself, then that doesn't work.
Flags: needinfo?(gijskruitbosch+bugs) → needinfo?(dan.callahan)
Build ID    20160310030242
User Agent  Mozilla/5.0 (X11; Linux x86_64; rv:48.0) Gecko/20100101 Firefox/48.0
User Agent  Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:48.0) Gecko/20100101 Firefox/48.0

Build ID    20160303134406
User Agent  Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0
User Agent  Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:45.0) Gecko/20100101 Firefox/45.0

This issue is also reproducible on Ubuntu 13.10 and Windows 10 with the steps from comment 7.
Component: Untriaged → Event Handling
OS: Mac OS X → All
Hardware: x86 → All
Looks like this is caused by DragEvent.dataTransfer being null, which should be fixed in Bug 906420.

(Specifically, in the drop handler, GitHub checks if `evt.dataTransfer.types` includes entries for `Files`, `text/uri-list`, or `text/plain`. Unfortunately, `evt.dataTransfer` is `null`, so GitHub ends up trying to access `null.types`. This throws a TypeError.)
Flags: needinfo?(dan.callahan)
Depends on: 906420
Just verified that the patch in Bug 906420 successfully resolves this bug.

Unfortunately, that patch just got backed out because it still had a stray printf in it... but when it re-lands we can close this bug.
Closed as per comment #10. Bug 906420 has landed again.
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla50
Component: Event Handling → User events and focus handling
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: