Re: [w3c/clipboard-apis] Clarifying `clipboard.readText()` behaviour (Issue #236)

EdgarChen left a comment (w3c/clipboard-apis#236)

> Related, for these steps:
> 
> ```
> 2. Let representationDataPromise be the representation’s data.
> 3. React to representationDataPromise:
> ```
> 
> It's not clear how `representationDataPromise` is supposed to be resolved. Are we supposed to initialize it to a resolved promise when we create the new representation? In that case, what are the rejection handling steps for?
> 
> And in the fulfillment steps, the spec has us handle whether the resolved value is a DOMString vs. Blob. But at this point, the system clipboard representation's data is a sequence of bytes. It seems like we should just be converting those bytes to a string here?

Hmm, I think this is also a bug, I feel like the write step has been mixed here...
It looks like we don't need to create a new representation, but resolve p with systemClipboardRepresentation’s [data](https://w3c.github.io/clipboard-apis/#system-clipboard-representation-data) directly?

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

Message ID: <w3c/clipboard-apis/issues/236/2852181789@github.com>

Received on Monday, 5 May 2025 19:54:44 UTC