Bug
1689992: part 1) When copying an image, add the image data before other data to the transferable and macOS's pasteboard. r=masayuki
On macOS, the Pages app depends on the order of the pasteboard
flavors, although it shouldn't, according to Apple's Programming Guide
<https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/PasteboardGuide106/Articles/pbConcepts.html#//apple_ref/doc/uid/TP40008101-SW1>.
I don't know how to write an automated test for this. Exporting the
flavors to the clipboard can be triggered by a Mochitest, but it doesn't
allow reading from macOS's native pasteboard.
Checking the "paste" event doesn't cover this scenario either and the
order of its flavors is not affected by this change. So that's not
usable as an indirect test.
Writing a unit test for `nsCopySupport::ImageCopy` is also insufficient,
because the produced transferable still has to be propagated to the
pasteboard, which could alter the order.
In theory, one would have to run a mochitest which exports to the
clipboard and then run a separate executable which checks the
pasteboard's content. However, it seems Gecko's test-harness doesn't
provide this and extending it seems infeasible.
Differential Revision: https://phabricator.services.mozilla.com/
D104704