| Summary: | WebKit is is inconsistent on whether "overflow:scroll; display: inline-*" can determine baseline from its contents | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Daniel Holbert <dholbert> |
| Component: | Layout and Rendering | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED INVALID | ||
| Severity: | Normal | CC: | ahmad.saleem792, bfulgham, simon.fraser, zalan |
| Priority: | P2 | Keywords: | FromImplementor |
| Version: | Safari 11 | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
|
Description
Daniel Holbert
2018-07-06 14:45:43 PDT
tl;dr: Sorry for the trouble - looks like this is actually "Invalid". Details: 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). ...oh, though actually, the flex text that I quoted above (and similar grid text) seems to be about *child boxes* ("the box contributing a baseline") -- it's not about the flex/grid container itself. It 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.
I filed https://github.com/w3c/csswg-drafts/issues/2902 to clarify this in the spec. From Chromium bug, it seems that Firefox changed their behavior to align with all other browsers in the JSFiddle and I tested with Safari 16, Chrome Canary 108 and Firefox Nightly 107 and all browsers are rendering this same (on JSFiddle). Marking this as "RESOLVED INVALID" since Firefox changed the behavior compared to Webkit. Thanks! |