Closed Bug 1209736 Opened 10 years ago Closed 10 years ago

`object-fit: cover` doesn't preserve aspect-ratio with `min-width`/`min-height` with `will-change: scroll-position` set

Categories

(Core :: Layout, defect)

43 Branch
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 1200611

People

(Reporter: mgol, Unassigned)

Details

See http://jsfiddle.net/jzcw74nL/1/. Since the carousel has will-change: scroll-position, scrolling shouldn't influence layout of the individual elements. However, even thought the inner img has `object-fit: cover` set it doesn't preserve its aspect ratio until you scroll a little. When you do, it doesn't return to its initial broken layout. It works fine in Chrome 45 & Safari 9. It's broken in Firefox 41 & 43. IE/Edge don't support object-fit so the image is broken there all the time.
Thanks for the report! Looks like this is actually a duplicate of bug 1200611. ("will-change: scroll-position" almost certainly layerizes the element -- i.e. it activates a browser optimization that gives the element its own surface internally. And we mishandle object-fit on that surface, apparently. :-/ )
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → DUPLICATE
Hmm, the test case linked in the first comment in bug 1200611 (http://codepen.io/polarathene/pen/MwNazK) shows object-fit is mishandled during the transition. In my case it's different - the initial state is wrong and once you start scrolling it fixes itself and never breaks again. Is it still the same issue?
That's interesting; I'll bet it's just because we trigger a slightly different repaint path once the scroll happens. I'll leave it a duplicate for now, since I'm pretty sure it's a version of the same issue, but I'll make sure to check that this testcase is fixed when fixing bug 1200611 (and un-dupe if it's not). Thanks!
You need to log in before you can comment on or make changes to this bug.