Blink's current behavior does indeed have its shortcomings. It fails at
simple tasks like:
<div style="position:absolute;">
<div style="float:left;">All of this text </div>
<div>should be on the same line.</div>
</div>
So does Gecko. Presto and IE have no problem. Presto (IE too, allegedly)
finds intrinsic min/max widths as part of layout. If an object has a
fixed size, its intrinsic size is simply the output from layout. In
other cases it's more complicated, in that we have to imagine that the
available width is 0 and infinite. A similar job to
e.g. LayoutBlockFlow::computeInlinePreferredLogicalWidths() in Blink,
except that it's being done during layout in Presto. Then again, there
are some very Presto-specific reasons why Presto does it during layout.
The separation of calculating intrinsic min/max widths and layout in
Blink has grown on me, and I'd like us to have good reasons to remove
it.
My example above isn't fixed by simply laying out for min/max
calculation anyway. What Blink lacks, is the ability to realize that the
float will be adjacent to the sibling block if max intrinsic width is
satisfied. The way I solved this in Presto (which has nothing to do with
actual layout, BTW, although it happens in the same phase), was to
figure out the hypothetical logical top and logical height of every
object if max intrinsic width were satisfied.
What's the flexbox example?
--
---- Morten Stenshorne, developer, Opera Software ASA ----
------------------
http://www.opera.com/ -----------------