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

Re: [css3-flexbox] Bad result in flex algorithm when combining stretch, and elements with an aspect ratio

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Mon, 3 Dec 2012 12:27:01 -0800
Message-ID: <CAAWBYDD43EdtkppcgG-epeTdAF8Ayc_4wWu1k8NJ49Xe6ZjPZg@mail.gmail.com>
To: www-style list <www-style@w3.org>, Rossen Atanassov <Rossen.Atanassov@microsoft.com>, Alex Mogilevsky <alexmog@microsoft.com>
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:
>
> 1. 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.
> 2. 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 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:21:03 GMT