W3C home > Mailing lists > Public > public-webapps@w3.org > April to June 2012

Re: Clipboard API spec should specify beforecopy, beforecut, and beforepaste events

From: Ryosuke Niwa <rniwa@webkit.org>
Date: Tue, 1 May 2012 16:51:22 -0700
Message-ID: <CABNRm62WbUyPAi4=UAD3Ou+32gbDWsS4q1q5=0pFebGu+HEiUQ@mail.gmail.com>
To: Boris Zbarsky <bzbarsky@mit.edu>
Cc: Scott González <scott.gonzalez@gmail.com>, public-webapps@w3.org
On Tue, May 1, 2012 at 4:40 PM, Boris Zbarsky <bzbarsky@mit.edu> wrote:

> On 5/1/12 6:07 PM, Scott González wrote:
>> I recall moving focus for paste events in order to figure out what is
>> being pasted. I believe this is common in WYSIWYG editors; a new element
>> is created and focus is moved to that element, then the paste occurs,
>> then the element is inspected for the content and the editor does
>> whatever it needs to (like cleaning up junk from pasted Word documents).
>> Obviously if there was a cleaner way to get the contents, like Microsoft
>> APIs for accessing the clipboard, then this wouldn't be needed.
> Yeah, that seems like an abuse of onbeforepaste.  Especially since, again,
> onbeforepaste doesn't actually fire for all paste methods!

I agree that these events are broken and has very different semantics from
other before* events. I would be fine with adding non-normative section
describing the current behavior as well (or even mark them as deprecated).
I just feel that it needs to be documented in some spec so that authors
don't accidentally find them on their own and start mis-using them.

- Ryosuke
Received on Tuesday, 1 May 2012 23:52:11 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 18:13:33 UTC