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

Unified Diff: third_party/WebKit/Source/core/fetch/ImageResource.cpp

Issue 1634133003: Condense Image::hasRelative{Width,Height}() into one (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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
Index: third_party/WebKit/Source/core/fetch/ImageResource.cpp
diff --git a/third_party/WebKit/Source/core/fetch/ImageResource.cpp b/third_party/WebKit/Source/core/fetch/ImageResource.cpp
index c4719eebb6ae4fac2d735304a0b072dd5148d392..c7851237e61ce149a67e32797efea295bf8265f4 100644
--- a/third_party/WebKit/Source/core/fetch/ImageResource.cpp
+++ b/third_party/WebKit/Source/core/fetch/ImageResource.cpp
@@ -197,18 +197,10 @@ bool ImageResource::usesImageContainerSize() const
return false;
}
-bool ImageResource::imageHasRelativeWidth() const
+bool ImageResource::imageHasRelativeSize() const
{
if (m_image)
- return m_image->hasRelativeWidth();
-
- return false;
-}
-
-bool ImageResource::imageHasRelativeHeight() const
-{
- if (m_image)
- return m_image->hasRelativeHeight();
+ return m_image->hasRelativeSize();
return false;
}
@@ -234,8 +226,8 @@ LayoutSize ImageResource::imageSize(RespectImageOrientationEnum shouldRespectIma
return size;
// Don't let images that have a width/height >= 1 shrink below 1 when zoomed.
- float widthScale = m_image->hasRelativeWidth() ? 1.0f : multiplier;
- float heightScale = m_image->hasRelativeHeight() ? 1.0f : multiplier;
+ float widthScale = m_image->hasRelativeSize() ? 1.0f : multiplier;
+ float heightScale = m_image->hasRelativeSize() ? 1.0f : multiplier;
LayoutSize minimumSize(size.width() > 0 ? 1 : 0, size.height() > 0 ? 1 : 0);
size.scale(widthScale, heightScale);
size.clampToMinimumSize(minimumSize);
« no previous file with comments | « third_party/WebKit/Source/core/fetch/ImageResource.h ('k') | third_party/WebKit/Source/core/html/HTMLImageElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698