Closed Bug 1181897 Opened 7 years ago Closed 7 years ago

setDragImage scales down images with large intrinsic sizes

Categories

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

42 Branch
x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla42
Tracking Status
firefox42 --- fixed

People

(Reporter: alexhenrie24, Assigned: alexhenrie24)

References

Details

(Keywords: html5)

Attachments

(2 files, 2 obsolete files)

The HTML5 drag-and-drop specification, when describing the setDragImage function, states "If the element argument is an img element, then set the drag data store bitmap to the element's image (at its intrinsic size)".[1] Firefox currently scales down <img> element arguments under certain conditions, violating the spec.

A test case is attached that should demonstrate the problem even on ridiculously large displays. If it's important to include this test case in the test suite, I will need some help doing that.

Fixing this bug will make it easier to work around bug 941858 (which has to do with unstandardized behavior in the same spec).

[1] http://dev.w3.org/html5/spec-preview/dnd.html
The attached patch resolves the problem while leaving the scaling code in place for non-<img> elements.

https://treeherder.mozilla.org/#/jobs?repo=try&revision=373e324c7807
Attachment #8631374 - Flags: review?(roc)
Keywords: html5
See Also: → 941858
Sorry, I forgot to include the bug number in the commit message.
Assignee: nobody → alexhenrie24
Attachment #8631374 - Attachment is obsolete: true
Attachment #8631374 - Flags: review?(roc)
Attachment #8631378 - Flags: review?(roc)
After some more pondering, it looks like we can just delete this block of code altogether, but deleting it still doesn't fix bug 941858.

https://treeherder.mozilla.org/#/jobs?repo=try&revision=abb85ff353d3
Attachment #8631378 - Attachment is obsolete: true
Attachment #8631378 - Flags: review?(roc)
Attachment #8631988 - Flags: review?(roc)
Requesting checkin of attachment 8631988 [details] [diff] [review]
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/5422a0e67377
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla42
Component: Widget → Drag and Drop
You need to log in before you can comment on or make changes to this bug.