Browse Source

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.
pull/24/head
Andy 2 years ago committed by Roy Tam
parent
commit
777b3cc622
  1. 10
      layout/base/nsCSSRendering.cpp

10
layout/base/nsCSSRendering.cpp

@ -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:

Loading…
Cancel
Save