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

Hallvord R M Steen hallvors at gmail.com
Tue Aug 31 21:33:35 PDT 2010


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



More information about the whatwg mailing list