W3C home > Mailing lists > Public > whatwg@whatwg.org > August 2010

[whatwg] some questions regarding clipboard event / clipboard data API

From: Hallvord R M Steen <hallvors@gmail.com>
Date: Wed, 1 Sep 2010 13:33:35 +0900
Message-ID: <AANLkTiktWodo5fTq1_-Gk49ZbbMbmQiPFzEQbkq-hAT6@mail.gmail.com>
Hi,
I'm trying to put together a small spec and a test suite for the
clipboard data API which originates from Internet Explorer and is
supported by WebKit as event.clipboardData in copy/cut/paste events.

I have a few questions regarding the way the API is implemented at the moment.

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?

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:

The types property returns a DOMStringList of MIME type strings.
[RFC2046]. In the paste event, it lists those formats available on the
clipboard the implementation supports returning to the script. In the
copy and cut events, the types property returns a list of supported
formats for the copy operation - for example, if the implementation
supports copying plain text and HTML it would return a DOMStringList
with the values 'text/plain' and 'text/html'.

If you have implemented or plan to implement something else please let
me know :)

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.

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 will probably share the draft spec and tests when it is developed a
bit further, for now thanks for any light anybody can shed on these
questions.

-- 
Hallvord R. M. Steen
Received on Tuesday, 31 August 2010 21:33:35 UTC

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:09:00 UTC