- From: Tab Atkins Jr. <jackalmage@gmail.com>
- Date: Sun, 16 Oct 2011 23:31:19 -0700
- To: Ojan Vafai <ojan@chromium.org>
- Cc: www-style@w3.org
- Message-ID: <CAAWBYDAWsivmH=kAa7gEJx16_kQT3-GzoLNg-x9u_u64tEw_6g@mail.gmail.com>
On Sun, Oct 16, 2011 at 6:07 PM, Tab Atkins Jr. <jackalmage@gmail.com> wrote: > In other words, doing either first is bad. I'm trying to figure out > how to explicitly phrase the "correct" way to do this, so you always > find a space-filling and non-overflowing situation when one exists. Got it, I think. At least, it works now in my JS impl of the algorithm. Basically, it goes like this: 1. Set the initial set of max and min violators both to empty sets. 2. Fix any max constraint violations, if they exist. 3. Fix any min constraint violations, if they exist. 4. If the old set of min violators is different from the ones that were just fixed, re-fix the max violations (holding the min violations steady, return the old max violations to flexibility and rerun the distribution+detection+fixing algorithm). 5. If the old set of max violators is different from the ones that were just fixed, re-fix the min violations (ditto, appropriately altered). 6. Cycle between 3 and 4 until neither of them produce any new fixes. Attached is the file with my JS impl, if my summarized algorithm above was unclear. (Note that the JS impl doesn't check for invalid data. Alter at your own risk.) This is, unfortunately, a "cycle until a steady state is reached" sort of situation, but the state is very minimal and doesn't require any sort of layout to compute. ~TJ
Attachments
- text/html attachment: test.html
Received on Monday, 17 October 2011 06:32:38 UTC