Re: [w3c/clipboard-apis] Add Custom Clipboard format support to async clipboard. (PR #162)

The Web Editing Working Group just discussed `Add Custom Clipboard format`.

<details><summary>The full IRC log of that discussion</summary>
&lt;Travis> Topic: Add Custom Clipboard format<br>
&lt;Travis> github: https://github.com/w3c/clipboard-apis/pull/162<br>
&lt;Travis> BoCupp: Context: Folks weren't interested in unsanitized option (that would require a sanitization library).<br>
&lt;Travis> .. Chromium-based browsers still wanted to move forward... one proposal was that a "browser may do X or Y". To specify whether they want unsanitized content or not.<br>
&lt;Travis> .. another options was not to add anything to the spec; but to fork the spec into another CG or separate doc. (The latter was what we did.)<br>
&lt;Travis> .. If we look at Anupam's PR, we see it will be a big maintenance headache ;(<br>
&lt;Travis> .. Therefore, I would like us to reconsider.<br>
&lt;Travis> .. I believe AnneVK chimed in showing their interest in this feature?<br>
&lt;Travis> .. Finally, why would we not add language in the primary spec? Might create pressure on Apple ("not spec compliant").<br>
&lt;Travis> .. I think we'd still have web.dev posts (and other blog posts when it launches).<br>
&lt;Travis> .. So... the absense of this (in the spec) may not justify not adding it to the spec.<br>
&lt;Travis> .. So, will listen to others' reactions?<br>
&lt;Travis> Anne: I'm not sure about unsantizied either.<br>
&lt;Travis> .. mainly was expressing support for custom formats (in the spec).<br>
&lt;Travis> .. I think that is something worth having in the spec (incl. Apple)<br>
&lt;Travis> .. Want to preserve that we would have a specification for custom formats.<br>
&lt;Travis> .. Separately, we need to consider the unsanitized option. I'm *less* favorable on that one.<br>
&lt;Travis> .. It's weird that the legacy API and new API do different things...I think we should try to unify them.<br>
&lt;Travis> BoCupp: For custom formats, I think we agree that there isn't a sanitization algorithm that we'd apply to custom formats (unknown structure)<br>
&lt;Travis> .. Wanted to be sure that together with unsanitized keyword, that the format would be listed.<br>
&lt;Travis> .. Do you think it's useful in that context?<br>
&lt;Travis> Anne: Interesting. I might be ammenable to that.<br>
&lt;Travis> BoCupp: To be fair, we doubled-up the purpose here... we wanted to provide this to the HTML format.<br>
&lt;whsieh_> sorry, not sure why my mic isn't working :( what I recall agreeing on last was that sanitization should be a feature of the browser, not something that sites should be able to opt out of. so blink would always unsanitize, and WebKit can continue sanitizing<br>
&lt;Travis> .. (details for legacy API vs new API)<br>
&lt;Travis> .. Don't really want to touch the legacy API behavior.<br>
&lt;Travis> BoCupp: Yes, that matches what I recall.<br>
&lt;whsieh_> I think there are ways to ensure backwards compatibility even without the sanitize option<br>
&lt;Travis> .. I think that's Apple's position.<br>
&lt;Travis> .. I think Chromium's position is different... want to focus on the mechanics (assuming we won't come to an agreement).<br>
&lt;Travis> .. And what's the most appropriate way to document it.<br>
&lt;whsieh_> right, but this is about whether or not we should build the concept of 'sanitize' into the spec right?<br>
&lt;whsieh_> (the sanitize option, that is)<br>
&lt;Travis> snianu: Domenic's last comment on my PR was that we don't have to define all the details, but add ref to the sanitizer API (and how its configured).<br>
&lt;Travis> .. per Domenic, we should just call algorithms that have undefined (up to the UA) behavior.<br>
&lt;Travis> .. We should be sure it's specified and deterministic.<br>
&lt;Travis> .. This is now blocking the PR.<br>
&lt;Travis> Anne: Historically, I would see failure of standardization process if we can't get agreement.<br>
&lt;Travis> .. We don't have many API in this sort of deadlock...<br>
&lt;Travis> BoCupp: Why I think it may be OK in this circumstance.<br>
&lt;Travis> .. The clipboard shape is unknown--someone could have written santizied content to the clipboard originally--how would one know?<br>
&lt;Travis> .. Today, you can get a loss of fidelity when clipboard transfer occurs.<br>
&lt;whsieh> we're okay with offering platform API to support unsanitized transport of information from native apps to the web<br>
&lt;Travis> .. I think it's OK if a UA wants to be more cautious (or not) in sanitizing at their discretion.<br>
&lt;Travis> .. So that web devs don't have to write unique code.<br>
&lt;BoCupp> q?<br>
&lt;Travis> johanneswilm: Devs do have to write different code if they get sanitized from one browser and unsanitized from another.<br>
&lt;Travis> .. might have provide an upload mechanism to help understand the data.<br>
&lt;Travis> .. (as an alternative)<br>
&lt;Travis> snianu: Most websites that parse HTML string.. they use getData/setData.<br>
&lt;Travis> .. in Firefox and all Chromium browser we get unsanitized content.<br>
&lt;whsieh> we only sanitize cross-origin<br>
&lt;Travis> .. this is not so for Safari (not sure if there's special code paths for Safari)<br>
&lt;Travis> Anne: Why even have a sanitize (if most are not sanitizing today)?<br>
&lt;Travis> snianu: I believe whsieh mentioned they only wanted to provide unsanitized content between same origin...<br>
&lt;whsieh> right. the only reason is compat<br>
&lt;Travis> Anne: I don't think we need the sanitized option then... if this is already something that is there? Why provide it? Wondering if there's a compat thing?<br>
&lt;whsieh> (but there are ways to fix compatibility issues without baking it into the spec)<br>
&lt;Travis> BoCupp: If you Ctrl+V and don't prevent the default, the browser needs it's own santiized logic (style adjustment, JS stripping, etc.) prep logic for "merge ready" HTML.<br>
&lt;Travis> .. There's a way for authors to do this too.<br>
&lt;whsieh> would it be useful to provide API to sanitize markup in the style of the clipboard?<br>
&lt;Travis> .. It would be more ergonomic to allow authors to leverage this "merge-ready" logic... thought having an option to choose would be good (for well-known formats).<br>
&lt;Travis> johanneswilm: On "is it a failure of the standardization process" is there another way we can move forward?<br>
&lt;BoCupp> q?<br>
&lt;Travis> .. On Bo's last comment: this can be problematic for editor creators--if they rely on the browser sanitization, it can lead to incompatible paste content in their editor--so they have to sanitize anyway.<br>
&lt;Travis> BoCupp: For moving forward, I'd like to see language that is a delta to the existing spec (rather than an entire clone of the spec).<br>
&lt;Travis> .. (assuming can't get to an agreement)<br>
&lt;Travis> .. but would like to have something like this (either or option) in the spec.<br>
&lt;snianu> https://github.com/w3c/editing/pull/383<br>
&lt;Travis> 👆 the forked PR<br>
&lt;Travis> snianu: The presentation style attribute is not supported in Chrome/Firefox. Also multiple clipboard formats are only supported on Apple platforms. So there is some precident already that is Safari-specific.<br>
&lt;Travis> .. (can this be another instance of that?)<br>
&lt;Travis> Anne: Specific to Safari for Apple platforms!<br>
&lt;Travis> whsieh: but does it need to be in the spec?<br>
&lt;Travis> Anne: only argument that's persuasive to me is Ctrl+V, and I'm not sure its that specific...<br>
&lt;Travis> BoCupp: Hmm, there are some potentially risky unsanitized content on the pickled formats.<br>
&lt;Travis> Anne: potentially different accessor for pickled formats versus built-in formats?<br>
&lt;Travis> .. Wouldn't say "unsanitized"... might have "unsafe" prefix or something similar. (Have used 'unsafe' in other APIs in the past.<br>
&lt;Travis> .. Could work for HTML and/or image formats?<br>
&lt;Travis> BoCupp: If we look at separate accessors... it's possible that an unknown format (today) could become a built-in format (future). Would it migrate?<br>
&lt;Travis> .. (thinking on the lfy here...)<br>
&lt;Travis> Anne: Could access some format through a pickled format and also not (through separate APIs)<br>
&lt;Travis> .. In that case security is up to website/native apps.<br>
&lt;Travis> whsieh: If the website writes pickled formats... we wouldn't want to expose that raw content to native app (they' need an opt-in)<br>
&lt;Travis> Anne: The native app would need to opt-in also, correct?<br>
&lt;Travis> .. native app can get to normal html/png directly, but if you wrote pickled html/png, they wouldn't get it.<br>
&lt;Travis> whsieh: and if they asked for regular html they'd get the sanitized version...<br>
&lt;Travis> .. could lead to issues if the website authors use pickled versions for the clipboard.<br>
&lt;Travis> .. today the browser writes a safe AND unsafe version to the clipboard...<br>
&lt;Travis> .. so that Apps can decide which to use. (If they don't opt-in they get sanitized version.)<br>
&lt;Travis> .. Important point: we should push websites to write both versions (or ensure the browser has a way to do that).<br>
&lt;Travis> BoCupp: Taking a moment to point out our implementation status...<br>
&lt;Travis> .. Don't think we'll get agreement on how all our implementations will align.<br>
&lt;Travis> .. Happy to change chromium implementation if we can get agreement.<br>
&lt;Travis> .. But assuming (based on history) that we won't.<br>
&lt;Travis> .. In Edge, we have shipped something to allow native apps to exchange content...<br>
&lt;Travis> .. In the chromium process, the hold-up is where we are going to write the behavior down.<br>
&lt;Travis> .. There are many options here. Looking for what the right approach is that minimized disruption/impact on the WG?<br>
&lt;Travis> Anne: felt like we were pretty close to an agreement!<br>
&lt;Travis> whsieh: We agree that the behaviors can be different.<br>
&lt;Travis> .. We don't agree that writing the unsanitized option into the spec is OK.<br>
&lt;Travis> .. last time, we talked about ways of configuring this (that are different from the unsanitized flag)<br>
&lt;Travis> .. mentioned a &lt;meta> tag for this purpose...<br>
&lt;Travis> .. could solve the compat issue.<br>
&lt;Travis> BoCupp: Wouldn't be my preference...<br>
&lt;Travis> johanneswilm: Wondering if we could move this out... or have another meeting?<br>
&lt;Travis> .. moving to the time-zones meeting?<br>
&lt;Travis> BoCupp: To conclude... I'll try to setup a meeting over email. By default, Anne, whsieh, me... smaug, johanneswilm....<br>
&lt;Travis> .. +megan<br>
&lt;Travis> .. I will follow-up on the public-editing-tf list.<br>
</details>


-- 
Reply to this email directly or view it on GitHub:
https://github.com/w3c/clipboard-apis/pull/162#issuecomment-1013331141

You are receiving this because you are subscribed to this thread.

Message ID: <w3c/clipboard-apis/pull/162/c1013331141@github.com>

Received on Friday, 14 January 2022 17:49:20 UTC