Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(39)

Unified Diff: Source/core/rendering/RenderImage.cpp

Issue 23890043: Update image content rect on src changes even if intrinsic size matches (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/svg/as-image/resources/200x200-blue-rect.svg ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderImage.cpp
diff --git a/Source/core/rendering/RenderImage.cpp b/Source/core/rendering/RenderImage.cpp
index 8a2c63775e4dd2ad008ce5c12544385ffb0da329..a11e51c40bd43c3e32fa92b3783de7be51142349 100644
--- a/Source/core/rendering/RenderImage.cpp
+++ b/Source/core/rendering/RenderImage.cpp
@@ -199,9 +199,9 @@ bool RenderImage::updateIntrinsicSizeIfNeeded(const LayoutSize& newSize, bool im
void RenderImage::updateInnerContentRect()
{
- // Propagate container size to image resource.
- LayoutRect paintRect = replacedContentRect();
- IntSize containerSize(paintRect.width(), paintRect.height());
+ // Propagate container size to the image resource.
+ LayoutRect containerRect = replacedContentRect();
+ IntSize containerSize(containerRect.width(), containerRect.height());
if (!containerSize.isEmpty())
m_imageResource->setContainerSizeForRenderer(containerSize);
}
@@ -246,14 +246,14 @@ void RenderImage::imageDimensionsChanged(bool imageSizeChanged, const IntRect* r
if (!selfNeedsLayout())
setNeedsLayout();
}
+ }
- if (everHadLayout() && !selfNeedsLayout()) {
- // The inner content rectangle is calculated during layout, but may need an update now
- // (unless the box has already been scheduled for layout). In order to calculate it, we
- // may need values from the containing block, though, so make sure that we're not too
- // early. It may be that layout hasn't even taken place once yet.
- updateInnerContentRect();
- }
+ if (everHadLayout() && !selfNeedsLayout()) {
+ // The inner content rectangle is calculated during layout, but may need an update now
+ // (unless the box has already been scheduled for layout). In order to calculate it, we
+ // may need values from the containing block, though, so make sure that we're not too
+ // early. It may be that layout hasn't even taken place once yet.
+ updateInnerContentRect();
}
if (shouldRepaint) {
« no previous file with comments | « LayoutTests/svg/as-image/resources/200x200-blue-rect.svg ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698