Re: [w3c/clipboard-apis] Add `unsanitized` option to async clipboard API. (PR #197)

@snianu commented on this pull request.



>        1. Set |representation|'s [=representation/data=] to |systemClipboardRepresentation|'s [=system clipboard representation/data=].
 
        Issue: It should be possible to read the data asynchronously from the system clipboard after the author calls getType, however, this set of steps implies that data will be provided at the time of read.
       
-      1. The user agent, MAY sanitize |representation|'s [=representation/data=], unless |representation|'s [=representation/MIME type=]'s essence is "image/png", which should remain unsanitized to preserve meta data.
+      1. The user agent, MUST NOT sanitize |representation|'s [=representation/data=], if it satisfies the below conditions:
+      
+       1. |representation|'s [=representation/MIME type=]'s [=MIME type/essence=] is "image/png", which should remain unsanitized to preserve meta data.

Yeah, this is something that I wasn't sure about. I don't know the spec language for it, but I wanted to write something that allows MIME types in `unsanitized data types` list to be part of `{{ClipboardUnsanitizedFormats/unsanitized}}`, but some MIME types(like `image/png`) should be treated like `unsanitized data types` and doesn't have to be in `{{ClipboardUnsanitizedFormats/unsanitized}}`.

Currently Webkit and Chromium allow unsanitized `image/png` read/write by-default so web authors don't have to specify it in the new `{{ClipboardUnsanitizedFormats/unsanitized}}` option during `read()`.

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

Message ID: <w3c/clipboard-apis/pull/197/review/1730873518@github.com>

Received on Tuesday, 14 November 2023 21:52:03 UTC