Issue #1619 - Missing Dimension Computation

This existed in Firefox before this bug.
I don't know if it came from a previous bug or was removed post-fork.
This commit is contained in:
Andy 2020-07-31 13:01:58 -07:00 committed by Roy Tam
commit 777b3cc622

View file

@ -5290,6 +5290,16 @@ nsImageRenderer::ComputeIntrinsicSize()
if (haveHeight) {
result.SetHeight(nsPresContext::CSSPixelsToAppUnits(imageIntSize.height));
}
if (!haveHeight && haveWidth && result.mRatio) {
nscoord intrinsicHeight =
result.mRatio.Inverted().ApplyTo(imageIntSize.width);
result.SetHeight(nsPresContext::CSSPixelsToAppUnits(intrinsicHeight));
} else if (haveHeight && !haveWidth && result.mRatio) {
nscoord intrinsicWidth = result.mRatio.ApplyTo(imageIntSize.height);
result.SetWidth(nsPresContext::CSSPixelsToAppUnits(intrinsicWidth));
}
break;
}
case eStyleImageType_Element: