Blink is inconsistent on whether "overflow:scroll; display: inline-*" can determine baseline from its contents |
|||
Issue descriptionChrome Version: 69.0.3472.3 (Official Build) dev (64-bit) OS: Ubuntu 18.04 What steps will reproduce the problem? (1) Visit https://jsfiddle.net/06wxgroy/ What is the expected result? Consistent baseline-alignment between the 3 cases there. What happens instead? For the first case (inline-block), Chrome aligns "abc" with the bottom of the scrollable box's border. For the second and third case (inline-flex & inline-grid), Chrome aligns "abc" with the first line of text inside the scrollable box. I'm not aware of any spec support for treating inline-flex and inline-grid differently from inline-block here. For reference: Edge agrees with Chrome, while Firefox treats all three boxes the same (using the bottom of the scrollable box's border). We (Mozilla) received a bug report about this ( https://bugzilla.mozilla.org/show_bug.cgi?id=1471942 ) but I think the Firefox behavior seems most coherent, hence filing this bug.
,
Jul 6
(Anyway, setting that WebKit quirk aside, I filed https://bugs.webkit.org/show_bug.cgi?id=187416 on this same issue in WebKit.)
,
Jul 9
,
Jul 9
Why the scrollbar should imply the grid/flex container should synthesize its baseline ? As far as I know, at least for the grid case, the Grid Layout spec about how to compute the baseline of a grid container should be applied: https://drafts.csswg.org/css-grid/#grid-baselines
,
Jul 10
> Why the scrollbar should imply the grid/flex container should synthesize its baseline? For the same reason it implies it for a block, I guess? (I'm not sure what that reason is, but that seems to be the interoperable consensus and longstanding behavior. I'm guessing there's spec text to back it up but I don't happen to know what it is at the moment.) Intuitively, it makes sense to me that the baseline behavior should change when something becomes scrollable, because the (scrolled) position of the first-line-text can change (or may start out at something nonzero) -- so there's less of a compelling reason to use that text for baseline alignment.
,
Jul 10
Looks like the spec text for display:inline-block;overflow:scroll is: ==== The baseline of an 'inline-block' is the baseline of its last line box in the normal flow, unless it has either no in-flow line boxes or if its 'overflow' property has a computed value other than 'visible', in which case the baseline is the bottom margin edge. ==== https://www.w3.org/TR/CSS22/visudet.html#normal-block I guess that is pretty specific to inline-block, and I just found this in the flexbox spec (and grid has a similar chunk): ==== When calculating the baseline according to the above rules, if the box contributing a baseline has an overflow value that allows scrolling, the box must be treated as being in its initial scroll position for the purpose of determining its baseline. ==== https://drafts.csswg.org/css-flexbox-1/#flex-baselines So, I guess this is "invalid" and the specs *require* this inconsistency between inline-block vs. inline-flex/grid here (weird).
,
Jul 10
...oh, though actually, the flex/grid text here seems to be about *child boxes* ("the box contributing a baseline") -- it's not about the flex/grid container itself (and doesn't say anything about what happens when the container has overflow set to something non-"visible", RE baselines).
So I'm back to thinking this isn't really defined in the specs, beyond the requirements from CSS2 about inline-block, which I'd think would implicitly apply to other inline-* containers in the absence of specific contradictory text.
,
Jul 10
I filed https://github.com/w3c/csswg-drafts/issues/2902 to clarify this in the spec. |
|||
►
Sign in to add a comment |
|||
Comment 1 by dholb...@gmail.com
, Jul 6