W3C home > Mailing lists > Public > whatwg@whatwg.org > March 2011

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

From: Roland Steiner <rolandsteiner@google.com>
Date: Thu, 3 Mar 2011 14:51:19 +0900
Message-ID: <AANLkTimJ1miEyJiaO8C_q0sO-NSaKOUgP5Rna4PdFQZM@mail.gmail.com>
On Thu, Mar 3, 2011 at 4:18 AM, Aryeh Gregor <Simetrical+w3c at gmail.com>wrote:

> On Tue, Mar 1, 2011 at 5:11 PM, Ryosuke Niwa <rniwa at webkit.org> wrote:
> > Styling a Range doesn't support styleWithCSS=false
> I saw this feature in Mozilla's docs, but I don't really get it.  What
> use-cases does it have?  Why do we need to support both ways of doing
> things if they create the same visible effect?
> On Tue, Mar 1, 2011 at 11:39 PM, Roland Steiner
> <rolandsteiner at google.com> wrote:> In general, I completely agree on 2),
> but I think there are several issues
> > with 1) and the "messy DOM" part:> .) In your results you mix
> element-based styling and CSS-based styling. I
> > don't think that's a good idea, for 2 reasons (apart from looking
> > inconsistent): 1.) you force complexity on code that perhaps could live
> with
> > just simple element-based markup  2.) whether to produce element-based
> > styling or CSS-based styling should be determined by whether or not
> > "StyleWithCSS" was set. (Now, I'm not a huge fan of that command, but I
> do
> > think it's important for users to have a way to specify this).
> First, why do you think it's important for users to have a way to
> specify this?  I don't understand what the use-cases are.  We should
> just go with the simplest output that achieves the desired result, no?

But how do you know what is the desired result? Paraphrasing Julie's point
from our original exchange: you want to be consistent to make it easy to
hand-edit the resultant HTML (by the user, say), or for server-side
post-processing. For these purposes pure markup is often easier. OTOH, in
general, styles are more powerful. Mixing both arbitrarily, however, is
making things just complicated for everyone who has to use or process the

That is: conversely I would ask what is the benefit (to the user) of mixing
markup and styles? You seem to argue (in your mails and follow-ups on
http://lists.w3.org/Archives/Public/www-style/2011Feb/0641.html) that
contentEditable and execCommand are for visual markup only rather than also
addressing semantic concerns. If so, why not be consequent and argue for -
and use - styles only (i.e., argue for making "styleWithCSS" the default and
deprecate styleWithCSS=false)? Now, I don't think this could be a final
solution, for the aforementioned points, but I think it'd make for a better
and more consistent starting point.

- Roland
Received on Wednesday, 2 March 2011 21:51:19 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:31 UTC