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

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

From: Simon Pieters <simonp@opera.com>
Date: Wed, 11 Jan 2012 10:00:42 +0100
To: "Aryeh Gregor" <ayg@aryeh.name>, "Ryosuke Niwa" <rniwa@webkit.org>
Cc: "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>
Message-ID: <op.v7wwnggjidj3kv@simon-pieterss-macbook.local>
On Tue, 10 Jan 2012 21:50:34 +0100, Ryosuke Niwa <rniwa@webkit.org> wrote:

> On Tue, Jan 10, 2012 at 12:46 PM, Aryeh Gregor <ayg@aryeh.name> wrote:
>>  On Tue, Jan 10, 2012 at 3:40 PM, Ryosuke Niwa <rniwa@webkit.org> 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

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 18:13:30 UTC