diff options
author | Andy <webmaster@RealityRipple.com> | 2020-07-31 13:01:58 -0700 |
---|---|---|
committer | Andy <webmaster@RealityRipple.com> | 2020-07-31 22:42:38 -0700 |
commit | e664d436999eb16f3e3735bcd4bf4c862e174b19 (patch) | |
tree | 21ee3c35f37c60aec14f939605a29c0be0ead3e9 | |
parent | 232f987cf45aad65d20e79d283f14c72771c9bc8 (diff) | |
download | UXP-e664d436999eb16f3e3735bcd4bf4c862e174b19.tar UXP-e664d436999eb16f3e3735bcd4bf4c862e174b19.tar.gz UXP-e664d436999eb16f3e3735bcd4bf4c862e174b19.tar.lz UXP-e664d436999eb16f3e3735bcd4bf4c862e174b19.tar.xz UXP-e664d436999eb16f3e3735bcd4bf4c862e174b19.zip |
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.
-rw-r--r-- | layout/base/nsCSSRendering.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/layout/base/nsCSSRendering.cpp b/layout/base/nsCSSRendering.cpp index e6e3b5f6f..d5df17020 100644 --- a/layout/base/nsCSSRendering.cpp +++ b/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: |