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

The Web Editing Working Group just discussed `https://github.com/w3c/clipboard-apis/issues/137`.

<details><summary>The full IRC log of that discussion</summary>
&lt;dandclark> topic: https://github.com/w3c/clipboard-apis/issues/137<br>
&lt;dandclark> github: https://github.com/w3c/clipboard-apis/issues/137<br>
&lt;dandclark> snianu: All 3 browsers have different behaviors<br>
&lt;dandclark> ...: Want to standardize the order that formats get written to clipboard<br>
&lt;dandclark> ...: Clients tend to read topmost format, expect that to have highest fidelity<br>
&lt;whsieh> q+<br>
&lt;dandclark> ...: Chromium has fixed order, I think FF order is fixed but it seems to be wrong<br>
&lt;dandclark> ...: Custom formats seem to get on the top, image formats come after HTML<br>
&lt;dandclark> ...: Safari I haven't tested personally, someone said it preserves formats of web author<br>
&lt;dandclark> whsieh: We do preserve order, that's intentional<br>
&lt;dandclark> ...: Article you pointed out is old. Modern APIs use NSItemProvider where order does matter. Same as Windows, highest fidelity are on the top. Devs are expected to go through types in order of fideliety<br>
&lt;dandclark> ...: Idea is that richest supported format is the one they should consume<br>
&lt;dandclark> ...: In Safari we preserve order for that purpose<br>
&lt;dandclark> snianu: If the web authors write img after text/plain, and the user pastes in native app, does the it get reordered?<br>
&lt;dandclark> whsieh: We preserve order in that case<br>
&lt;dandclark> snianu: I wanted to discuss that; I don't know if web authors are aware that order is important. Would be good to standardize it. Should we define fixed order?<br>
&lt;dandclark> ...: Or leave it up to web authors?<br>
&lt;dandclark> smaug: Should leave it up to the webpage authors, following what Safari's doing. Don't know why Firefox is doing something else, it's some legacy behavior<br>
&lt;dandclark> snianu: FF had some surprising results<br>
&lt;dandclark> smaug: chromium's order is also strange<br>
&lt;dandclark> ...: We should follow Safari's model here<br>
&lt;dandclark> snianu: If we do that, does it affect DataTRansfer APIs?<br>
&lt;dandclark> ...: In Chromium we have fixed order for those, would be hard to have different order based on APIs being used by web authors<br>
&lt;dandclark> ...: In browser process where we interact with sys clipboard, can't know if we should preserve order or the legacy behavior<br>
&lt;dandclark> ...: So that could cause breakage if we change it<br>
&lt;dandclark> ...: Original issue was opened because of image pasting issues in Pages and Keynote.<br>
&lt;dandclark> ...: I only heard reports of Pages failures with Firefox. Has anyone investigated why it's failing?<br>
&lt;dandclark> ...: Someone commented on issue that order is the reason the paste failed. But my experience testing Office and Windows stuff, order matters when pasting images and plaintext.<br>
&lt;dandclark> ...: I don't see issues with paste, svg is still pasted in native app<br>
&lt;dandclark> smaug: I wonder if in Windows apps just do different things vs MacOS<br>
&lt;dandclark> smaug: On Windows it's worked the same since Win32<br>
&lt;dandclark> (That last comment was snianu, not smaug)<br>
&lt;dandclark> smaug: We should investigate if we can follow Safari's model elsewhere, see what breaks. Hard to know otherwise.<br>
&lt;dandclark> snianu: Proposal is to make changes in nightly build in both APIs? Worried about changing DataTransfer. I'm sure there will be breakage in Office.<br>
&lt;dandclark> smaug: What's the behavior in Safari for DataTransfer?<br>
&lt;dandclark> whsieh: Not sure, I think we respect order, if we don't we should.<br>
&lt;dandclark> ...: as we try to align DataTransfer to more modern async clipboard<br>
&lt;dandclark> johanneswilm: Are we proposing spec changes?<br>
&lt;dandclark> snianu: Spec says order is specified by web author.<br>
&lt;dandclark> ...: but spec is iterating clipboard item, doesn't define any order there.<br>
&lt;dandclark> ...: This order is more from system/OS perspective, if you mess that up then native app reads lower fidelity format<br>
&lt;dandclark> johanneswilm: So that's what we're sticking with, FF will try this out<br>
&lt;dandclark> smaug: It can't be just us<br>
&lt;dandclark> ...: Needs to be all browsers on Windows. Also don't know about Linux<br>
&lt;dandclark> snianu: Couldn't find Linux guidance<br>
&lt;dandclark> ...: MacOS &amp; Windows, there are specific guidelines that richest format goes on top<br>
&lt;dandclark> smaug: Could be tricky to change if apps rely on specific behavior on Win<br>
&lt;dandclark> sanketj_: Is it defined about which formats are the most important?<br>
&lt;dandclark> smaug: I don't know which is more important. Would expect maybe HTML because it has more semantic info vs image<br>
&lt;dandclark> whsieh: But if you're copying single image...It's context dependent.<br>
&lt;dandclark> johanneswilm: What are we expecting from this meeting?<br>
&lt;dandclark> snianu: Was wondering if there's real issue here. If no then we're hesitant to change anything since this is very fragile.<br>
&lt;dandclark> ...: If we break copy/paste with old office apps, very hard to fix<br>
&lt;dandclark> ...: I initially proposed to keep Safari's behavior, because that's how the spec is written, but thought deeply about how to make the change in Chromium, ran into this issue that we can't figure what order the author chose<br>
&lt;dandclark> ...: From my own experience here it's very hard to change.<br>
&lt;dandclark> Christine Hollingsworth: Don't have a formal opinion, would be nice to standardize but only if reasonably possible<br>
&lt;dandclark> smaug: Can keep issue open but not be very active<br>
&lt;dandclark> sanketj_: If we mark it as closed, say we'll never do it. Leaving it open says we might do it in future. What new data would be needed such that we might do it ?<br>
&lt;dandclark> smaug: More testing, trying Safari's behaivor on Windows<br>
&lt;dandclark> sanketj_: Seems like it was a FF bug, pasting into Pages. Are you fixing that bug?<br>
&lt;dandclark> smaug: That was fixed years ago, looking at what was changed. Looks like the order was changed<br>
&lt;dandclark> ...: But it's not a generic solution, not following Safari's model. Order is still fixed.<br>
&lt;dandclark> sanketj_: You take image to be highest pri?<br>
&lt;dandclark> smaug: At least on mac<br>
&lt;dandclark> sanketj_: Can you confirm what's your order on different platforms? We could get inventory on different orders browsers have today on different platforms<br>
&lt;dandclark> ...: Based on that we could figure out what we need to change to all be spec compliant<br>
&lt;dandclark> smaug: Sounds good<br>
&lt;dandclark> ...: snianu , smaug , whsieh to document these in the issue for their respective browsers<br>
</details>


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

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

Received on Thursday, 14 March 2024 15:28:27 UTC