Closed Bug 1802163 Opened 2 years ago Closed 3 months ago

Unable to drag images from Firefox and drop onto Apple Photos

Categories

(Core :: Widget: Cocoa, defect, P3)

Unspecified
macOS
defect

Tracking

()

VERIFIED FIXED
143 Branch
Tracking Status
firefox143 --- verified
firefox144 --- verified

People

(Reporter: glob, Assigned: spohl)

References

(Regressed 1 open bug)

Details

Attachments

(1 file, 1 obsolete file)

Tested with Nightly 109.0a1 (2022-11-16) (64-bit) on macOS 13.0.1

Steps to reproduce:

  1. Open a tab that contains an image in Firefox
  2. Open Apple Photos
  3. Drag the image from Firefox onto Photos

Expected result:

  • Image added to Photos (under Imports)

Actual result:

  • Nothing

Notes:

  • Dragging the same image from Safari to Photos works without issue

Is this a regression?

See Also: → 1801499

(In reply to Tom Schuster [:evilpie] from comment #1)

Is this a regression?

I spot tested a handful of older versions - it appears to have never worked.

Just to confirm: "Photos" is a macOS desktop application, right? bug 1801499 only applies to dragging images inside the same Firefox instance, not with to/from other applications.

(In reply to Tom Schuster [:evilpie] from comment #3)

Just to confirm: "Photos" is a macOS desktop application, right? bug 1801499 only applies to dragging images inside the same Firefox instance, not with to/from other applications.

Yes. However, I figured the two might still be connected in terms of what is advertised to the drag target.

Flags: needinfo?(echen)

I suspect it is something related the data we set into drag pasteboard.

I dump the data type in drag pasteboard the set by each browser while dragging a png image, https://upload.wikimedia.org/wikipedia/commons/b/b6/Image_created_with_a_mobile_phone.png.

Safari Version 15.5 (17613.2.7.1.8)

dyn.ah62d4rv4gu8yc6durvwwa3xmrvw1gkdusm1044pxqyuha2pxsvw0e55bsmwca7d3sbwu
Apple files promise pasteboard type
public.png
Apple PNG pasteboard type
com.apple.WebKit.custom-pasteboard-data
public.tiff
NeXT TIFF v4.0 pasteboard type
dyn.ah62d4rv4gu8zs3pcnzme2641rf4guzdmsv0gn64uqm10c6xenv61a3k
WebURLsWithTitlesPboardType
dyn.ah62d4rv4gu8yc6durvwwaznwmuuha2pxsvw0e55bsmwca7d3sbwu
Apple URL pasteboard type
public.url
CorePasteboardFlavorType 0x75726C20
public.url-name
CorePasteboardFlavorType 0x75726C6E
public.utf8-plain-text
NSStringPboardType
com.apple.flat-rtfd
NeXT RTFD pasteboard type
com.apple.webarchive
Apple Web Archive pasteboard type
dyn.ah62d4rv4gu8yc6durvwwaz5fqmf0w7baqv4045p3eb2gc65yqzvg82pwquuhk8puqy
Apple WebKit dummy pasteboard type
com.apple.pasteboard.promised-file-content-type
com.apple.pasteboard.promised-file-url
dyn.ah62d4rv4gu8y6y4usm1044pxqzb085xyqz1hk64uqm10c6xenv61a3k
NSPromiseContentsPboardType

Google Chrome Version 107.0.5304.110 (Official Build) (x86_64)

org.chromium.drag-dummy-type
dyn.ah62d4rv4gu8yc6durvwwaznwmuuha2pxsvw0e55bsmwca7d3sbwu
Apple URL pasteboard type
public.url-name
CorePasteboardFlavorType 0x75726C6E
public.url
CorePasteboardFlavorType 0x75726C20
dyn.ah62d4rv4gu8yc6durvwwa3xmrvw1gkdusm1044pxqyuha2pxsvw0e55bsmwca7d3sbwu
Apple files promise pasteboard type
public.png
Apple PNG pasteboard type
org.chromium.image-html
com.apple.pasteboard.promised-file-content-type
com.apple.pasteboard.promised-file-url
dyn.ah62d4rv4gu8y6y4usm1044pxqzb085xyqz1hk64uqm10c6xenv61a3k
NSPromiseContentsPboardType
public.tiff
NeXT TIFF v4.0 pasteboard type

Firefox 107.0 (64-bit)

com.apple.pasteboard.promised-file-url
dyn.ah62d4rv4gu8y6y4usm1044pxqzb085xyqz1hk64uqm10c6xenv61a3k
NSPromiseContentsPboardType
public.utf8-plain-text
NSStringPboardType
com.apple.pasteboard.promised-file-content-type
dyn.ah62d4rv4gu8yc6durvwwa3xmrvw1gkdusm1044pxqyuha2pxsvw0e55bsmwca7d3sbwu
Apple files promise pasteboard type
public.url-name
CorePasteboardFlavorType 0x75726C6E
public.tiff
NeXT TIFF v4.0 pasteboard type
dyn.ah62d4rv4gu8zs3pcnzme2641rf4guzdmsv0gn64uqm10c6xenv61a3k
WebURLsWithTitlesPboardType
public.html
Apple HTML pasteboard type
public.url
CorePasteboardFlavorType 0x75726C20
dyn.ah62d4rv4gu8yc6durvwwaznwmuuha2pxsvw0e55bsmwca7d3sbwu
Apple URL pasteboard type
org.mozilla.custom-clipdata
org.mozilla.MozillaWildcard

I suspect it is because we don't set image data into dragging pasteboard in https://searchfox.org/mozilla-central/rev/fadd0a14d2a2724ee4733ef73970a2ddd457a43f/widget/cocoa/nsChildView.mm#4280-4389, switch to Widget: Cocoa.

Component: DOM: Copy & Paste and Drag & Drop → Widget: Cocoa
Flags: needinfo?(echen)
Severity: -- → S3
Priority: -- → P3
See Also: → 1769549
Duplicate of this bug: 1852289

(In reply to Edgar Chen [:edgar] from comment #6)

I suspect it is because we don't set image data into dragging pasteboard in https://searchfox.org/mozilla-central/rev/fadd0a14d2a2724ee4733ef73970a2ddd457a43f/widget/cocoa/nsChildView.mm#4280-4389, switch to Widget: Cocoa.

Bug 1814531 doesn't help here.
Or maybe it's because we always put empty string to com.apple.pasteboard.promised-file-url and com.apple.pasteboard.promised-file-content-type, see https://searchfox.org/mozilla-central/rev/1d447251b44b3a34ab4ca42b39d1f838bea60b33/widget/cocoa/nsClipboard.mm#731-734.

Dunno how useful this is but I think here's how Chromium handles it:

https://github.com/chromium/chromium/blob/37023d304cab9bb1809bc99198057d3516f8634d/content/app_shim_remote_cocoa/web_drag_source_mac.mm#L107

It seems there's some strange thing with the Promise based drag and drop going on since you normally need some sort of NSFilePromiseProvider that handles file promises when the system actually requests them but they kinda got around it somehow.

We actually have a problem with the code that sets the pasteboard data - it doesn't cover all current types, and so any data we want about the file promise isn't carried over. Photos specifically looks for the promise content type to see if the incoming data is of a type that it accepts before attempting an import. Not only do we not carry this information over, but we also don't carry over specific image data during a drag. Currently rewriting the required block of code to fix this.

Assignee: nobody → kwright

Prompts import from photos by including more information from drag session.

The bug assignee is inactive on Bugzilla, so the assignee is being reset.

Assignee: kwright → nobody
See Also: → 1948388
See Also: → 1450419
Assignee: nobody → spohl.mozilla.bugs
Status: NEW → ASSIGNED
Attachment #9505250 - Attachment description: Bug 1802163: Improve dragging of file URLs and PNG data on macOS. r=#mac-reviewers → Bug 1802163: Improve dragging of file URLs on macOS. r=#mac-reviewers
Attachment #9405291 - Attachment is obsolete: true
Status: ASSIGNED → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → 143 Branch
QA Whiteboard: [qa-triage-done-c144/b143] [qa-ver-needed-c144/b143]
Flags: qe-verify+
Regressions: 1985538

I was able to reproduce the issue on Mac12.6 using FF build 142.0a1(20250701091543).
Verified as fixed on Mac12.6 using FF build 144.0a1 and 143.0b5.

Status: RESOLVED → VERIFIED
QA Whiteboard: [qa-triage-done-c144/b143] [qa-ver-needed-c144/b143] → [qa-triage-done-c144/b143] [qa-ver-done-c144/b143]
Flags: qe-verify+
QA Contact: mchiorean
Regressions: 1986071
Regressions: 1989600
No longer regressions: 1989600
Regressions: 1989600
Blocks: 1948388
See Also: 1948388
Blocks: 1450419
See Also: 1450419
See Also: 1801499
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: