webengine/osswebengine/WebCore/rendering/RenderBox.cpp
branchRCL_3
changeset 95 d96eed154187
parent 94 919f36ff910f
--- a/webengine/osswebengine/WebCore/rendering/RenderBox.cpp	Wed Sep 01 12:28:30 2010 +0100
+++ b/webengine/osswebengine/WebCore/rendering/RenderBox.cpp	Tue Sep 14 23:23:58 2010 +0300
@@ -1456,9 +1456,11 @@
             if (!style()->htmlHacks() && cb->style()->height().isAuto() && !isPositioned() && !cb->isRenderView() && !cb->isTableCell()) {
                 IntSize size = intrinsicSize();
                 // Try to keep aspect ratio.
-                int h = size.width() ? calcReplacedWidth() * size.height() / size.width() : size.height();
+                int h = size.height();
+                if (size.width() && (style()->width().isFixed() || style()->width().isPercent()))
+                    h = calcReplacedWidth() * size.height() / size.width();
                 if (h > 0)
-                    return calcContentBoxHeight(h);
+                return calcContentBoxHeight(h);
             }
 
             int availableHeight = isPositioned() ? containingBlockHeightForPositioned(cb) : cb->availableHeight();