W3C home > Mailing lists > Public > www-style@w3.org > July 2012

Re: [css3-page] Margin boxes: replacing 6.3.2 Variable Dimension Computation Rules

From: Simon Sapin <simon.sapin@kozea.fr>
Date: Mon, 02 Jul 2012 18:23:00 +0200
Message-ID: <4FF1CAE4.3050009@kozea.fr>
To: www-style@w3.org
CC: fantasai <fantasai.lists@inkedblade.net>, MURAKAMI Shinyu <murakami@antenna.co.jp>, Michael Day <mikeday@yeslogic.com>, Peter Moulder <peter.moulder@monash.edu>, Guillaume Ayoub <guillaume.ayoub@kozea.fr>
Le 11/06/2012 23:44, Simon Sapin a écrit :
> I think that − as currently spec’ed − 6.3.2 is unreasonably hard to
> implement, under-specified and not even sufficient for the desired
> behavior. I would like to get consensus that it needs to be re-written.
>
> If we can establish that a replacement is needed, I have a proposal
> below that we can discuss.


Please find attached a revised version of my proposal. You can also find 
the latest version[1] or the change history[2].

[1] 
https://github.com/SimonSapin/css/blob/master/margin-boxes-variable-dimension
[2] 
https://github.com/SimonSapin/css/commits/master/margin-boxes-variable-dimension


Aside from obvious bug fixes, this new revision includes a more 
substantial change:


The general idea of the proposed algorithm is as follows:

* If the sum of the preferred widths is small enough for the containing 
block, use that
* If the sum of the preferred minimum widths is too big, use that
* Otherwise, do something proportional to the amount of content.

For the proportional distribution, the algorithm used to take the 
preferred widths as weights. The problem is that this ignored the 
contraints of minimum widths.

In the new algorithm, each box always gets at least its preferred 
mininmum width. In the third case, only the remaining space is 
distributed. The weights are the preferred width minus the preferred 
mininum width.

This new algorithm as better continuity while still always keeping the 
minimum constraints.

Please share any comment or feedback.

Regards,
-- 
Simon Sapin


Received on Monday, 2 July 2012 16:23:27 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:56 GMT