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

Unified Diff: third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp

Issue 1694263003: Add Image::updateConcreteSize() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@refactor-size-calculation-in
Patch Set: Pull test for now, needs changes in upcoming CL to pass. Address nits. 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/svg/graphics/SVGImage.cpp
diff --git a/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp b/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp
index b1141564d2424c0a8a97b91a158ab1d1b222863c..76fde922cbf101dade18414fcb163d962847520f 100644
--- a/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp
+++ b/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp
@@ -210,8 +210,8 @@ FloatSize SVGImage::calculateConcreteObjectSize(const FloatSize& defaultObjectSi
if (!intrinsicSizingInfo.aspectRatio.isEmpty()) {
// TODO(davve): According to the specification, the concrete object size should resolve as a
// contain constraint against the default object size at this stage. Until the
- // defaultObjectSize is context sensitive, right now it's hard-coded to 300x150, we have to
- // preserve legacy behavior by returning the aspectRatio as the concrete object size.
+ // defaultObjectSize is context sensitive - right now it's hard-coded to 300x150 - we have
+ // to preserve legacy behavior by returning the aspectRatio as the concrete object size.
return intrinsicSizingInfo.aspectRatio;
}
@@ -546,4 +546,9 @@ String SVGImage::filenameExtension() const
return "svg";
}
+void SVGImage::updateConcreteObjectSize(const LayoutSize& defaultObjectSize)
+{
+ m_concreteObjectSize = roundedIntSize(calculateConcreteObjectSize(FloatSize(defaultObjectSize)));
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698