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: Kang-Hao (Kenny) Lu <kanghaol@oupeng.com>
Date: Tue, 04 Dec 2012 17:03:20 +0800
Message-ID: <50BDBC58.1020703@oupeng.com>
To: "Tab Atkins Jr." <jackalmage@gmail.com>
CC: www-style list <www-style@w3.org>, Rossen Atanassov <Rossen.Atanassov@microsoft.com>, Alex Mogilevsky <alexmog@microsoft.com>
(12/12/04 4:27), Tab Atkins Jr. wrote:
>> 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.

Are there test cases showing that IE is indeed doing this? My test[1]
unexpectedly shows the contrary in IE10 (and so I can't do further
testing with my comments below). Chrome and Opera 12.10 give stretched
images, as expected.

> 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).

which is this paragraph:

  # If the flex basis and cross size are both ‘auto’ , the flex
  # container is single-line and has a definite cross size, the flex
  # item has an intrinsic aspect ratio, and the flex item has
  # ‘align-self: stretch’, the flex base size is computed from the
  # flex container's inner cross size and the flex item's intrinsic
  # aspect ratio.

> Can we get some review that this works, and that it matches the
> current IE behavior?

Is it intentional that the flex base size computation here ignores
min/max constraint (say, 'min/max-height') on the flex item with
intrinsic aspect ratio? Say, something like this

  <flex height=100>
    <img max-height=50 />
  </flex>

(Note that this is different from another question of mine which has to
do with the flexing algorithm.)

This extra substep overall seems somewhat inconsistent and looks like a
hack to me but I am fine as long as browsers vendors are willing to
follow the spec literally. But I'd hope Web developers show support for
this.


[1] http://software.hixie.ch/utilities/js/live-dom-viewer/?saved=1981


Cheers,
Kenny
-- 
Web Specialist, Oupeng Browser, Beijing
Try Oupeng: http://www.oupeng.com/
Received on Tuesday, 4 December 2012 09:04:15 GMT

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