summaryrefslogtreecommitdiff
path: root/Source/WebCore/rendering/RenderImage.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2012-05-11 09:43:24 +0200
committerSimon Hausmann <simon.hausmann@nokia.com>2012-05-11 09:43:24 +0200
commit1b914638db989aaa98631a1c1e02c7b2d44805d8 (patch)
tree87f4fd2c7b38db320079a5de8877890d2ca3c485 /Source/WebCore/rendering/RenderImage.cpp
parent2cf6c8816a73e0132bd8fa3b509d62d7c51b6e47 (diff)
downloadqtwebkit-1b914638db989aaa98631a1c1e02c7b2d44805d8.tar.gz
Imported WebKit commit 9a52e27980f47e8b0d8f8b7cc0fd7b5741bceb92 (http://svn.webkit.org/repository/webkit/trunk@116736)
New snapshot to include QDeclarative* -> QQml* build fixes
Diffstat (limited to 'Source/WebCore/rendering/RenderImage.cpp')
-rw-r--r--Source/WebCore/rendering/RenderImage.cpp46
1 files changed, 25 insertions, 21 deletions
diff --git a/Source/WebCore/rendering/RenderImage.cpp b/Source/WebCore/rendering/RenderImage.cpp
index 35caaff29..09d4e0d31 100644
--- a/Source/WebCore/rendering/RenderImage.cpp
+++ b/Source/WebCore/rendering/RenderImage.cpp
@@ -188,29 +188,33 @@ bool RenderImage::updateIntrinsicSizeIfNeeded(const IntSize& newSize, bool image
void RenderImage::imageDimensionsChanged(bool imageSizeChanged, const IntRect* rect)
{
- bool shouldRepaint = true;
- if (updateIntrinsicSizeIfNeeded(m_imageResource->imageSize(style()->effectiveZoom()), imageSizeChanged)) {
- // In the case of generated image content using :before/:after, we might not be in the
- // render tree yet. In that case, we don't need to worry about check for layout, since we'll get a
- // layout when we get added in to the render tree hierarchy later.
- if (containingBlock()) {
- // lets see if we need to relayout at all..
- int oldwidth = width();
- int oldheight = height();
- if (!preferredLogicalWidthsDirty())
- setPreferredLogicalWidthsDirty(true);
- computeLogicalWidth();
- computeLogicalHeight();
-
- if (imageSizeChanged || width() != oldwidth || height() != oldheight) {
- shouldRepaint = false;
- if (!selfNeedsLayout())
- setNeedsLayout(true);
- }
+ bool intrinsicSizeChanged = updateIntrinsicSizeIfNeeded(m_imageResource->imageSize(style()->effectiveZoom()), imageSizeChanged);
+
+ // In the case of generated image content using :before/:after/content, we might not be
+ // in the render tree yet. In that case, we just need to update our intrinsic size.
+ // layout() will be called after we are inserted in the tree which will take care of
+ // what we are doing here.
+ if (!containingBlock())
+ return;
- setWidth(oldwidth);
- setHeight(oldheight);
+ bool shouldRepaint = true;
+ if (intrinsicSizeChanged) {
+ // lets see if we need to relayout at all..
+ int oldwidth = width();
+ int oldheight = height();
+ if (!preferredLogicalWidthsDirty())
+ setPreferredLogicalWidthsDirty(true);
+ computeLogicalWidth();
+ computeLogicalHeight();
+
+ if (imageSizeChanged || width() != oldwidth || height() != oldheight) {
+ shouldRepaint = false;
+ if (!selfNeedsLayout())
+ setNeedsLayout(true);
}
+
+ setWidth(oldwidth);
+ setHeight(oldheight);
}
if (shouldRepaint) {