Re: [w3c/clipboard-apis] Defer OS clipboard read from clipboard.read() to ClipboardItem.getType() (PR #248)

@annevk commented on this pull request.



> +
+       1. If |isCustom| is true, then:
+
+        1. Let |webCustomFormatMap| be the [=os specific custom map name=].
+
+        1. Read |webCustomFormatMap| from the [=system clipboard=].
+
+        1. Let |webCustomFormatMapString| be the JSON string deserialized from |webCustomFormatMap|.
+
+        1. Let |osFormatName| be the value in |webCustomFormatMapString| whose key matches |mimeType| [=serialize a MIME type|serialized=].
+
+        1. If |osFormatName| is not found, then [=queue a global task=] on the [=clipboard task source=], given |realm|'s [=realm/global object=], to [=reject=] |p| with a {{"NotFoundError"}} {{DOMException}} in |realm|, then abort these steps.
+
+       1. Else, let |osFormatName| be the result of running [=os specific well-known format=] given |mimeType|.
+
+      1. Let |clipboardItem| be the [=system clipboard item=] currently held in the [=system clipboard=]. If there is no such item, then [=queue a global task=] on the [=clipboard task source=], given |realm|'s [=realm/global object=], to [=reject=] |p| with a {{"NotFoundError"}} {{DOMException}} in |realm|, then abort these steps.

Shouldn't this still be done while in parallel?

> +
+       1. If |isCustom| is true, then:
+
+        1. Let |webCustomFormatMap| be the [=os specific custom map name=].
+
+        1. Read |webCustomFormatMap| from the [=system clipboard=].
+
+        1. Let |webCustomFormatMapString| be the JSON string deserialized from |webCustomFormatMap|.
+
+        1. Let |osFormatName| be the value in |webCustomFormatMapString| whose key matches |mimeType| [=serialize a MIME type|serialized=].
+
+        1. If |osFormatName| is not found, then [=queue a global task=] on the [=clipboard task source=], given |realm|'s [=realm/global object=], to [=reject=] |p| with a {{"NotFoundError"}} {{DOMException}} in |realm|, then abort these steps.
+
+       1. Else, let |osFormatName| be the result of running [=os specific well-known format=] given |mimeType|.
+
+      1. Let |clipboardItem| be the [=system clipboard item=] currently held in the [=system clipboard=]. If there is no such item, then [=queue a global task=] on the [=clipboard task source=], given |realm|'s [=realm/global object=], to [=reject=] |p| with a {{"NotFoundError"}} {{DOMException}} in |realm|, then abort these steps.

Also, which item are we talking about here? How are they mapped?

> @@ -898,6 +912,8 @@ url: https://storage.spec.whatwg.org/#obtain-a-storage-key-for-non-storage-purpo
 
    1. Let |realm| be [=this=]'s [=relevant realm=].
 
+   1. Let |originalType| be |type|.

Is |type| here completely not normalized? How can that reasonably be used as a map key?

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

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

Received on Thursday, 28 May 2026 14:42:40 UTC