[whatwg] Pressing Enter in contenteditable: <p> or <br> or <div>?

Ryosuke Niwa rniwa at webkit.org
Fri May 13 15:57:35 PDT 2011


On Fri, May 13, 2011 at 3:35 PM, Ehsan Akhgari <ehsan at mozilla.com> wrote:

> On 11-05-13 1:48 PM, Ryosuke Niwa wrote:
>
>> On Fri, May 13, 2011 at 10:26 AM, Aryeh Gregor<Simetrical+w3c at gmail.com
>> >wrote:
>> Note that br and div affect UBA differently so we must consider what
>> bidirectional text users want as well.
>>
>> For example, if we had<div dir="rtl">hello</div>, and inserted br as in
>> <div dir="rtl">hello<br></div>, then we preserve the RTL directionality.
>>  If
>> we insert div on the other hand,<div dir="rtl">hello</div><div></div>,
>> then
>> new paragraph will have the containing block's direction.
>>
>> This will be a tricky issue when people want to mix LTR/RTL paragraphs in
>> the same editable region.
>>
>
> This is a very good point.  I know that <p> constitutes a UBA paragraph.
>  Does the same apply to <div> as well?


Yes.  Any block element will do.

- Ryosuke



More information about the whatwg mailing list