[whatwg] Ongoing work on an editing commands (execCommand()) specification

Aryeh Gregor Simetrical+w3c at gmail.com
Thu Apr 7 15:29:44 PDT 2011


On Thu, Apr 7, 2011 at 5:57 PM, Tim Down <timdown at gmail.com> wrote:
> I don't recall ever wanting to use execCommand() in non-editable
> content myself (although I wouldn't rule it out), but I've answered a
> few questions on Stack Overflow where the asker has wanted to
> highlight (i.e. change the background colour of) the current
> selection. I've suggested temporarily putting the document into
> designMode, calling execCommand() with "HiliteColor" / "BackColor" and
> turning designMode off again.

That's an interesting use-case.  On the other hand, the "execCommand()
works everywhere" behavior is less flexible, in that it's impossible
to work around it if you don't want it, unless I'm missing something.
The behavior of non-IE browsers works well for the common case, and
when you do want to style something that's not editable, you can
always briefly make it editable.  So I'm inclined to spec the non-IE
behavior.



More information about the whatwg mailing list