LGTM1 to ship conditional that y'all continue to work on PR 
#158<https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fw3c%2Fclipboard-apis%2Fpull%2F158&data=04%7C01%7Csnianu%40microsoft.com%7C40cf07be3a7242c0fd4f08d99497d194%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637704202099113609%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=CVO%2FOuWnuVeXZm67n24jnFaQv14WMlNYCQYoX6Sqz1k%3D&reserved=0>
 specifically, and clarifying the spec's processing model in general
Yes, we’re committed to work on improving the clipboard API spec. That is sort 
of a prerequisite for Pickling API 😊

Also, can you add tests for both input cases as part of your CLs for this?
Yep, already added: 
https://chromium-review.googlesource.com/c/chromium/src/+/3169593

@Ashley Gullen<mailto:ash...@scirra.com> user activation is orthogonal to this 
change. The intent of this change is to align the Clipboarditem API with the 
spec and Safari. This is needed to support promises to Blobs so web authors 
don’t have to create Blobs synchronously. This may not matter much to sites 
that have small payloads, but sites like Excel Online where the workbook could 
contain charts, images etc wouldn’t be able to synchronously create Blobs just 
in time to satisfy the user activation requirement of async clipboard write 
method.

From: Ashley Gullen <ash...@scirra.com>
Sent: Thursday, October 21, 2021 6:37 AM
To: Yoav Weiss <yoavwe...@chromium.org>
Cc: Anupam Snigdha <sni...@microsoft.com>; ann...@annevk.nl <ann...@annevk.nl>; 
blin...@chromium.org <blink-dev@chromium.org>; Marijn Kruisselbrink 
<m...@chromium.org>; Bo Cupp <pc...@microsoft.com>
Subject: Re: [EXTERNAL] Re: [blink-dev] Intent to Implement and Ship: Add 
support for Promise to Blobs in clipboard item

I'm not sure why this API needs to exist.

It used to be the case that you could not write to the clipboard after await in 
Chrome. That's because after an await it was no longer in a synchronous user 
input trigger, and so the call was blocked.

User Activation v2 fixed that. Now you can write to the clipboard after await 
in Chrome, because the User Activation v2 rules mean you get a 1 second timeout 
during which you can write to the clipboard. So long as the async code runs 
quickly (and it almost always will if you're just doing something like reading 
a Blob), then everything works.

Safari and Firefox don't support User Activation v2, so still have the original 
problem. It appears this proposal aims to solve the same problem that User 
Activation v2 does. IMO it would be better if Safari and Firefox just support 
User Activation v2 as well.

Assuming a browser supports UAv2, the only benefit this API would appear to 
bring, is the ability to write to the clipboard beyond the 1 second deadline. 
If the deadline is unlimited, then this effectively grants the web page 
permission to write to the clipboard *at any time* after the first copy 
operation.

Is the intent of this API really just to allow an unlimited deadline? Aren't 
there ways that could be abused?


On Thu, 21 Oct 2021 at 10:21, Yoav Weiss 
<yoavwe...@chromium.org<mailto:yoavwe...@chromium.org>> wrote:
LGTM1 to ship conditional that y'all continue to work on PR 
#158<https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fw3c%2Fclipboard-apis%2Fpull%2F158&data=04%7C01%7Csnianu%40microsoft.com%7C40cf07be3a7242c0fd4f08d99497d194%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637704202099113609%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=CVO%2FOuWnuVeXZm67n24jnFaQv14WMlNYCQYoX6Sqz1k%3D&reserved=0>
 specifically, and clarifying the spec's processing model in general.
On Thursday, October 21, 2021 at 2:04:53 AM UTC+2 snianu wrote:
Gentle ping as the branch cutoff date for 97 is pretty close. While I agree 
that the issues related to clipboard API spec need to be addressed, I don’t 
think this feature needs to be blocked on that. It’s not a breaking change i.e. 
sites can continue to use Blobs if they want to(although I don’t think any 
developer would want to have different codepaths for Apple and Chromium 
browsers)

FWIW, I got curious RE why that *should* work, and did some digging.
It seems like the bindings methods that accept a `Promise<T>` input value call 
`NativeValueTraits<IDLPromise><https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fsource.chromium.org%2Fchromium%2Fchromium%2Fsrc%2F%2B%2Fmain%3Athird_party%2Fblink%2Frenderer%2Fbindings%2Fcore%2Fv8%2Fnative_value_traits_impl.h%3Bl%3D775%3Fq%3DArgumentValue%26ss%3Dchromium%252Fchromium%252Fsrc&data=04%7C01%7Csnianu%40microsoft.com%7C40cf07be3a7242c0fd4f08d99497d194%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637704202099123603%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=ov2hwgIVeh%2FC%2F80hUxcGMQcDIIOlyTpkylAc1PDZSYE%3D&reserved=0>`
 on that value, which 
casts<https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fsource.chromium.org%2Fchromium%2Fchromium%2Fsrc%2F%2B%2Fmain%3Athird_party%2Fblink%2Frenderer%2Fbindings%2Fcore%2Fv8%2Fscript_promise.cc%3Bdrc%3Dac35167cc1cf9c40778c1e1d8855fd90a90f0fbf%3Bl%3D291&data=04%7C01%7Csnianu%40microsoft.com%7C40cf07be3a7242c0fd4f08d99497d194%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637704202099123603%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=6JBvZiUPGqP%2FgO92h2wYvfW%2BC8g9pIKJTaEVqiiflV8%3D&reserved=0>
 the value foo into a `Promise.resolve(foo)`, if it wasn't a Promise already.
The same seems to work in WebKit as well. Do you know if this bindings behavior 
is specified?

Also, can you add tests for both input cases as part of your CLs for this?

, and Apple has already shipped this feature. Please let me know in case of any 
concerns.

-Anupam

From: Anupam Snigdha
Sent: Thursday, October 7, 2021 9:53 AM
To: 'Yoav Weiss' <yoavwe...@chromium.org<mailto:yoavwe...@chromium.org>>
Cc: ann...@annevk.nl<mailto:ann...@annevk.nl>; 
blink-dev@chromium.org<mailto:blink-dev@chromium.org>; 
m...@chromium.org<mailto:m...@chromium.org>; Bo Cupp 
<pc...@microsoft.com<mailto:pc...@microsoft.com>>
Subject: RE: [EXTERNAL] Re: [blink-dev] Intent to Implement and Ship: Add 
support for Promise to Blobs in clipboard item

Yep, I’ll address the feedback from Anne and mbrodesser (from Mozilla).
Thanks for all your help Anne and Yoav!

From: Yoav Weiss <yoavwe...@chromium.org<mailto:yoavwe...@chromium.org>>
Sent: Thursday, October 7, 2021 12:03 AM
To: Anupam Snigdha <sni...@microsoft.com<mailto:sni...@microsoft.com>>
Cc: ann...@annevk.nl<mailto:ann...@annevk.nl>; 
blink-dev@chromium.org<mailto:blink-dev@chromium.org>; 
m...@chromium.org<mailto:m...@chromium.org>; Bo Cupp 
<pc...@microsoft.com<mailto:pc...@microsoft.com>>
Subject: Re: [EXTERNAL] Re: [blink-dev] Intent to Implement and Ship: Add 
support for Promise to Blobs in clipboard item



On Tue, Oct 5, 2021 at 4:02 AM Anupam Snigdha 
<sni...@microsoft.com<mailto:sni...@microsoft.com>> wrote:
Here is a WIP PR to address the spec issue: 
https://github.com/w3c/clipboard-apis/pull/158<https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fw3c%2Fclipboard-apis%2Fpull%2F158&data=04%7C01%7Csnianu%40microsoft.com%7C40cf07be3a7242c0fd4f08d99497d194%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637704202099133593%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=vzFHQKTKQ7mKFG6yNrlEYK3FI3P76WKAkYazy4nI4k8%3D&reserved=0>.

Can you address feedback from Anne on the PR?


From: Anupam Snigdha
Sent: Monday, October 4, 2021 10:45 AM
To: 'Yoav Weiss' <yoavwe...@chromium.org<mailto:yoavwe...@chromium.org>>; Anne 
van Kesteren <ann...@annevk.nl<mailto:ann...@annevk.nl>>
Cc: blink-dev <blink-dev@chromium.org<mailto:blink-dev@chromium.org>>; Marijn 
Kruisselbrink <m...@chromium.org<mailto:m...@chromium.org>>; Bo Cupp 
<pc...@microsoft.com<mailto:pc...@microsoft.com>>
Subject: RE: [EXTERNAL] Re: [blink-dev] Intent to Implement and Ship: Add 
support for Promise to Blobs in clipboard item

For #1: I don’t think we would want to diverge from the spec. There is a reason 
why we have promises to Blobs and not just Blobs in the ClipboardItem because, 
well, not having promises defeats the purpose of having an async API. Also 
waiting for the Blob data synchronously without triggering the clipboard write 
operation leads to problems like 
this<https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugs.chromium.org%2Fp%2Fchromium%2Fissues%2Fdetail%3Fid%3D1014310%23c15&data=04%7C01%7Csnianu%40microsoft.com%7C40cf07be3a7242c0fd4f08d99497d194%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637704202099143586%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=uV%2FQEATgT8v0uUewQV6h8dw%2BOuFAxgkMwDCXxagmlvI%3D&reserved=0>
 and performance issues in sites like Excel Online where the copy payload is in 
MBs.

That makes sense.


For #2: This might sound more of a rant so apologies in advance.

I agree with Anne that the spec is not really clear at all on the specifics of 
the async clipboard API and some of the terminologies used in the algorithms.
However, making changes to the spec or even clarifying the language after an 
API has been shipped, is really hard, as we need to get consensus from all 
browser vendors.
I tried to clarify what “sanitization” means just for the HTML 
format<https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fw3c%2Fclipboard-apis%2Fissues%2F150%23issuecomment-909405090&data=04%7C01%7Csnianu%40microsoft.com%7C40cf07be3a7242c0fd4f08d99497d194%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637704202099143586%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=O0spOylZkU%2FNlzxyrRo4SItBV6KCsxKRIXzl0Uc2bGA%3D&reserved=0>
 and Apple opposed to this 
change<https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fw3c%2Fclipboard-apis%2Fissues%2F150%23issuecomment-922211803&data=04%7C01%7Csnianu%40microsoft.com%7C40cf07be3a7242c0fd4f08d99497d194%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637704202099153580%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=%2BOuUFUZTXuqbDXpPx09dqnC%2Faq4MIgP2hqQa2FbtI0Y%3D&reserved=0>.

That's unfortunate :/

Perhaps I can add a non-normative note which would at least give some clarity 
on the sanitization process, but that would probably require UA specific non 
normative notes which defeats the purpose of standardization.
I also tried to make changes to address Mozilla’s concern about mandatory data 
types supported by async clipboard APIs: 
https://github.com/w3c/clipboard-apis/pull/155<https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fw3c%2Fclipboard-apis%2Fpull%2F155&data=04%7C01%7Csnianu%40microsoft.com%7C40cf07be3a7242c0fd4f08d99497d194%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637704202099163579%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=rBLTd07njmlICoNi8SIlsv%2FVvoeAhHpEjkIHprYbxE8%3D&reserved=0>,
 but this PR has been sitting for almost a month now and I’m not able to make 
any progress.

FWIW, it seemed to have made some progress initially and then stalled. Pinging 
it may make sense.


In order to make progress on spec changes, we decided to have a discussion with 
the Editing WG members and submit changes to the spec if no one objects to it. 
Currently the Editing WG has representatives from Apple and MS who regularly 
attend the monthly status meetings. So my question is, if we get an approval 
from the WG, then does that meet the minimum bar to make spec changes?

That's for the Editing WG to decide. Looking at its 
charter<https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.w3.org%2F2021%2F06%2Fweb-editing-wg-charter.html&data=04%7C01%7Csnianu%40microsoft.com%7C40cf07be3a7242c0fd4f08d99497d194%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637704202099163579%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=%2F72j3Aive0E%2F12COT7tqcdd0lJjOVuOGZpxJkLiTH20%3D&reserved=0>,
 it seems the chairs may be able to help move things along (e.g. by bringing 
decisions to a vote, if no consensus is reached).


Anyways, I’m working on updating the spec to at least define the Clipboard 
interface IDL, but since Apple and Chromium browsers have already shipped this 
API, I don’t think it’s possible to make any significant changes to the  APIs 
without breaking at least one of the browsers.
This change addresses the discrepancy between the ClipboardItem IDL as defined 
in the spec(also implemented by Apple) and what is implemented in Chromium. 
This is not a breaking change so I think the risk is minimal here.

From: Yoav Weiss <yoavwe...@chromium.org<mailto:yoavwe...@chromium.org>>
Sent: Friday, October 1, 2021 4:15 AM
To: Anne van Kesteren <ann...@annevk.nl<mailto:ann...@annevk.nl>>
Cc: Anupam Snigdha <sni...@microsoft.com<mailto:sni...@microsoft.com>>; 
blink-dev <blink-dev@chromium.org<mailto:blink-dev@chromium.org>>; Marijn 
Kruisselbrink <m...@chromium.org<mailto:m...@chromium.org>>; Bo Cupp 
<pc...@microsoft.com<mailto:pc...@microsoft.com>>
Subject: Re: [EXTERNAL] Re: [blink-dev] Intent to Implement and Ship: Add 
support for Promise to Blobs in clipboard item



On Fri, Oct 1, 2021 at 12:46 PM Anne van Kesteren 
<ann...@annevk.nl<mailto:ann...@annevk.nl>> wrote:
On Fri, Oct 1, 2021 at 12:35 PM Yoav Weiss 
<yoavwe...@chromium.org<mailto:yoavwe...@chromium.org>> wrote:
> Thanks Anne and Thomas for the cross-browser context.
>
> Anupam - looking at the issue Anne posted, it seems Firefox explicitly did 
> not implement this.
> I think it'd be interesting to get their opinions as to why, and whether we 
> should align with the current WebKit behavior or the current Chromium one.
>
> Anne - do y'all want to chime in here, or would a standards position issue be 
> the best venue?

There is an existing issue:
https://github.com/mozilla/standards-positions/issues/89<https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fmozilla%2Fstandards-positions%2Fissues%2F89&data=04%7C01%7Csnianu%40microsoft.com%7C40cf07be3a7242c0fd4f08d99497d194%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637704202099173577%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=8oya541spNPLo%2BfKAxmgA2oEdbeR44F1YUs8pA5LkHw%3D&reserved=0>.
 The problem
we are having in evaluating all this is that there isn't really any
specification to speak of, as I tried to point out. One can take
guesses as to what the expected behavior is likely to be, but that is
very far from ideal and normally not even close to acceptable, right?

That's fair.

>From my perspective, the ideal outcome here would be:
1) Getting agreement on this specific issue that's currently causing developer 
pain, and moving forward in that direction.
2) Properly specifying the correct behavior for the rest of the broader API, in 
ways that would enable interoperable implementations (and reduce developer pain 
in the future).

It seems like (2) requires Someone™ to take on the work of gathering the 
different unspecified behaviors, opening an issue to discuss each one, reaching 
agreement on them and pushing to align existing implementations.

Maybe we can decouple (1) and (2), but I'd like to see we have a concrete plan 
for (2) before we do that.

Anupam - who would be best positioned to take on that work?
--
You received this message because you are subscribed to the Google Groups 
"blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 
blink-dev+unsubscr...@chromium.org<mailto:blink-dev+unsubscr...@chromium.org>.
To view this discussion on the web visit 
https://groups.google.com/a/chromium.org/d/msgid/blink-dev/7a237c30-9d53-4181-9c5d-1954d2bf6a0cn%40chromium.org<https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.google.com%2Fa%2Fchromium.org%2Fd%2Fmsgid%2Fblink-dev%2F7a237c30-9d53-4181-9c5d-1954d2bf6a0cn%2540chromium.org%3Futm_medium%3Demail%26utm_source%3Dfooter&data=04%7C01%7Csnianu%40microsoft.com%7C40cf07be3a7242c0fd4f08d99497d194%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637704202099173577%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=25X0MtlZZBEMcQGxv6kh7%2Fs%2F%2FjnSTNbtoX3UFLIw8yc%3D&reserved=0>.

-- 
You received this message because you are subscribed to the Google Groups 
"blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to blink-dev+unsubscr...@chromium.org.
To view this discussion on the web visit 
https://groups.google.com/a/chromium.org/d/msgid/blink-dev/SN6PR00MB0400C9DF20A963F6CDA1C65BCFBF9%40SN6PR00MB0400.namprd00.prod.outlook.com.

Reply via email to