[css-flex] Flexbox does not keep image aspect ratio in some cases |
|||||
Issue descriptionChrome Version: (58.0.3004.3) OS: (linux) What steps will reproduce the problem? (1) Load the attached test case What is the expected result? The picture is rendered respecting the aspect ratio. What happens instead? The picture is rendered wider (50px x 16px) than it should (16px x 16px)
,
Mar 1 2017
,
Mar 1 2017
,
Mar 1 2017
Added example with a green 50x50 image. I'm not sure if it's a bug or not, but let me explain my understanding. The problem is that the image is 50x50 and the flex container is smaller 64x16. The image (due to the default align-items: stretch) gets its height shrinked to 16px. However its width is not modified. If you manually set "height: 16px", the width of the image is then 16px (following the aspect ratio). But I'm not sure if "stretch" should keep the aspect ratio too. On a first look to the spec I don't see any specific comment about that: https://drafts.csswg.org/css-flexbox/#valdef-align-items-stretch
,
Mar 5 2017
Over to cbiesinger for flexbox triage
,
Mar 8 2017
,
May 21 2018
Our rendering matches Firefox. Edge renders the image with the "correct" aspect ratio. |
|||||
►
Sign in to add a comment |
|||||
Comment 1 by jfernan...@igalia.com
, Mar 1 2017