Re: [clipops][editing] document.execCommand('copy', false, 'some data') ?

On Fri, Apr 10, 2015 at 10:55 PM, Daniel Cheng <dcheng@chromium.org> wrote:

> 1) I was under the impression (and MDN supports this) that the value
> argument for execCommand() must be a DOMString. Has that changed?
>

No. We'd have to consider changing it if the second example looks like
something we want to support (and in that case of course evaluate the
compatibility impact of potentially changing it - carefully..) Right now
I'm just throwing out ideas..


>
> 2) How would a supplied value interact with existing copy/cut handlers?
>

I think it makes sense to let any copy/cut handlers that modify the
DataTransfer object "win" since these are chronologically acting after the
document.execCommand() call. Basically, the default action of the paste
action becomes placing the text passed to execCommand() as its third
argument on the clipboard - but the default action can be overridden by
event listeners.

Any thoughts on whether this is a good idea? :)
-Hallvord

Received on Friday, 10 April 2015 21:10:08 UTC