Bug 1471583: Preserve the behavior of bailing out from GetSourceToDestTransform if any direction of the intrinsic size matches the destination rect.
This condition was effectively removed in
bug 1469000 because I didn't think it
was necessary at all. But looks like either it is (but I don't understand why),
or it's wallpapering something else...
Looks like this was introduced in
bug 624647 and there's no comment related to
why it is relevant.
In any case it's harmless, as we'd overinvalidate when it's hit.
MozReview-Commit-ID: 4o4RVxjBMVC
--- a/layout/generic/nsImageFrame.cpp
+++ b/layout/generic/nsImageFrame.cpp
@@ -442,16 +442,22 @@ nsImageFrame::GetSourceToDestTransform(n
// see ScaleIntrinsicSizeForDensity.
nsSize intrinsicSize;
if (!mImage ||
!NS_SUCCEEDED(mImage->GetIntrinsicSize(&intrinsicSize)) ||
intrinsicSize.IsEmpty()) {
return false;
}
+ // FIXME(emilio): Not clear to me why this is needed. See bug 1471583.
+ if (intrinsicSize.width == destRect.width ||
+ intrinsicSize.height == destRect.height) {
+ return false;
+ }
+
aTransform.SetScale(float(destRect.width) / float(intrinsicSize.width),
float(destRect.height) / float(intrinsicSize.height));
return true;
}
// This function checks whether the given request is the current request for our
// mContent.
bool