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

[css3-flexbox] sign bug in the algo

From: Florian Rivoal <florianr@opera.com>
Date: Thu, 05 Jul 2012 15:16:48 +0200
To: "www-style@w3.org" <www-style@w3.org>
Message-ID: <op.wgy5uau14p7avi@localhost.localdomain>
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 GMT

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