Re: [css3-flexbox][css3-grid] Inline replaced elements as grid items and flexbox items

On 5/16/11 12:52 PM, Tab Atkins Jr. wrote:
> Is there such a thing as a replaced element with a non-trivial
> baseline?  I was under the impression that their baseline was always
> their bottom outer edge.

Per spec, unclear.  CSS 2.1 section 10.8.1 talks about elements that "do 
not have a baseline" and talks about how to align them, but doesn't say 
what elements do not have a baseline.  It does list some things that do 
have a baseline and how to compute it; perhaps the assumption is that 
under those circumstances everything else should be assumed to not have 
a baseline?  It's certainly not clearly defined.  I don't see anywhere 
else in the spec that talks about the issue at all.

In practice, in Gecko, single-line text inputs and buttons use the 
baseline of their text as their baseline.  This leads to significantly 
more readable layout than the alternative of bottom-aligning the inputs 
and putting their baseline at the bottom outer edge, and we would be 
loath to change the behavior; it's very very purposeful.

Going forward, as more interesting form control types are introduced I 
would fully expect some of them to want nontrivial baselines for optimal 
layout.

-Boris

Received on Monday, 16 May 2011 17:06:48 UTC