Re: some questions regarding clipboard event / clipboard data API

On Fri, Sep 17, 2010 at 5:47 AM, Hallvord R. M. Steen <hallvord@opera.com>wrote:

> 1) In paste events, WebKit often points event.target to a text node.
> As far as I know, you've had (or have) known bugs where events target
> text nodes when they should target elements. I think no events
> otherwise target text nodes. Do you consider the current
> implementation a bug, or do you intend to keep it?
>

This sounds like a bug.  Please open a bug for it.


> 2) WebKit defines event.types but I've never seen it be anything but
> null. Since it exists (but isn't fully implemented?) and I don't know
> where this property came from or what the plans are, I've just
> suggested the following text:
>

It works on Safari Mac and is documented here:
http://developer.apple.com/library/mac/#documentation/AppleApplications/Conceptual/SafariJSProgTopics/Tasks/CopyAndPaste.html
 .
It should return an array of mime types.  The Safari Mac implementation
returns all formats on the clipboard, even those that Safari can't handle,
which seems a bit strange to me.  I like your text better.

3) The clipboardData.setData() method's spec is based on what IE does,
> since the method never appeared to do anything in my WebKit testing.
> If there is a secret preference to toggle or something, please let me
> know.
>

It works for me during an oncopy event iff event.preventDefault() is called.
 It seems like needing to call preventDefault() is excessive or a bug.

4) Although both IE and WebKit support before* events (beforecut,
> beforecopy, beforepaste) I've omitted them because I can't see the use
> case for these events. What distinguishes a before* event from a
> regular cut/copy/paste event? Why is it useful to have both? Are you
> aware of legacy content that requires before* events?
>

I had thought preventDefault() only worked in the before events, but that
doesn't seem to be the case.  Sorry, I can't seem to remember the
difference, but maybe Ojan does.

tony

Received on Friday, 17 September 2010 20:59:31 UTC