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

Unified Diff: Source/core/html/HTMLImageElement.cpp

Issue 923953002: Move rendering/RenderImage* to layout/LayoutImage* (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 10 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 | « Source/core/html/HTMLAreaElement.cpp ('k') | Source/core/html/HTMLImageFallbackHelper.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLImageElement.cpp
diff --git a/Source/core/html/HTMLImageElement.cpp b/Source/core/html/HTMLImageElement.cpp
index 16fe5aca5aa87ccf968fa705c048a46d75356c98..5c045c815544d54a7a18c540f86d014e2bcf372a 100644
--- a/Source/core/html/HTMLImageElement.cpp
+++ b/Source/core/html/HTMLImageElement.cpp
@@ -44,9 +44,9 @@
#include "core/html/parser/HTMLParserIdioms.h"
#include "core/html/parser/HTMLSrcsetParser.h"
#include "core/inspector/ConsoleMessage.h"
+#include "core/layout/LayoutImage.h"
#include "core/page/Page.h"
#include "core/rendering/RenderBlockFlow.h"
-#include "core/rendering/RenderImage.h"
#include "platform/ContentType.h"
#include "platform/EventDispatchForbiddenScope.h"
#include "platform/MIMETypeRegistry.h"
@@ -251,7 +251,7 @@ void HTMLImageElement::setBestFitURLAndDPRFromImageCandidate(const ImageCandidat
UseCounter::count(document(), UseCounter::SrcsetXDescriptor);
}
if (renderer() && renderer()->isImage())
- toRenderImage(renderer())->setImageDevicePixelRatio(m_imageDevicePixelRatio);
+ toLayoutImage(renderer())->setImageDevicePixelRatio(m_imageDevicePixelRatio);
}
void HTMLImageElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
@@ -341,8 +341,8 @@ LayoutObject* HTMLImageElement::createRenderer(const LayoutStyle& style)
if (m_useFallbackContent)
return new RenderBlockFlow(this);
- RenderImage* image = new RenderImage(this);
- image->setImageResource(RenderImageResource::create());
+ LayoutImage* image = new LayoutImage(this);
+ image->setImageResource(LayoutImageResource::create());
image->setImageDevicePixelRatio(m_imageDevicePixelRatio);
return image;
}
@@ -352,20 +352,20 @@ void HTMLImageElement::attach(const AttachContext& context)
HTMLElement::attach(context);
if (renderer() && renderer()->isImage()) {
- RenderImage* renderImage = toRenderImage(renderer());
- RenderImageResource* renderImageResource = renderImage->imageResource();
+ LayoutImage* layoutImage = toLayoutImage(renderer());
+ LayoutImageResource* layoutImageResource = layoutImage->imageResource();
if (m_isFallbackImage) {
- float deviceScaleFactor = blink::deviceScaleFactor(renderImage->frame());
+ float deviceScaleFactor = blink::deviceScaleFactor(layoutImage->frame());
pair<Image*, float> brokenImageAndImageScaleFactor = ImageResource::brokenImage(deviceScaleFactor);
ImageResource* newImageResource = new ImageResource(brokenImageAndImageScaleFactor.first);
- renderImage->imageResource()->setImageResource(newImageResource);
+ layoutImage->imageResource()->setImageResource(newImageResource);
}
- if (renderImageResource->hasImage())
+ if (layoutImageResource->hasImage())
return;
- if (!imageLoader().image() && !renderImageResource->cachedImage())
+ if (!imageLoader().image() && !layoutImageResource->cachedImage())
return;
- renderImageResource->setImageResource(imageLoader().image());
+ layoutImageResource->setImageResource(imageLoader().image());
}
}
@@ -630,8 +630,8 @@ FloatSize HTMLImageElement::defaultDestinationSize() const
return FloatSize();
LayoutSize size;
size = image->imageSizeForRenderer(renderer(), 1.0f);
- if (renderer() && renderer()->isRenderImage() && image->image() && !image->image()->hasRelativeWidth())
- size.scale(toRenderImage(renderer())->imageDevicePixelRatio());
+ if (renderer() && renderer()->isLayoutImage() && image->image() && !image->image()->hasRelativeWidth())
+ size.scale(toLayoutImage(renderer())->imageDevicePixelRatio());
return FloatSize(size);
}
« no previous file with comments | « Source/core/html/HTMLAreaElement.cpp ('k') | Source/core/html/HTMLImageFallbackHelper.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698