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

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

Issue 1468023002: Rename imageSizeForLayoutObject() to imageSize() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Bring back ps#3 and fix nit 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/html/HTMLImageElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLImageElement.cpp b/third_party/WebKit/Source/core/html/HTMLImageElement.cpp
index ae94760df80dc15558cfd47ca4327036312ba7e1..2596b9e0d6893f6f9ad411b7bae00ac2b6505a58 100644
--- a/third_party/WebKit/Source/core/html/HTMLImageElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLImageElement.cpp
@@ -427,7 +427,7 @@ int HTMLImageElement::width()
// if the image is available, use its width
if (imageLoader().image())
- return imageLoader().image()->imageSizeForLayoutObject(layoutObject(), 1.0f).width();
+ return imageLoader().image()->imageSize(LayoutObject::shouldRespectImageOrientation(nullptr), 1.0f).width();
}
LayoutBox* box = layoutBox();
@@ -448,7 +448,7 @@ int HTMLImageElement::height()
// if the image is available, use its height
if (imageLoader().image())
- return imageLoader().image()->imageSizeForLayoutObject(layoutObject(), 1.0f).height();
+ return imageLoader().image()->imageSize(LayoutObject::shouldRespectImageOrientation(nullptr), 1.0f).height();
}
LayoutBox* box = layoutBox();
@@ -460,7 +460,7 @@ int HTMLImageElement::naturalWidth() const
if (!imageLoader().image())
return 0;
- return imageLoader().image()->imageSizeForLayoutObject(layoutObject(), m_imageDevicePixelRatio, ImageResource::IntrinsicCorrectedToDPR).width();
+ return imageLoader().image()->imageSize(LayoutObject::shouldRespectImageOrientation(layoutObject()), m_imageDevicePixelRatio, ImageResource::IntrinsicCorrectedToDPR).width();
}
int HTMLImageElement::naturalHeight() const
@@ -468,7 +468,7 @@ int HTMLImageElement::naturalHeight() const
if (!imageLoader().image())
return 0;
- return imageLoader().image()->imageSizeForLayoutObject(layoutObject(), m_imageDevicePixelRatio, ImageResource::IntrinsicCorrectedToDPR).height();
+ return imageLoader().image()->imageSize(LayoutObject::shouldRespectImageOrientation(layoutObject()), m_imageDevicePixelRatio, ImageResource::IntrinsicCorrectedToDPR).height();
}
const String& HTMLImageElement::currentSrc() const
@@ -627,7 +627,7 @@ FloatSize HTMLImageElement::elementSize() const
if (!image)
return FloatSize();
- return FloatSize(image->imageSizeForLayoutObject(layoutObject(), 1.0f));
+ return FloatSize(image->imageSize(LayoutObject::shouldRespectImageOrientation(layoutObject()), 1.0f));
}
FloatSize HTMLImageElement::defaultDestinationSize() const
@@ -636,7 +636,7 @@ FloatSize HTMLImageElement::defaultDestinationSize() const
if (!image)
return FloatSize();
LayoutSize size;
- size = image->imageSizeForLayoutObject(layoutObject(), 1.0f);
+ size = image->imageSize(LayoutObject::shouldRespectImageOrientation(layoutObject()), 1.0f);
if (layoutObject() && layoutObject()->isLayoutImage() && image->image() && !image->image()->hasRelativeWidth())
size.scale(toLayoutImage(layoutObject())->imageDevicePixelRatio());
return FloatSize(size);
« no previous file with comments | « third_party/WebKit/Source/core/frame/LocalFrame.cpp ('k') | third_party/WebKit/Source/core/html/ImageDocument.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698