[css3-flexbox] sign bug in the algo

Math written in prose tends to be confusing, so maybe I am missing  
something, but I think there is an error in the algorithm section "9.7.  
Resolving Flexible Lengths"

"If the free space is negative
For every item on the line, multiply its flex shrink ratio by its outer  
flex base size, and note this as its scaled flex shrink ratio. Find the  
ratio of the item's scaled flex shrink ratio to the sum of the scaled flex  
shrink ratios of all items on the line. Set the item's main size to its  
flex base size minus a fraction of the free space proportional to the  
ratio."

If the free space is negative, a fraction of the free space proportional  
to the ratio is negative too, since the ratio is positive. So flex base  
size minus some negative thing would give a main size larger than the base  
size, which can't be right when you have negative free space.

So, unless I missed something somewhere, I suggest replacing the last  
sentence of the paragraph quoted with either of the following 2 proposals:

"Set the item's main size to its flex base size minus a fraction of the  
absolute value of the free space proportional to the ratio."

or

"Set the item's main size to its flex base size plus a fraction of the   
free space proportional to the ratio."


  - Florian

Received on Thursday, 5 July 2012 13:18:56 UTC