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

Re: [css3-flexbox] sign bug in the algo

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Mon, 9 Jul 2012 10:23:56 -0700
Message-ID: <CAAWBYDB5gOFXAVrqtOLapW26YABqu5FdM9mpUX03+QDjuaornQ@mail.gmail.com>
To: Florian Rivoal <florianr@opera.com>
Cc: "www-style@w3.org" <www-style@w3.org>
On Thu, Jul 5, 2012 at 6:16 AM, Florian Rivoal <florianr@opera.com> wrote:
> 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."

Fixed.  I went with the first wording to avoid any possible confusion.

~TJ
Received on Monday, 9 July 2012 17:24:43 GMT

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