- From: CSS Meeting Bot <notifications@github.com>
- Date: Thu, 12 May 2022 08:25:00 -0700
- To: w3c/clipboard-apis <clipboard-apis@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
- Message-ID: <w3c/clipboard-apis/issues/173/1125130700@github.com>
The Web Editing Working Group just discussed `Henri's issue`. <details><summary>The full IRC log of that discussion</summary> <Travis> Topic: Henri's issue<br> <Travis> github: https://github.com/w3c/clipboard-apis/issues/173<br> <Travis> henri: w/contenteditable, user expects that space bar produces a visible space.<br> <Travis> .. originally, there was no CSS for whitespace: pre ?<br> <Travis> .. (because of whitespace collapsing)<br> <Travis> .. clipboard adds alternating spacing + non-breaking spaces<br> <Travis> .. when browser maps all nbsp to regular space.<br> <Travis> .. (number)nbsp(unit) these can sometimes be replaces.<br> <Travis> .. conclusion: impossible to copy from the web that retains nbsp's.<br> <Travis> .. contemplating change in Gecko to...<br> <Travis> .. when nbsp isn't adjacent to a regular space (both ends touch something other than a space--since those aren't created by editor as a hack), then LEAVE THEM BE.<br> <Travis> .. This is an area that is not really part of web interop concerns...<br> <Travis> .. compat/interop concern is from copy-then-paste all within the web platform.<br> <Travis> .. Q to other vendors: any concerns with this plan?<br> <Travis> .. can you see interop problems with this?<br> <Travis> .. (except a divergence between the three engines doing the same thing in this case)<br> <Travis> BoCupp: Not sure I follow what all the browsers are doing...<br> <Travis> .. Do all browsers just put the copy of the spaces when copying...<br> <Travis> henri: when copying from plaintext (no HTML involved); blink preserves nbsp,<br> <Travis> .. Gecko does not.<br> <Travis> .. when pasting into plaintext, all engines currently replace the nbsp. Gecko wants to diverge from this.<br> <Travis> BoCupp: which scenario are we optimizing for?<br> <Travis> henri: when HTML contains a nbsp for legitimate typographical reasons (keep units together with number, french quotes, etc.)<br> <Travis> .. anything except faking the collapsing of space by the editor.<br> <Travis> .. hypothesis: all other cases are legitimate uses of nbsp and should be preserved when exporting to clipboard.<br> <Travis> .. so we don't want to mess with those.<br> <Travis> johanneswilm: do you think you can detect all the case when the editor does the fixup?<br> <Travis> henri: if there is a sequence of nbsp has either an ascii space before/after, then we would consider that editor-generated.<br> <Travis> .. everything else would be considered a legitimate.<br> <Travis> .. I haven't done the research to see if editors expect that behavior... my experience is that existing web logic expects the current editing behavior.<br> <Travis> whsieh: q: idea is to preserve nbsp in dataTransfer.data or paste to plaintext and readback?<br> <Travis> henri: idea is to preserve nbsp when exporting to native clipboard flavor; the rest of the behavior would flow from that.<br> <Travis> .. if an app paste to plaintext, then it would be affected.<br> <Travis> .. a little handwavy to understand the other subtle places where this might impact.<br> <Travis> whsieh: I wonder if there would be compat with apps (external to browser).<br> <Travis> henri: the case with a textarea in webkit, with no spaces, then the copy inserts the nbsp places... if that breaks apps then it would be an existing concern.<br> <Travis> whsieh: it would be broadening the concern if it was there.<br> <Travis> Travis: sounds like the consensus of the group is to "give it a try" and report back?<br> <Travis> .. didn't hear any objections (just questions)?<br> <Travis> johanneswilm: is this something we want to put in the spec? Or are we just OK with the interop divergence.<br> <Travis> henri: I'm not asking for inclusion in a spec (this is borderline not part of standards).<br> <Travis> BoCupp: I like the suggestion (it makes sense to me). When you do it and have success, I think it would be great if we could write it down.<br> <Travis> .. contenteditable spec has a section we could put this into...<br> <whsieh> q+<br> <Travis> johanneswilm: execcommand?<br> <Travis> BoCupp: ..looking for a link.<br> <Travis> johanneswilm: For now, henri should try it out and report back on the issue.<br> <Travis> .. like seeing the algorithm for determining the space handling that henri is going to try.<br> <Travis> .. other browsers may want to then try it out.<br> <Travis> BoCupp: can you comment on which issue (mentioned in the github issue) ...<br> <Travis> henri: I think the scenario is copying from the web, then pasting into plaintext textarea--demonstrating how it's relevant to web interop.<br> <whsieh> q-<br> <Travis> BoCupp: These would be changes to the serialization to the clipboard?<br> <Travis> henri: not sure. I was thinking of the action when a range in the DOM is exported to clipboard (HTML) on copy.<br> <Travis> .. to the extent there are ways to trigger the export (other than users pressing Ctrl+C), would assume they would got through the same code path. If not, then that's an additional complication.<br> <Travis> BoCupp: Suspect that they don't go through the same codepath.<br> <Travis> .. some cases you walk the DOM, in other cases, you're just given some text to insert.<br> <Travis> henri: Okay.<br> <Travis> BoCupp: Like the idea of you experimenting with it!<br> <Travis> johanneswilm: and if it DOESN'T work, we'd appreciate knowing!<br> </details> -- Reply to this email directly or view it on GitHub: https://github.com/w3c/clipboard-apis/issues/173#issuecomment-1125130700 You are receiving this because you are subscribed to this thread. Message ID: <w3c/clipboard-apis/issues/173/1125130700@github.com>
Received on Thursday, 12 May 2022 15:25:12 UTC