Re: [clipboard events] implicitly prevent default event action?

>> element.dispatchEvent(new ClipboardEvent('copy'))
>>
>> to be pretty much equivalent to
>>
>> document.execCommand('copy')

> No that is wrong and I said as much before in another review round. :/
>
> Events are for observation, they don't cause things to happen.

OK, I'll get rid of this idea. https://www.w3.org/Bugs/Public/show_bug.cgi?id=25825

>> Spec-wise, event.clipboardData is an instance of the DataTransfer interface in
>> HTML5. Can/should I spec this flag in the Clipboard Events spec, or argue
>> that it should be added to HTML5 (or HTML6 / HTML Living / whatever)?

> We should document classes in one place ideally, especially
> fundamental concepts of it such as flags.

On the other hand, perhaps we could just observe the clipboardData.items list? If this list is not empty, the payload must have been changed during processing. So if the default is prevented OR clipboardData.items.length > 0 we place the clipboardData payload on the system clipboard. Can I get away with that, or would an explicit flag be better?

-Hallvord

Received on Tuesday, 20 May 2014 10:01:46 UTC