Re: [w3c/clipboard-apis] Specify order of flavors exported to macOS's pasteboard (#137)

Summary of Gecko's behavior on different platform
---
Test script:
```javascript
const clipboardItem = new ClipboardItem({
  "text/plain": "text",
  "image/png": imageBlob,
  "text/html": "<html></html>",
});
navigator.clipboard.write([clipboardItem]);
```
Order in system clipboard:
| macOS  | Linux | Windows |
| ------------- | ------------- | ------------- |
| public.png | UTF8_STRING | CF_UNICODETEXT |
| Apple PNG pasteboard type | COMPOUND_TEXT | CF_TEXT |
| public.tiff | TEXT | application/x-moz-nativeimage |
| NeXT TIFF v4.0 pasteboard type | STRING | CF_DIBV5 |
| public.utf8-plain-text | text/plain;charset=utf-8 | CF_DIB |
| NSStringPboardType | text/plain | text/html |
| public.html | image/png | HTML Format |
| Apple HTML pasteboard type | image/jpeg |
|                                    | image/bmp |
|                                    | image/x-bmp |
|                                    | image/x-MS-bmp |
|                                    | image/x-icon |
|                                    | image/x-ico |
|                                    | image/x-win-bitmap |
|                                    | image/vnd.microsoft.icon |
|                                    | application/ico |
|                                    | image/ico |
|                                    | image/icon |
|                                    | text/ico |
|                                    | image/tiff |
|                                    | text/html |

On Linux and Windows, we use the order of the formats in the ClipboardItem as specified by the web authors.
On macOS, we put the image on the top.

And DataTransfer behave the same.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/w3c/clipboard-apis/issues/137#issuecomment-2101605486
You are receiving this because you are subscribed to this thread.

Message ID: <w3c/clipboard-apis/issues/137/2101605486@github.com>

Received on Wednesday, 8 May 2024 22:30:19 UTC