diff options
Diffstat (limited to 'Source/WebCore/rendering/RenderImage.cpp')
| -rw-r--r-- | Source/WebCore/rendering/RenderImage.cpp | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/Source/WebCore/rendering/RenderImage.cpp b/Source/WebCore/rendering/RenderImage.cpp index 404025f6e..e94fa3ebd 100644 --- a/Source/WebCore/rendering/RenderImage.cpp +++ b/Source/WebCore/rendering/RenderImage.cpp @@ -173,7 +173,7 @@ void RenderImage::imageChanged(WrappedImagePtr newImage, const IntRect* rect) // Set image dimensions, taking into account the size of the alt text. if (m_imageResource->errorOccurred()) { - if (!m_altText.isEmpty() && document()->isPendingStyleRecalc()) { + if (!m_altText.isEmpty() && document()->hasPendingStyleRecalc()) { ASSERT(node()); if (node()) { m_needsToSetSizeForAltText = true; @@ -219,22 +219,19 @@ void RenderImage::imageDimensionsChanged(bool imageSizeChanged, const IntRect* r bool shouldRepaint = true; if (intrinsicSizeChanged) { - // lets see if we need to relayout at all.. - LayoutUnit oldwidth = width(); - LayoutUnit oldheight = height(); if (!preferredLogicalWidthsDirty()) setPreferredLogicalWidthsDirty(true); - updateLogicalWidth(); - updateLogicalHeight(); + LogicalExtentComputedValues computedValues; + computeLogicalWidthInRegion(computedValues); + LayoutUnit newWidth = computedValues.m_extent; + computeLogicalHeight(height(), 0, computedValues); + LayoutUnit newHeight = computedValues.m_extent; - if (imageSizeChanged || width() != oldwidth || height() != oldheight) { + if (imageSizeChanged || width() != newWidth || height() != newHeight) { shouldRepaint = false; if (!selfNeedsLayout()) setNeedsLayout(true); } - - setWidth(oldwidth); - setHeight(oldheight); } if (shouldRepaint) { |
