Description
This is about the special case described at the end of the "block" section, here:
https://drafts.csswg.org/css-align/#baseline-export
which was added in #2902.
Right now, that spec text says:
...for legacy reasons, if an inline-block is a scroll container or contains no in-flow line boxes, its first and last baseline sets are synthesized from its margin box.
It appears we need to broaden the first part of that condition.
Right now, the special case specifically covers scenarios where the inline-block
is a scroll container. But it doesn't cover the case where the inline-block
contains a scroll container (and nothing else). Browsers render that scenario the same way, but the spec doesn't say they should, AFAICT.
i.e. Browsers render these two divs the same (using their margin-bottom edge for baseline alignment):
abc
<div style="display:inline-block;overflow:scroll">...</div>
<div style="display:inline-block"><div style="overflow:scroll">...</div></div>
Here's a real-world testcase demonstrating that browsers do in fact align them the same (using the margin-bottom for both): https://hg.mozilla.org/mozilla-central/raw-file/2064e7c799d2/layout/reftests/inline/inline-block-baseline.html