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

On Wed, Jan 11, 2012 at 1:43 AM, Markus Ernst <derernst@gmx.ch> wrote:

> Am 11.01.2012 10:00 schrieb Simon Pieters:
>
>  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.
>>
>
> Actually, applying p {margin:0} looks quite trivial.


The problem is that many existing contents don't have that css rule and we
obviously don't want to create markup like <p style="margin: 0px;"> for it
is too verbose.

On the long term, from a developer's and client supporter's POV I'd prefer
> to have a standard behavior that works the same in all UAs, and all common
> editor applications, by default. Offering a default paragraph separator
> setting means, that editor behaviors will remain different across
> applications, which is confusing for many users.
>

That's just not gonna happen. Each application uses a different paragraph
separator for a reason.

It might be less a hassle to have maintainers of existing applications
> insert a line of code that triggers legacy behavior, if this is crucial for
> their application.
>

That doesn't solve any backward compatibility problems.

- Ryosuke

Received on Wednesday, 11 January 2012 17:32:17 UTC