summaryrefslogtreecommitdiffstats
path: root/layout/base/nsCSSRendering.cpp
diff options
context:
space:
mode:
authorAndy <webmaster@RealityRipple.com>2020-07-31 13:01:58 -0700
committerMoonchild <moonchild@palemoon.org>2020-08-07 21:27:40 +0000
commit8f72a673ca9c6c85f36467720fa201a2caaa6038 (patch)
treee8a4fc7b48d3eb09d1cbc0fff2844a4e2c14adbb /layout/base/nsCSSRendering.cpp
parent3266e0976ff055aefa49b664966229bbb89d1009 (diff)
downloadUXP-8f72a673ca9c6c85f36467720fa201a2caaa6038.tar
UXP-8f72a673ca9c6c85f36467720fa201a2caaa6038.tar.gz
UXP-8f72a673ca9c6c85f36467720fa201a2caaa6038.tar.lz
UXP-8f72a673ca9c6c85f36467720fa201a2caaa6038.tar.xz
UXP-8f72a673ca9c6c85f36467720fa201a2caaa6038.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.
Diffstat (limited to 'layout/base/nsCSSRendering.cpp')
-rw-r--r--layout/base/nsCSSRendering.cpp10
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: