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

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

From: Ryosuke Niwa <rniwa@webkit.org>
Date: Wed, 11 Jan 2012 12:15:18 -0800
Message-ID: <CABNRm60-2foEmbpEFMRV6vwuH=LfNrT5-Z6wdTrSKqAviDospw@mail.gmail.com>
To: Aryeh Gregor <ayg@aryeh.name>
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:09 PM, Aryeh Gregor <ayg@aryeh.name> wrote:

> 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:
>
> https://www.w3.org/Bugs/Public/show_bug.cgi?id=15522
>
> Does that sound good too?
>

That sounds workable. Presumably it's only available on the editing host
(as supposed to any element or any element with contenteditable content
attribute).

> 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.
>

Great.

- Ryosuke
Received on Thursday, 12 January 2012 00:06:56 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:49 GMT