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

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

From: Aryeh Gregor <Simetrical+w3c@gmail.com>
Date: Sun, 13 Mar 2011 16:46:36 -0400
Message-ID: <AANLkTimxzZnJPOaW-hKWR0f3T2xHx-RNN2zxjk2=v6xV@mail.gmail.com>
I did some research, looking at three different rich editing suites:
vBulletin's WYSIWYG editor, jwysiwyg (a jQuery plugin), and TinyMCE
(used by Wordpress).  I also looked at CKEditor, but I don't think it
uses execCommand() at all.  My full notes are at
<http://aryeh.name/spec/editcommands/notes.txt>.  One thing I found is
that all three set styleWithCSS to false.  This reinforces my theory
that styleWithCSS = true is not useful (although I'm still open to
counterexamples).

I've already gotten a bunch of WebKit feedback, so I'd appreciate
feedback from Mozilla and Opera.  (And Microsoft, if anyone can tell
me how to get feedback from them.)  Particular questions I'm currently
not so sure about:

1) Is there any reason to keep styleWithCSS/useCSS in its current
form?  Only Gecko and WebKit support it.  Trident and Presto only
support the equivalent of styleWithCSS = false, and the three rich
editors I studied force styleWithCSS to false unconditionally.  I can
see the value in a mode that doesn't produce invalid markup like
<font>, but is there any reason to have a mode that produces markup
like <span style="font-weight: bold"> instead of <b>?

2) How much work should we go to to produce nice-looking markup?
E.g., if the user unbolds "baz" in

<div style="font-weight:bold">
<p>Foo
<p>Bar baz
</div>

should we produce something like

<div>
<p style="font-weight: bold">Foo
<p><b>Bar </b>baz
</div>

like WebKit does, or would it be okay to do

<div style="font-weight:bold">
<p>Foo
<p>Bar <span style="font-weight: normal">baz</span>
</div>

to avoid the complexity, given that this sort of markup shouldn't be
too common?  I think it's clear that something like "<b>Foo baz
bar</b>" should become "<b>Foo </b>baz<b> bar</b>" and not "<b>Foo
<span style='font-weight: normal'>baz</span> bar</b>", but how far
should we go?
Received on Sunday, 13 March 2011 13:46:36 UTC

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