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

@sanketj requested changes on this pull request.



> @@ -798,17 +802,33 @@ url: https://w3c.github.io/permissions/#permissions-task-source; type: dfn;
   {{Clipboard/read()}} returns a {{Promise}} to [=clipboard items=] object that represents contents of [=system clipboard data=].
   </p>
 
+  An <dfn>unsanitized</dfn> object is a [=sequence=] of {{DOMString}} corresponding to the [=representation/mime type=].
+
+  <p class="note">
+  Only "text/html" MIME type is supported for [=unsanitized=] object. In the future, other MIME types may be added.

Should we create a section for supported MIME types (with only "text/html" in it for now) and reference it from here and the algorithm below? That will avoid replicating the same information in two places.

> @@ -841,7 +861,7 @@ url: https://w3c.github.io/permissions/#permissions-task-source; type: dfn;
 
        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, MAY sanitize |representation|'s [=representation/data=], unless |representation|'s [=representation/MIME type=]'s [=MIME type/essence=] is "image/png", which should remain unsanitized to preserve meta data, or equal to |format| if |format| is not empty.

I don't follow what is meant by ", or equal to |format| if |format| is not empty" and how it relates to the rest of the paragraph. Could you elaborate?

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

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

Received on Tuesday, 31 October 2023 19:28:34 UTC