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

@sanketj requested changes on this pull request.



>  
    1. Let |realm| be [=this=]'s [=relevant realm=].
 
    1. Let |p| be [=a new promise=] in |realm|.
 
+   1. Let |format| be a {{DOMString}}.
+
+   1. If |formats| is not empty, then:
+
+     1. If |formats|'s size is greater than 1, then [=reject=] |p| with {{"NotAllowedError"}} {{DOMException}} in |realm|.
+
+     1. Set |format| to |formats|[0].
+
+     1. If |format| is not [=unsanitized mime types=], then [=reject=] |p| with {{"NotAllowedError"}} {{DOMException}} in |realm|.

```suggestion
     1. If |format| is not in [=unsanitized mime types=], then [=reject=] |p| with {{"NotAllowedError"}} {{DOMException}} in |realm|.
```

> @@ -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.

Hmm not sure I follow. I understood that the UA must not sanitize for "image/png". Could you give me an example of what you're going for with the second clause?

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

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

Received on Tuesday, 31 October 2023 21:20:12 UTC