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

[css3-flexbox] Flexing algorithm and replaced elements (was: [css3-flexbox] Bad result in flex algorithm when combining stretch, and elements with an aspect ratio)

From: Kang-Hao (Kenny) Lu <kanghaol@oupeng.com>
Date: Fri, 02 Nov 2012 14:22:46 +0800
Message-ID: <509366B6.5060703@oupeng.com>
To: "Tab Atkins Jr." <jackalmage@gmail.com>
CC: WWW Style <www-style@w3.org>
(12/10/28 23:51), Tab Atkins Jr. wrote:
> However, that brings up a further problem.  If you *first* stretch,
> but the item is also flexible, the flexing can cause it to no longer
> fill the flex line.  In other words, it might simply be impossible to
> simultaneously honor the aspect ratio, the 'stretch' keyword, and a
> non-zero "flex" value.  This is similar to how you can't always
> simultaneously honor width, height, and the aspect ratio.  We satisfy
> the latter by breaking the ratio; we consider an explicit width and
> height to be stronger than the implicit aspect ratio.

I think there is a relevant question here:

  Should a replaced item's, say, min cross size property induce a min
  main size when an item flexes?

The current spec

  # Fix min/max violations. Clamp each item's main size by its min and
  # max main size properties....

seems to say it doesn't, but this might produce stretched images when
the item is laid out after flexing, no matter what 'align-self' it has,
since min/max properties are strong.

I think the spec could consider saying that for an replaced element,
it's the *effective min main size* that's used in this step. The
*effective min main size* is defined by this formula:

  max( min main size, min ( min cross size * w/h , max main size ) )


  w is the intrinsic width, h is the intrinsic height
  max main size is the maximal of the max main size and the min main
  size properties

. And effective max main size would be defined similarly.

Or was it resolved that the min cross size property should be ignored in
this case?
Web Specialist, Oupeng Browser, Beijing
Try Oupeng: http://www.oupeng.com/
Received on Friday, 2 November 2012 06:23:29 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 11 February 2015 12:35:18 UTC