Re: [w3c/clipboard-apis] Add Web Custom format (PR #175)

@EdgarChen commented on this pull request.



> -     Issue: Add definition of sanitized.
+      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. Append |representation| to |item|'s [=list of representations=].
+     
+     1. If |item|'s [=list of representations=] size is greater than 0, append |item| to |items|.
+     
+    If |items| has a size > 0, then:
+    
+     1. Let |firstItem| be |items|[0]
+     
+     1. Run the [=read web custom format=] algorithm given |firstItem|.

Per https://w3c.github.io/clipboard-apis/#dom-clipboarditem-types, `type` getter of ClipboardItem returns `types array`, but it is not clear how does `types array` be constructed. It would be nice that we could have some steps for that.

Not sure if this makes sense: maybe we could construct `types array` from ` list of representations`, but which means we would need to read custom types first as [we would like the custom types listed at the top](https://github.com/w3c/clipboard-apis/issues/167#issuecomment-1031748387).

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

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

Received on Tuesday, 20 September 2022 09:15:52 UTC