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

2014-05-20 Thread Anne van Kesteren
On Tue, May 20, 2014 at 12:01 PM, Hallvord R. M. Steen hst...@mozilla.com wrote: 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

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

2014-05-20 Thread Hallvord R. M. Steen
Maybe. It seems some refactoring is needed either way. The underlying data model for .items is drag data store item list which is a term that's somewhat different from what we have here. I think that's a feature, not a bug - for example, many operating systems let you 'copy' and 'paste' files

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

2014-05-20 Thread Anne van Kesteren
On Tue, May 20, 2014 at 12:16 PM, Hallvord R. M. Steen hst...@mozilla.com wrote: The way HTML5 specs setData() and the other parts of the API shouldn't cause any problems for our use case, no? I guess. In any event, you should refer to the underlying concepts, not the API side of things. If

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

2014-05-20 Thread Glenn Maynard
On Tue, May 20, 2014 at 3:42 AM, Hallvord R. M. Steen hst...@mozilla.comwrote: a) The event is script-generated and has a data payload (new ClipboardEvent('copy', {dataType:'text/plain', data:'Hi World'})) I'm a little confused. Script-generated events never have a default action,

[clipboard events] implicitly prevent default event action?

2014-05-19 Thread Hallvord R. M. Steen
Hi, there's a very annoying gotcha in the clipboard events spec: the default action of for example the copy event is to copy any selected text in the page (and do nothing if there is no selection). This remains the default action even if you use event.clipboardData.setData() and friends to

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

2014-05-19 Thread Anne van Kesteren
On Mon, May 19, 2014 at 3:50 PM, Hallvord R. M. Steen hst...@mozilla.com wrote: a) The event is script-generated and has a data payload (new ClipboardEvent('copy', {dataType:'text/plain', data:'Hi World'})) b) Any event listener calls setData() or modifies the DataTransfer payload some other

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

2014-05-19 Thread Domenic Denicola
From: annevankeste...@gmail.com annevankeste...@gmail.com on behalf of Anne van Kesteren ann...@annevk.nl Can you sanely explain those using a JavaScript implementation or would that be some kind of weird stack-inspecting feature? My impression was that it would be something like: if (data)

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

2014-05-19 Thread Hallvord R. M. Steen
Can you sanely explain those using a JavaScript implementation or would that be some kind of weird stack-inspecting feature? My impression was that it would be something like: if (data) { this.preventDefault(); } Domenic: thanks for explaining, that's pretty much exactly what I'm

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

2014-05-19 Thread Glenn Maynard
On Mon, May 19, 2014 at 8:50 AM, Hallvord R. M. Steen hst...@mozilla.comwrote: a) The event is script-generated and has a data payload (new ClipboardEvent('copy', {dataType:'text/plain', data:'Hi World'})) I'm a little confused. Script-generated events never have a default action, except for