Re: on execCommand() and script-triggered copy/cut/paste

On Wed, Aug 5, 2015 at 3:48 PM, Aryeh Gregor <> wrote:

> On Wed, Aug 5, 2015 at 4:17 PM, Johannes Wilm <>
> wrote:
> > Maybe we should just move everything about execCommand and the clipboard
> to
> > the execCommand spec? So move your section 10.3 into the execCommand
> spec,
> > which is marked as "currently obsolete".
> >
> > That way execCommand it won't end up a a W3C recommendation with no good
> > reason.
> HTML5 is a W3C Recommendation and it specifies obsolete non-conforming
> features, e.g.:
> Implementations must still support such features, but authors must not
> use them.  Also, execCommand() is in HTML5 too:
> So I don't see what the problem is.

No problem at all, just trying to understand how the W3C spec system works,
both in theory and in practice.

So let me rephrase that: That way we can go ahead and mark execCommand as
obsolete, without execCommand simultaneously showing up in a specification
that is actively being worked on and will eventually hit recommendation
status (for the first time with detailed description of some possible

All the other keywords and how they work are described in the execCommand
spec, so it would only seem consistent to also have that for the ones
related to clipboard commands. That way the clipboard api spec doesn't
depend on execCommand, but execCommand depends on it. The clipboard api can
then instead focus on providing this functionality in a general sense in
all settings, even those not at all connected to editing.

There are many possible use cases for this: For example, imagine a page
that shows a table of data and has a button that says "copy table to
clipboard for insertion in a spreadsheet".

The same can be done today, but it will require an ugly hack of adding a
contenteditable field, executing execCommand('copy"...) on it, etc. .

Johannes Wilm
Fidus Writer

Received on Wednesday, 5 August 2015 21:04:25 UTC