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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutImage.cpp

Issue 1427943002: Wrap SVGImage for container during paint (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use IntSize for SVGImageForContainer Created 5 years, 1 month 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
Index: third_party/WebKit/Source/core/layout/LayoutImage.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutImage.cpp b/third_party/WebKit/Source/core/layout/LayoutImage.cpp
index 8e8ecfc4efdcdef3d600ced56feedc4b4b1c6769..7e0adfc64b0c1608a9619f976b3ae1a5f47a7970 100644
--- a/third_party/WebKit/Source/core/layout/LayoutImage.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutImage.cpp
@@ -137,19 +137,10 @@ void LayoutImage::updateIntrinsicSizeIfNeeded(const LayoutSize& newSize)
setIntrinsicSize(newSize);
}
-void LayoutImage::updateInnerContentRect()
-{
- // Propagate container size to the image resource.
- LayoutRect containerRect = replacedContentRect();
- IntSize containerSize(containerRect.width(), containerRect.height());
- if (!containerSize.isEmpty())
- m_imageResource->setContainerSizeForLayoutObject(containerSize);
-}
-
void LayoutImage::invalidatePaintAndMarkForLayoutIfNeeded()
{
LayoutSize oldIntrinsicSize = intrinsicSize();
- LayoutSize newIntrinsicSize = m_imageResource->intrinsicSize(style()->effectiveZoom());
+ LayoutSize newIntrinsicSize = m_imageResource->imageSize(style()->effectiveZoom());
updateIntrinsicSizeIfNeeded(newIntrinsicSize);
// In the case of generated image content using :before/:after/content, we might not be
@@ -176,15 +167,6 @@ void LayoutImage::invalidatePaintAndMarkForLayoutIfNeeded()
return;
}
- // The image hasn't changed in size or its style constrains its size, so a paint invalidation will suffice.
- 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 (imageResource() && imageResource()->maybeAnimated())
setShouldDoFullPaintInvalidation(PaintInvalidationDelayedFull);
else
@@ -300,12 +282,6 @@ bool LayoutImage::nodeAtPoint(HitTestResult& result, const HitTestLocation& loca
return inside;
}
-void LayoutImage::layout()
-{
- LayoutReplaced::layout();
- updateInnerContentRect();
-}
-
void LayoutImage::computeIntrinsicRatioInformation(FloatSize& intrinsicSize, double& intrinsicRatio) const
{
LayoutReplaced::computeIntrinsicRatioInformation(intrinsicSize, intrinsicRatio);
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutImage.h ('k') | third_party/WebKit/Source/core/layout/LayoutImageResource.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698