New issue
Advanced search Search tips

Issue 697252 link

Starred by 2 users

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug

Blocking:
issue 635019



Sign in to add a comment

[css-flex] Flexbox does not keep image aspect ratio in some cases

Project Member Reported by jfernan...@igalia.com, Mar 1 2017

Issue description

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


 
flexbox-aspect-ratio.html
292 bytes View Download
Cc: cbiesin...@chromium.org
Blocking: 635019
plugin_power_saver_play-1.png
987 bytes View Download

Comment 4 by r...@igalia.com, Mar 1 2017

Cc: jfernan...@igalia.com r...@igalia.com
Components: Blink>Layout>Flexbox
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

flexbox-issue.html
20.2 KB View Download

Comment 5 by e...@chromium.org, Mar 5 2017

Owner: cbiesin...@chromium.org
Over to cbiesinger for flexbox triage 

Comment 6 by e...@chromium.org, Mar 8 2017

Status: Assigned (was: Untriaged)

Comment 7 by e...@chromium.org, May 21 2018

Our rendering matches Firefox. Edge renders the image with the "correct" aspect ratio.

Sign in to add a comment