-
Notifications
You must be signed in to change notification settings - Fork 716
[css-ui?] Define interaction of block layout and editing. #4904
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
WebKit/WebKit@590ce13 seems to be the first time this specialness was introduced. |
I think that |
Maybe you can fix this in a non-hacky way with |
Well, but using And I wonder, there is same issue for empty inline element's width, isn't it? E.g., |
I'm also somewhat on the fence about this too; on the one hand, I think in an ideal world adding or removing contenteditable shouldn't cause any layout changes, but on the other hand that makes a simple So maybe something involving |
So firefox has an existing line-height hack which applies when we find This is pretty old code but it may be worth making it apply consistently for empty blocks, or something of that sort. |
Ah, there's also w3c/editing#70 for this. |
Yeah, chrome does it as a used-value-time hack. Also for flexbox: WebKit/WebKit@e293e4a... :( |
As far as I know, forcing an empty contentediable to behave as if it had BR is a compatibility requirement. |
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
The text was updated successfully, but these errors were encountered: