|
Posted by Ben C on 10/11/07 15:48
On 2007-10-11, Neredbojias <monstersquasher@yahoo.com> wrote:
[...]
>> How does the box model suck anyway? If you didn't have to worry about
>> history or what existing browsers did, what box model would you
>> design?
>
> I am not nor profess to be an expert in designing box models, but first
> and foremost, said model should be logical _and_ easy to use. I'd
> approach the problem by "reverting" to a model wherein the "100%"
> designation includes borders/margins/padding and see, by empirical
> testing, how that might be accommodated.
For CSS3, the box-sizing: [content-box | border-box] property has been
proposed.
> I would re-base top and bottom percentage designations applied on
> margins, etc., to height as opposed to width.
There are some unforseen consequences to doing that. The height of an
element often can't be known until its descendents have been formatted.
But its descendents may contain floats (which affect their containers'
heights, by displacing text for example). The positions of the floats
and therefore how the text flows around them is affected by the top
margin of the container in the case where a float spreads from one block
box down into a vertically adjacent one.
So you would have a circularity: top margin height depends on content
height, which depends on floats, which depends on top margin height.
Not insoluble, but since the way text wraps around lines and floats is
not a nice smooth function, the only practical solution would be a lot
of iteration.
[Back to original message]
|