W3C home > Mailing lists > Public > public-webapps@w3.org > January to March 2012

Re: Pressing Enter in contenteditable: <p> or <br> or <div>?

From: Aryeh Gregor <ayg@aryeh.name>
Date: Wed, 11 Jan 2012 15:09:05 -0500
Message-ID: <CAKA+AxnvF1nTbNMRn_n7sqDW_gYuycB0kC1nqMRUWtpJ0q91sQ@mail.gmail.com>
To: Ryosuke Niwa <rniwa@webkit.org>
Cc: Markus Ernst <derernst@gmx.ch>, Simon Pieters <simonp@opera.com>, Ojan Vafai <ojan@chromium.org>, Ehsan Akhgari <ehsan@mozilla.com>, WebApps WG <public-webapps@w3.org>
On Wed, Jan 11, 2012 at 12:38 PM, Ryosuke Niwa <rniwa@webkit.org> wrote:
> That sounds like a great idea.
> . . .
> I'm not sure if we should add just "editoptions" though given we might need
> to add more elaborative options in the future. It might make more sense to
> add a new attribute per option as in:
> <div contentEditable paragraphSeparator="p" tabIndentation>

Ojan suggested in the other thread that we instead allow calling
execCommand() on Element, and have the result restricted to that
Element.  That solves the global-flags problem too, and doesn't
require new attributes.  So you'd do

  div.execCommand("tabindent", false, "true");

or whatever.  Someone could still call
document.execCommand("tabindent", false, "false"), but that would be
overridden if it was called on the editing host.  I filed a bug on it:


Does that sound good too?

> Should enter behave like shift+enter when br is the default
> paragraph separator?

Default paragraph separators are used in a couple of other places too,
so it would be a little more work than that.  But I just looked, and
it wouldn't be as bad as I thought.  So this is doable if people have
any good use-cases.
Received on Wednesday, 11 January 2012 20:10:04 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 18:13:30 UTC