The draft CSS-FLEXBOX-1 spec had a more detailed description of this algorithm, so let's use that as our basis for the implementation. Test by Aliaksandr. :^)