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

Re: [clipboard events] implicitly prevent default event action?

From: Anne van Kesteren <annevk@annevk.nl>
Date: Tue, 20 May 2014 11:32:31 +0200
Message-ID: <CADnb78gyfxtMyvy7VtTvgCzVzuaC5Z7Orbuh+mbH0J3nVOUCYw@mail.gmail.com>
To: "Hallvord R. M. Steen" <hsteen@mozilla.com>
Cc: Glenn Maynard <glenn@zewt.org>, public-webapps <public-webapps@w3.org>
On Tue, May 20, 2014 at 10:42 AM, Hallvord R. M. Steen
<hsteen@mozilla.com> wrote:
> Hm.. I didn't really know that was a "rule". I basically want
> element.dispatchEvent(new ClipboardEvent('copy'))
> to be pretty much equivalent to
> document.execCommand('copy')

No that is wrong and I said as much before in another review round. :/

Events are for observation, they don't cause things to happen.

> Spec-wise, event.clipboardData is an instance of the DataTransfer interface in HTML5. Can/should I spec this flag in the Clipboard Events spec, or argue that it should be added to HTML5 (or HTML6 / HTML Living / whatever)?

We should document classes in one place ideally, especially
fundamental concepts of it such as flags.

> Well, I guess it's always possible to have an event listener call dispatchEvent() on some other element, passing the same event object.. Not sure if that matters?

Not as long as it's clear what should happen.

Received on Tuesday, 20 May 2014 09:32:58 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 18:14:24 UTC