It seems all browsers except Gecko hack block layout so that an editable block has at least one non-empty line, see this test-case.
That is, other browsers render <div contenteditable></div> the same as <div><br></div>.
I'm on the fence on whether this is a browser bug on other browsers, or something that we should match and should be specified. If the later, how we do define this?
It seems other browsers only apply it to the editable root?
In blink this is done in LayoutBlock::HasLineIfEmpty, which seems inherited from WebKit's RenderBlock::hasLineIfEmpty.
I see the "do what I mean" intent of this, but it seems a bit of a layering violation / hack to me :(
cc @jfkthame @masayuki-nakano @kojiishi @rniwa
It seems all browsers except Gecko hack block layout so that an editable block has at least one non-empty line, see this test-case.
That is, other browsers render
<div contenteditable></div>the same as<div><br></div>.I'm on the fence on whether this is a browser bug on other browsers, or something that we should match and should be specified. If the later, how we do define this?
It seems other browsers only apply it to the editable root?
In blink this is done in
LayoutBlock::HasLineIfEmpty, which seems inherited from WebKit'sRenderBlock::hasLineIfEmpty.I see the "do what I mean" intent of this, but it seems a bit of a layering violation / hack to me :(
cc @jfkthame @masayuki-nakano @kojiishi @rniwa