gecko-dev/layout/reftests/bugs/1200611-1.html
Markus Stange 21ce2dd228 Bug 1200611 - Size ImageLayers correctly for <img>s using object-fit. r=dholbert
This changes nsDisplayImage::GetDestRect and nsImageFrame::PredictedDestRect to return
the true dest rect of the image, without intersecting it with the image content box.
The only caller of these functions that actually requires a rectangle that's within
the image's content bounds is nsDisplayImage::GetOpaqueRegion, so I'm changing that
to intersect with the display item's bounds.
I'm pretty sure nsImageFrame::MaybeDecodeForPredictedSize() also prefers the unclipped
dest rect, because it cares about the scale at which the image is painted, and not
about which parts of the image are painted.

--HG--
extra : commitid : CDJJnfN7vF3
extra : rebase_source : 5b59f81ab60290f508b83db7e942559da621cb70
2015-12-03 15:20:10 +01:00

17 lines
290 B
HTML

<!DOCTYPE html>
<meta charset="utf-8">
<title>Make sure the ImageLayer is sized correctly when using object-fit</title>
<style type="text/css">
img {
object-fit: cover;
width: 256px;
height: 128px;
will-change: transform;
}
</style>
<img src="repeatable-diagonal-gradient.png">