- From: snianu <notifications@github.com>
- Date: Thu, 12 Oct 2023 10:13:49 -0700
- To: w3c/clipboard-apis <clipboard-apis@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
- Message-ID: <w3c/clipboard-apis/issues/191/1760031734@github.com>
Bot posted the resolution in an unrelated issue. Posting the relevant discussion here: https://github.com/w3c/edit-context/issues/26#issuecomment-1759880322 ``` The Web Editing Working Group just discussed Read Blob data for the supported formats on-demand during getType., and agreed to the following: RESOLVED: Change API to behave as specified by Anupam above The full IRC log of that discussion <dandclark> topic: Read Blob data for the supported formats on-demand during getType. <dandclark> github: https://github.com/https://github.com/w3c/clipboard-apis/issues/191 <dandclark> snianu: When we read (in Chromium) async clipboard, we read all supported formats. When authors specify getType, we return the blob <dandclark> snianu: Has perf issues, web authors maybe only want plaintext or HTML. <dandclark> ...: Don't need to read all formats <dandclark> ...: Proposal is to make decision in getType, not in read <dandclark> ...: When authors call read() we return formats supported in clipboard. But don't read actual data. <dandclark> ...: Only read the data when authors call getType() <dandclark> ...: In dataTransfer, already have this perf optimization. In Windows, check the sequence number, do something similar in MacOS. When clipboard changes, seq number incremented <dandclark> ...: Can query the number to see if clipboard has changed since you read the formats <whsieh> q+ <dandclark> ...: If doesn't match, returns empty string. Proposal here is to reject the promise. <dandclark> whsieh: Proposal is so you read the data lazily. So this is what we do right now in webkit, with the same policy. If change count changes we'll reject the promise. <edgar> q+ <dandclark> snianu: This matches dataTransfer, so this will make everything interoperable <dandclark> edgar: What if the web author calls getType multiple times. Between the calls, the data was changed. What happens? <dandclark> snianu: For dataTransfer it will be empty string every time. For this API, we reject promise. <dandclark> snianu: In this scenario if clipboard changes between getType calls, e.g. because you switched focus and copied something, then yes we reject promise. <dandclark> snianu: Proposal here is to reject promise for getType if clipboard has been invalidated. Use sequenceNumber on Windows, the corresponding approach on MacOS. Reject if doesn't match, resolve the promise with the data if matches. <dandclark> RESOLVED: Change API to behave as specified by Anupam above ``` -- Reply to this email directly or view it on GitHub: https://github.com/w3c/clipboard-apis/issues/191#issuecomment-1760031734 You are receiving this because you are subscribed to this thread. Message ID: <w3c/clipboard-apis/issues/191/1760031734@github.com>
Received on Thursday, 12 October 2023 17:13:54 UTC