Open Bug 1857365 Opened 2 years ago Updated 11 months ago

<img> grid item with percentage height, "width: auto", "grid-template-columns: auto", and no track stretching makes column to have the same width of the original image's width

Categories

(Core :: Layout: Grid, defect)

Firefox 118
defect

Tracking

()

Tracking Status
firefox118 --- affected
firefox119 --- affected
firefox120 --- affected

People

(Reporter: brim2077, Unassigned)

Details

Attachments

(2 files)

User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36

Steps to reproduce:

Create a grid container, remove track stretching, set image's column to "auto"

Create an image inside the grid container. Image's "width: auto" continues as is. The image's height must be a percentage that makes its width smaller than the original size.

Actual results:

Although the image's width followed the height to maintain proportion, the corresponding column for the image retains the image's original width.

Codepen: https://codepen.io/Arsemy/pen/rNoQyNP
Obs: you may want to use the browser's tools to see the column size

Expected results:

The image's column should have followed the image's width because doing the opposite (i.e., setting a width percentage and letting "grid-template-rows: auto") doesn't preserve the size, or simply using pixels.

Attachment #9356958 - Attachment description: weid firefox behavior vs expected chromium behavior → weird firefox behavior vs expected chromium behavior

The Bugbug bot thinks this bug should belong to the 'Core::Layout: Grid' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Layout: Grid
Product: Firefox → Core
Attached file testcase 1

Thanks for the bug report. I can reproduce; here's the standalone testcase taken from codepen. (You need to use devtools to draw grid lines to see the discrepancy, as shown in the reporter's screenshot.)

Severity: -- → S3
Status: UNCONFIRMED → NEW
Ever confirmed: true

Hello, thank you for the bug report!
Managed to reproduce the issue on:

  • Nightly 120.0a1;
  • Firefox 119.0;
  • Firefox 118.0.2;

Tested and reproduced on:

  • macOS 12;
  • Windows 10;
  • Ubuntu 22;

Since this bug is already set as NEW I'm going the update the status flags.

Hi,
Same issue here.

Do we have any news about it?

Serious layout issue in my app because of this bug still not fixed. Works well under chromium based browsers.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: