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

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 UTC