Open Bug 1811391 Opened 2 years ago Updated 2 years ago

CSS width: fit-content does not set width properly

Categories

(Core :: Layout, defect)

Firefox 109
defect

Tracking

()

People

(Reporter: gunfight7.gf, Unassigned)

Details

Steps to reproduce:

https://codepen.io/mrtipson/pen/jOpwojN

The codepen above reproduces the issue. It shows:

  • green div (outer container)
  • pink div (placeholder content)
  • red div (image wrapper, positioned absolutely, and the element with the problematic width: fit-content)
  • img (with additional striped background).

Notes:
issue still present in nightly and also on mobile
issue no longer happens if outer container (green) has any hard-coded height (uncomment in codepen).
expected behaviour using the same code observed on chromium and safari

Actual results:

Image wrapper element (red) is narrower than its child (image with striped background).

Expected results:

Image wrapper element (red) should be the same dimensions as child (img) element.

Summary: CSS width: fit-content does not set parent width properly → CSS width: fit-content does not set width properly

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

Component: Untriaged → Layout
Product: Firefox → Core

Hello, thank you for the report!
I managed to reproduce this issue on Windows 10 with Fx 110.0b2 and on macOS 10.15 with Fx 109.0 and latest nightly build.
If this is not the correct component, feel free to change it to a more appropriate one.
Setting as NEW so that the developers can have a look.
Thank you.

Severity: -- → S4
Status: UNCONFIRMED → NEW
Ever confirmed: true
You need to log in before you can comment on or make changes to this bug.