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 09:38:16 -0800
Message-ID: <CABNRm630_LNzgAsRcKqOJszWfEhvM1isaCKGUXUqCoNaQeeoUA@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 7:39 AM, Aryeh Gregor <ayg@aryeh.name> wrote:
>
> Okay, so what API should we use?  I'd really prefer this be
> per-editing host.  In which case, how about we make it a content
> attribute on the editing host?


That sounds like a great idea.


> It can be a DOMSettableTokenList. Maybe something like
>
>  <div editoptions="tab-indent">
>
> where the attribute is a whitespace-separated list of tokens.  To
> start with, we can maybe have tab-indent (hitting Tab indents) and
> div-separator (hitting Enter produces div).  Does this sound like a
> good approach?  If so, what should we call the attribute?  And should
> it imply contenteditable=true, or should the author have to specify
> that separately?
>

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>

Also: are there any good use-cases for <br>?  Allowing <div> instead
> of <p> adds basically no extra complexity, but allowing <br> would
> make things significantly more complicated.
>

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

- Ryosuke
Received on Thursday, 12 January 2012 00:48:29 GMT

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