Re: [w3c/clipboard-apis] Fix `clipboard.readText()` algorithm (PR #238)

@annevk commented on this pull request.

You removed task queueing, but you cannot resolve or reject promises while in parallel without queueing a task first.

> @@ -956,51 +956,23 @@ url: https://w3c.github.io/permissions/#permissions-task-source; type: dfn;
 
      Issue: Add definition of sanitized copy.
 
-    1. [=Queue a global task=] on the [=clipboard task source=], given |realm|'s [=realm/global object=], to perform the below steps:
-
-     1. For each |systemClipboardItem| in |data|:
+    1. For each |systemClipboardItem| in |data|:

Existing issue: "For each ... of ..." (applies a few times)

> -         1. If |representationDataPromise| was fulfilled with value |v|, then:
-
-          1. If |v| is a {{DOMString}}, then follow the below steps:
-
-           1. Resolve |p| with |v|.
-
-           1. Return |p|.
-
-          1. If |v| is a {{Blob}}, then follow the below steps:
-
-           1. Let |string| be the result of [=UTF-8 decoding=] |v|'s underlying byte sequence.
-
-           1. Resolve |p| with |string|.
-
-           1. Return |p|.
+      1. If |mimeType| is null, continue this loop.

```suggestion
      1. If |mimeType| is null, then [=iteration/continue=].
```

>  
-         1. If |representationDataPromise| was rejected, then:
+      1. If |mimeType|'s [=MIME type/essence=] is "text/plain", then:

```suggestion
      1. If |mimeType|'s [=MIME type/essence=] is "`text/plain`":
```

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

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

Received on Monday, 12 May 2025 10:30:39 UTC