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

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

Issue 1685353004: Clean up Image::computeIntrinsicDimensions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 90a7524683d22369ce3b6c8bc99df714f4db7f04..5957efb28346559e2ce63bb3743bfba45253d275 100644
--- a/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp
+++ b/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp
@@ -346,20 +346,19 @@ FrameView* SVGImage::frameView() const
return toLocalFrame(m_page->mainFrame())->view();
}
-void SVGImage::computeIntrinsicDimensions(Length& intrinsicWidth, Length& intrinsicHeight, FloatSize& intrinsicRatio)
+void SVGImage::computeIntrinsicDimensions(FloatSize& intrinsicSize, FloatSize& intrinsicRatio)
{
SVGSVGElement* rootElement = svgRootElement(m_page.get());
if (!rootElement)
return;
- intrinsicWidth = rootElement->intrinsicWidth();
- intrinsicHeight = rootElement->intrinsicHeight();
+ intrinsicSize = FloatSize(rootElement->intrinsicWidth(), rootElement->intrinsicHeight());
if (rootElement->preserveAspectRatio()->currentValue()->align() == SVGPreserveAspectRatio::SVG_PRESERVEASPECTRATIO_NONE)
return;
intrinsicRatio = rootElement->viewBox()->currentValue()->value().size();
- if (intrinsicRatio.isEmpty() && intrinsicWidth.isFixed() && intrinsicHeight.isFixed())
- intrinsicRatio = FloatSize(floatValueForLength(intrinsicWidth, 0), floatValueForLength(intrinsicHeight, 0));
+ if (intrinsicRatio.isEmpty())
+ intrinsicRatio = intrinsicSize;
}
// FIXME: support CatchUpAnimation = CatchUp.

Powered by Google App Engine
This is Rietveld 408576698