W3C home > Mailing lists > Public > www-dom@w3.org > July to September 2010

Re: some questions regarding clipboard event / clipboard data API

From: Tony Chang <tony@chromium.org>
Date: Fri, 17 Sep 2010 13:59:00 -0700
Message-ID: <AANLkTimapW4c8vFNNDN0VDbDMER90fOdyvjRmRE9Q7vM@mail.gmail.com>
To: "Hallvord R. M. Steen" <hallvord@opera.com>
Cc: www-dom@w3.org, Ojan Vafai <ojan@chromium.org>
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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 June 2012 06:14:05 GMT