Index: third_party/WebKit/Source/core/style/StyleGeneratedImage.cpp |
diff --git a/third_party/WebKit/Source/core/style/StyleGeneratedImage.cpp b/third_party/WebKit/Source/core/style/StyleGeneratedImage.cpp |
index 68aaf42452030ce5042bf12836c825ba598c0c92..86d9d35772c7d2ea510a59371a9cb64b0f8ff9da 100644 |
--- a/third_party/WebKit/Source/core/style/StyleGeneratedImage.cpp |
+++ b/third_party/WebKit/Source/core/style/StyleGeneratedImage.cpp |
@@ -46,27 +46,33 @@ PassRefPtrWillBeRawPtr<CSSValue> StyleGeneratedImage::computedCSSValue() const |
return m_imageGeneratorValue->valueWithURLsMadeAbsolute(); |
} |
+void StyleGeneratedImage::updateConcreteObjectSize(const LayoutSize& defaultObjectSize) |
+{ |
+ if (!m_fixedSize) |
+ m_defaultObjectSize = defaultObjectSize; |
+} |
+ |
LayoutSize StyleGeneratedImage::imageSize(const LayoutObject* layoutObject, float multiplier) const |
{ |
- if (m_fixedSize) { |
- LayoutSize fixedSize(m_imageGeneratorValue->fixedSize(layoutObject)); |
- if (multiplier == 1.0f) |
- return fixedSize; |
+ if (!m_fixedSize) |
+ return m_defaultObjectSize; |
- LayoutUnit width(fixedSize.width() * multiplier); |
- LayoutUnit height(fixedSize.height() * multiplier); |
+ ASSERT(m_defaultObjectSize.isEmpty()); |
+ LayoutSize fixedSize(m_imageGeneratorValue->fixedSize(layoutObject)); |
+ if (multiplier == 1.0f) |
+ return fixedSize; |
- // Don't let images that have a width/height >= 1 shrink below 1 when zoomed. |
- if (fixedSize.width() > LayoutUnit()) |
- width = max(LayoutUnit(1), width); |
+ LayoutUnit width(fixedSize.width() * multiplier); |
+ LayoutUnit height(fixedSize.height() * multiplier); |
- if (fixedSize.height() > LayoutUnit()) |
- height = max(LayoutUnit(1), height); |
+ // Don't let images that have a width/height >= 1 shrink below 1 when zoomed. |
+ if (fixedSize.width() > LayoutUnit()) |
+ width = max(LayoutUnit(1), width); |
- return LayoutSize(width, height); |
- } |
+ if (fixedSize.height() > LayoutUnit()) |
+ height = max(LayoutUnit(1), height); |
- return LayoutSize(); |
+ return LayoutSize(width, height); |
} |
void StyleGeneratedImage::computeIntrinsicDimensions(const LayoutObject* layoutObject, FloatSize& intrinsicSize, FloatSize& intrinsicRatio) |