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

On Thu, Aug 6, 2015 at 2:19 PM, Hallvord Reiar Michaelsen Steen <> wrote:

> On Thu, Aug 6, 2015 at 7:01 AM, Johannes Wilm <>
> wrote:
>> No, execCommand **definitely** needs to remain in the recommended spec as
>>> an obsolete feature regardless of whether its use is discouraged or not.
>>> The idea that we should only write specifications for the bright new
>>> future has failed. See XHTML 2.0. We need to spec every obsolete feature
>>> that is needed for Web compatibility reasons because that’s the only way we
>>> can allow people to write new interoperable browser from scratch. And I can
>>> assure you can’t build a Web browser compatible with the Web without
>>> contenteditable=true and execCommand support. A whole bunch of contents
>>> e.g. Gmail would not work.
>> I think there is some misunderstanding here. No information is lost.
>> Everything about the clipboard api and execCommand is still specced. It's
>> just that those commands relating to the clipboard are defined in the
>> execCommand spec draft, just as all other execCommand based commands.
>> Hallvord can also be added as an editor to the execCommand spec and then he
>> can just change that section in whatever way is needed, whenever it is
>> needed.
> I'm fine with this solution although I'd also want us to respect Aryeh's
> wish that we don't make a fork of his work if we don't intend to make
> updates to it.

Well, we are making some updates to it, and the warning corresponds as far
as I can tell to the wording Aryeh preferred. We were doing some minor
things already before yesterday, so this spec is the one things happen in
and not the one from beginning of 2014. That entire discussion was some
months ago when maintainership was transferred. Aryeh and you are also
welcome to rejoin the drafts as part of the editor team if you want to add
something more to it yourselves.

That also applies to anyone else wanting to add things to it (who can be an
editor according to W3C rules). It seems to me that if cut and paste really
are to be be specced sufficiently to really work the same way *a lot* of
work has to go into defining exactly how the merging operations after paste
and cut are to work. There is quite a bit on deletion in the spec and I
think one possibly may be able to reuse some of that.

Also, a minor point: you say execCommand() only works with contentEditable,
> but that's not actually the case. It depends on the command - *most* of
> them are intended for contentEditable contexts, but some (like 'copy') also
> work elsewhere.

Ah, I was not aware of that. Well, the copy command didn't work in Chrome
for me unless it was inside a contentEditable=true-element (line 10 in ). So maybe this is something working in some
browsers and not in others? Or maybe something that works sometimes but not
at other times? It would probably be good to spec that as well.

> FWIW, I believe it's premature to classify those features as "obsolete".
> You're most likely a couple of years away from a point where your specs are
> sufficiently complete and enough implementations are shipped (with enough
> bugs killed) to make it feasible for web developers to start using
> cE=intents. (I think that's an optimistic estimate). Do you want to simply
> forbid developers from developing new stuff with rich text editing
> functionality during the next couple of years? When/if the new stuff is
> ready, it's time to say the old stuff shouldn't be used IMHO.

I only updated the warning to use the warning Aryeh asked to put there, so
now it no longer says "deprecated" but "obsolete". I think that's a fair
compromise and we shouldn't change the wording again every other day. It
also uses the word "likely", etc.

> Anyway - I am perfectly happy with moving all text about execCommand out
> of the Clipboard API and into the execCommand spec.

perfect! Please let me know if I transferred that correctly and if/when you
need for other things to be added/removed. If you want to have direct write
access, we'll have to ask the W3C people about that.

Johannes Wilm
Fidus Writer

Received on Thursday, 6 August 2015 14:28:15 UTC