Intent to Ship: ClipboardEvent Constructor

43 views
Skip to first unread message

Luna

unread,
Dec 16, 2016, 8:51:06 AM12/16/16
to blink-dev
https://w3c.github.io/clipboard-apis/#clipboard-event-interfaces

This entry tracks exposing ClipboardEvent constructor.

Firefox: No public signals Edge: No public signals Safari: No public signals


https://www.chromestatus.com/features/4687833935642624

Yes

Philip Jägenstedt

unread,
Dec 16, 2016, 8:55:20 AM12/16/16
to Luna, blink-dev
LGTM1

Rick Byers

unread,
Dec 16, 2016, 9:46:49 AM12/16/16
to Philip Jägenstedt, Luna, blink-dev
LGTM2 - tiny and obviously correct (despite not being in any other browsers yet).

Dimitri Glazkov

unread,
Dec 16, 2016, 10:16:23 AM12/16/16
to Rick Byers, Philip Jägenstedt, Luna, blink-dev
LGTM3

Boris Zbarsky

unread,
Dec 16, 2016, 1:54:45 PM12/16/16
to Luna, blink-dev
On 12/16/16 8:51 AM, Luna wrote:
> Interoperability risk
> Firefox: No public signals

The ClipboardEvent constructor has been shipping in Firefox since at
least 2013.

That said, it looks like it was based on the spec draft at the time [1],
and doesn't match the current spec draft. Specifically, the current
spec draft has:

dictionary ClipboardEventInit : EventInit {
DataTransfer? clipboardData = null;
};

whereas what Firefox is shipping has:

dictionary ClipboardEventInit : EventInit
{
DOMString data = "";
DOMString dataType = "";
};

and inside the constructor creates a DataTransfer with that data and
that dataType.

I've raised https://github.com/w3c/clipboard-apis/issues/33 because as
currently written in the spec this constructor is pretty much unusable.

-Boris

[1] https://www.w3.org/TR/2015/WD-clipboard-apis-20150421/ has the
dictionary the way Firefox is shipping it.
https://www.w3.org/TR/2015/WD-clipboard-apis-20151215/ looks like it
changed to the new setup.

Rick Byers

unread,
Dec 16, 2016, 2:17:44 PM12/16/16
to Boris Zbarsky, Luna, blink-dev
Thanks Boris!  I've replied on the spec issue.

Lucas Garron

unread,
Dec 19, 2016, 5:29:37 PM12/19/16
to Rick Byers, Boris Zbarsky, Gary Kačmarčík (Кошмарчик), Daniel Cheng, Luna, blink-dev
+garykac, +Daniel Cheng 

What is the main purpose of shipping it now?

There are a few clipboard efforts underway in Chromium right now, including a new clipboard API whose current proposal draft uses DataTransfer instead of Clipboard Event and some extension APIs?
Is this related to one of them, or is there a separate reason to ship this now?

»Lucas

Rick Byers

unread,
Dec 20, 2016, 5:52:42 PM12/20/16
to Lucas Garron, Boris Zbarsky, Gary Kačmarčík (Кошмарчик), Daniel Cheng, Luna, blink-dev
This is just part of a larger effort at spec conformance (using some new automated tools we've working on to identify issues between blink's IDL files and the IDL in specs).  There's no particular urgency, but I also don't think there's any good reason not to do this (unless I'm missing something?).  Even if/when we do a new API, we'll still want to follow the standard constructor patterns for the original API for consistency.

Lucas Garron

unread,
Dec 20, 2016, 6:39:19 PM12/20/16
to Rick Byers, Boris Zbarsky, Gary Kačmarčík (Кошмарчик), Daniel Cheng, Luna, blink-dev
Last I heard, the editing spec had a big warning on it and the separate clipboard API wasn't going anywhere (which is why we were trying to work on a better one).
But I just noticed that garykac@ joined Hallvord on the spec in the first post of this thread, so I trust they know what they're doing.


»Lucas
Reply all
Reply to author
Forward
0 new messages