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: Tue, 10 Jan 2012 12:40:48 -0800
Message-ID: <CABNRm60or_wTOrr3WV4SvHuYYYhejBjtwKCvdqiRQQhpwQNwJg@mail.gmail.com>
To: Simon Pieters <simonp@opera.com>
Cc: Aryeh Gregor <Simetrical+w3c@gmail.com>, Ojan Vafai <ojan@chromium.org>, Ehsan Akhgari <ehsan@mozilla.com>, "Michael A. Puls II" <shadow2531@gmail.com>, Markus Ernst <derernst@gmx.ch>, "Hallvord R. M. Steen" <hallvord@opera.com>, WebApps WG <public-webapps@w3.org>
On Sun, Jan 8, 2012 at 11:57 PM, Simon Pieters <simonp@opera.com> wrote:

> On Sat, 07 Jan 2012 03:57:33 +0100, Ojan Vafai <ojan@chromium.org> wrote:
>
>> Different apps
>> have different needs and it's crappy for them to have to handle enter
>> themselves just to get a different block type on enter.
>>
>> Something like document.execCommand("**DefaultBlock", false, tagName).
>> What
>> values are valid for tagName are open to discussion. At a minimum, I'd
>> want
>> to see "div", "p" and "br".
>>
>
> What is the use case for "br" that "div" doesn't cover?


Single br tag is shorter than pairs of div tags when serialized.

 I'm tempted to say that any block type should be allowed,
>>
>
> I strongly disagree. Supporting any block type opens up for lots of bugs
> and weird cases. We should only support the types necessary to cover
> presented use cases.


Yeah, supporting arbitrary block element will complicate a lot of things
especially because people can add "display: inline" as a css rule or in
inline style declarations.

- Ryosuke
Received on Tuesday, 10 January 2012 20:41:36 GMT

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