[csswg-drafts] [css-ui?] Define interaction of block layout and editing. (#4904)

emilio has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-ui?] Define interaction of block layout and editing. ==
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](https://bug1625434.bmoattachments.org/attachment.cgi?id=9136291).

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`](https://source.chromium.org/chromium/chromium/src/+/master:third_party/blink/renderer/core/layout/layout_block.cc;l=1656;drc=f1ddc02094084b931955fa2bf52cae1ebc2028f9), which seems inherited from WebKit's [`RenderBlock::hasLineIfEmpty`](https://webkit-search.igalia.com/webkit/rev/ab348309603e3a9f6609bba404bf498898bf1260/Source/WebCore/rendering/RenderBlock.cpp#2446).

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

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/4904 using your GitHub account

Received on Friday, 27 March 2020 12:11:49 UTC