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

Unified Diff: third_party/WebKit/Source/core/layout/svg/LayoutSVGRoot.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/layout/svg/LayoutSVGRoot.cpp
diff --git a/third_party/WebKit/Source/core/layout/svg/LayoutSVGRoot.cpp b/third_party/WebKit/Source/core/layout/svg/LayoutSVGRoot.cpp
index 6a16ef6e0c526312cb58eb02bede00019b3fea8b..00f9cd2947c2d7acf6f7be30da72749a396759be 100644
--- a/third_party/WebKit/Source/core/layout/svg/LayoutSVGRoot.cpp
+++ b/third_party/WebKit/Source/core/layout/svg/LayoutSVGRoot.cpp
@@ -39,15 +39,6 @@
namespace blink {
-namespace {
-
-FloatSize calculateIntrinsicSize(const SVGSVGElement& svg)
-{
- return FloatSize(floatValueForLength(svg.intrinsicWidth(), 0), floatValueForLength(svg.intrinsicHeight(), 0));
-}
-
-} // namespace
-
LayoutSVGRoot::LayoutSVGRoot(SVGElement* node)
: LayoutReplaced(node)
, m_objectBoundingBoxValid(false)
@@ -60,7 +51,7 @@ LayoutSVGRoot::LayoutSVGRoot(SVGElement* node)
SVGSVGElement* svg = toSVGSVGElement(node);
ASSERT(svg);
- LayoutSize intrinsicSize(calculateIntrinsicSize(*svg));
+ LayoutSize intrinsicSize(svg->intrinsicWidth(), svg->intrinsicHeight());
if (!svg->hasIntrinsicWidth())
intrinsicSize.setWidth(LayoutUnit(defaultWidth));
if (!svg->hasIntrinsicHeight())
@@ -79,7 +70,7 @@ void LayoutSVGRoot::computeIntrinsicSizingInfo(IntrinsicSizingInfo& intrinsicSiz
SVGSVGElement* svg = toSVGSVGElement(node());
ASSERT(svg);
- intrinsicSizingInfo.size = calculateIntrinsicSize(*svg);
+ intrinsicSizingInfo.size = FloatSize(svg->intrinsicWidth(), svg->intrinsicHeight());
intrinsicSizingInfo.hasWidth = svg->hasIntrinsicWidth();
intrinsicSizingInfo.hasHeight = svg->hasIntrinsicHeight();

Powered by Google App Engine
This is Rietveld 408576698