Re: [w3c/clipboard-apis] Add clipboard IDL description. (#158)

@snianu commented on this pull request.



> +    a user gesture event and the user must select the paste option from the native context menu that pops up
+    when read() is called from JS, otherwise, the promise will be rejected.
+
+    1. [=queue a global task=] on the [=permission task source=], given |realm|'s [=Realm/global object=], to perform the below steps:
+    
+     1. If |r| is not "granted", then reject |p| with {{"NotAllowedError"}} DOMException in |realm|.
+
+    1. [=queue a global task=] on the [=clipboard task source=], given |realm|'s [=Realm/global object=], to perform the below steps:
+
+     1. Let |itemList| and |cleanItemList| be an empty [=sequence=]<{{Blob}}>.
+
+     1. Let |clipboardItemList| be an empty [=clipboard items=].
+
+     1. For each |clipboardItem| in |data|:
+
+      1. For each |item| in |clipboardItem|:

`|clipboardItem|` here is `|data|` which is a `{{ClipboardItems}}` defined in `Clipboard Interface` webidl.

So, during `write()` I want to access the `Blob` or `DOMString` data (depending on what the authors provided in `ClipboardItemData`) after all the promises to `Blobs` or `DOMString` are resolved. `ClipboardItemData` is the type that has promise to `ClipboardItemDataType`. I guess this will be part of the `ClipboardItem` constructor so I can maybe assume that the promises are resolved and the `Blob` data are present? That way I can just access the `|clipboardItem|'s [=ClipboardItem/clipboard item=]'s [=list of representations=]`?

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

Received on Friday, 19 November 2021 21:11:10 UTC