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

On Tue, 10 Jan 2012 21:50:34 +0100, Ryosuke Niwa <> wrote:

> On Tue, Jan 10, 2012 at 12:46 PM, Aryeh Gregor <> wrote:
>>  On Tue, Jan 10, 2012 at 3:40 PM, Ryosuke Niwa <> wrote:
>> > Single br tag is shorter than pairs of div tags when serialized.
>> True, but only slightly, and the difference is even smaller if you use
>> <p> instead of <div>.  This isn't enough of a reason by itself to
>> justify the extra complexity of another mode.  Are there other
>> reasons?
> p has default margins.

This is why we implemented opera-defaultblock. Apps were manually  
converting our output to use divs because they didn't want margins, which  
is non-trivial to do and often leaves bugs in edge cases.

> That alone is enough for us not to adopt p as
> the default paragraph separator. Also, unfortunately, there are many  
> legacy
> contents that rely on the fact webkit uses div as the paragraph separator
> so we need a global or per editing-host switch regardless.

Do you suggest that all browsers adopt <div> as default separator by  
default? Or that it will be impossible to reach interop? Or something  
else? :-)

> I almost want a global switch to toggle between legacy UA-specific  
> behavior
> and new spec-compliant behavior.

That would rather miss the point of having the spec IMHO. If we all  
implement a global switch to opt in to a different behavior, let's design  
a new, sane editing API instead. But I think the editing spec should try  
to reach interop for the legacy feature first.

> - Ryosuke

Simon Pieters
Opera Software

Received on Wednesday, 11 January 2012 09:09:37 UTC