[css3-flexbox] Bad result in flex algorithm when combining stretch, and elements with an aspect ratio from Tab Atkins Jr. on 2012-12-03 (www-style@w3.org from December 2012) (original) (raw)
On Thu, Nov 1, 2012 at 6:27 AM, Tab Atkins Jr. <jackalmage@gmail.com> wrote:
So, based on feedback in this thread, here's my modified suggestion:
- In step 3, add a step that, if the available cross size is definite, and an item has both an intrinsic aspect ratio and 'align-self:stretch', goes ahead and sets the hypothetical cross size of the item to the available cross size, and the hypothetical main size according to its aspect ratio.
- Modify step 9 (handling "stretch" alignment) to have an explicit statement about handling aspect-ratio items, to clarify that it changes the cross-size while ignoring the aspect ratio, so the main size doesn't change.
This should be all we need to do. If an item with an aspect ratio is stretched and flexible, it'll first stretch its cross size to fit the line, then flex its main size (possibly changing its cross size as well to maintain its ratio), then stretch its cross size to fit the line again if necessary, this time not changing the main size to maintain its ratio.
I've gotten private feedback from Ojan & Tony that they're fine with these additions, and I think this matches IE's behavior. If I don't get any objections from one of the other browsers, I'll put this into the spec in a few days.
We've made the change in (1) above, and just added a note rather than making the change in (2), as fantasai is sure that it won't actually have an effect if you follow the steps properly: <http://dev.w3.org/csswg/css3-flexbox/#hypothetical-main-size> (third bullet point in the linked step).
Can we get some review that this works, and that it matches the current IE behavior?
~TJ
Received on Monday, 3 December 2012 20:27:55 UTC