[css-align] Stretchable block-level and abspos boxes

Tab and I just checked in some fixes to CSS Box Alignment that
allow shrinkwrapped abspos and block-level elements to respond
to 'stretch' by using the auto-width formula for non-replaced
block-level boxes. (Note the default alignment value is 'auto'.)

We think this is nice, straightforward, and sensible. You can,
for example, now precisely fill the containing block in these
cases, without calc():

   table { margin: 3em; justify-self: stretch; }
   /* stretch small, normally shrinkwrapped table to fill space */

   img { position: absolute;
         left: 25%; right: 15em;
         justify-self: stretch; }
   /* stretch replaced abspos element to fill offset area */

Replaced absposes don't stretch to fill offsets normally:
http://www.w3.org/TR/CSS21/visudet.html#abs-replaced-height

[The previous spec had some statements that treated 'stretch'
like 'start' in these cases.]

~fantasai

Received on Tuesday, 16 December 2014 02:05:19 UTC