W3C home > Mailing lists > Public > public-css-bugzilla@w3.org > April 2012

[Bug 16856] New: consider using division for negative flexibility

From: <bugzilla@jessica.w3.org>
Date: Wed, 25 Apr 2012 15:39:44 +0000
To: public-css-bugzilla@w3.org
Message-ID: <bug-16856-5148@http.www.w3.org/Bugs/Public/>
https://www.w3.org/Bugs/Public/show_bug.cgi?id=16856

           Summary: consider using division for negative flexibility
           Product: CSS
           Version: unspecified
          Platform: PC
               URL: http://lists.w3.org/Archives/Public/www-style/2012Apr/
                    0692.html
        OS/Version: Windows NT
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Flexbox
        AssignedTo: jackalmage@gmail.com
        ReportedBy: alexmog@microsoft.com
         QAContact: public-css-bugzilla@w3.org
                CC: dbaron@dbaron.org, alexmog@microsoft.com


(see email thread)

Currently, flexibility is always addition and subtraction, not multiplication
or division. It makes sense when stretching - when items already have the space
they wanted, they get equal share of additional space (given same flexibility).

But when shrinking, subtraction isn't really a good way of fair distribution.
It works OK with minor adjustments, but if space shortage is significant and
some items are much bigger than others, small items quickly shrink to zero (or
their min size), while big fat items may not even notice. The problem can be
mitigated by giving bigger items bigger negative flex, but it is only possible
if the author knows what will be bigger...

Shrinking should be done by *dividing* the flexible lengths proportional to
flexibility. Something like this:

    shrink-factor = sum(preferred-size / negative-flex) / available-space
    used-main-size = main-size / (shrink-factor * negative-flex)

this way, when shrinking, flex items remain proportional to their preferred
size.

-- 
Configure bugmail: https://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
Received on Wednesday, 25 April 2012 15:39:51 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 25 April 2012 15:39:51 GMT