content-visibility: auto causes object-fit to no longer apply once image element has left and re-entered the viewport
Categories
(Core :: Layout, defect)
Tracking
()
Tracking | Status | |
---|---|---|
firefox-esr115 | --- | unaffected |
firefox-esr128 | --- | affected |
firefox130 | --- | wontfix |
firefox131 | --- | wontfix |
firefox132 | --- | fix-optional |
People
(Reporter: lewisl, Unassigned, NeedInfo)
References
(Regression)
Details
(Keywords: nightly-community, regression)
Attachments
(1 file)
8.28 KB,
text/html
|
Details |
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36
Steps to reproduce:
Create a wrapping element with a fixed aspect ratio. Add an image with a visibly different aspect ratio to it with width and height set to 100%, object-fit set to contain and content-visibility set to auto. Observe that object-fit keeps the visible image proportions correct. Scroll the page so the image has fully left the viewport. Scroll the image back into view.
Bare bones CodePen example here: https://codepen.io/enigmalewislane/pen/VwowpNm
Actual results:
The image reappears without object-fit applied. Trying to change the value of object-fit or enabling/disabling it in dev tools has no effect, and the image remains stretched/squashed.
Expected results:
The image should reappear looking the same as it did when it left the viewport.
Comment 1•2 months ago
|
||
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.
Comment 2•2 months ago
|
||
Regression window:
https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=f89991d1b2cdd13120304730efba7878d4cfac5b&tochange=af2192d1c5378cb3d6d9334ddcf52500f94bc385
Comment 3•2 months ago
|
||
Set release status flags based on info from the regressing bug 1804761
Updated•2 months ago
|
Comment 4•2 months ago
|
||
:daniel do you think you can take a look and assign a priority/severity here?
Comment 5•2 months ago
|
||
Thanks for the bug report!
Here's a version of the testcase that automatically scrolls down+up after 500ms and triggers the bug (for me at least).
Comment 6•2 months ago
|
||
Triaging as S3 (regular-severity) given we've been shipping with this for a while. Seems like it's probably not too complex of a fix, though. Leaving ni=me to investigate further (probably can't today but hope to do so soon).
Description
•