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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutImageResourceStyleImage.h

Issue 1756763004: Merge image sizing algorithms (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Extend test to cover svg and non-svg case Created 4 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
Index: third_party/WebKit/Source/core/layout/LayoutImageResourceStyleImage.h
diff --git a/third_party/WebKit/Source/core/layout/LayoutImageResourceStyleImage.h b/third_party/WebKit/Source/core/layout/LayoutImageResourceStyleImage.h
index 284bb9322ff631adc0ae5ca846a779a588ce89a5..2eefa4633a77239a9d359fe3b05b836591e10b55 100644
--- a/third_party/WebKit/Source/core/layout/LayoutImageResourceStyleImage.h
+++ b/third_party/WebKit/Source/core/layout/LayoutImageResourceStyleImage.h
@@ -51,7 +51,13 @@ public:
bool imageHasRelativeSize() const override { return m_styleImage->imageHasRelativeSize(); }
- LayoutSize imageSize(float multiplier) const override { return m_styleImage->imageSize(m_layoutObject, multiplier); }
+ LayoutSize imageSize(float multiplier) const override
+ {
+ // TODO(davve): Find out the default object size, if any, in this context.
+ LayoutSize scaledImageSize = m_styleImage->imageSize(m_layoutObject, multiplier, LayoutSize());
+ scaledImageSize.scale(1 / m_styleImage->imageScaleFactor());
fs 2016/03/03 15:22:53 Won't this double-scale if m_styleImage is an imag
fs 2016/03/03 15:24:43 Ah, no, that code was no longer. You can disregard
+ return scaledImageSize;
+ }
WrappedImagePtr imagePtr() const override { return m_styleImage->data(); }

Powered by Google App Engine
This is Rietveld 408576698