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

Unified Diff: third_party/WebKit/Source/core/svg/SVGSVGElement.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/SVGSVGElement.cpp
diff --git a/third_party/WebKit/Source/core/svg/SVGSVGElement.cpp b/third_party/WebKit/Source/core/svg/SVGSVGElement.cpp
index fc3a9d3eb6083fd04562253ea4a45421fa888ca0..19a0d1027b5d656af232607ffdecf9abecd5d36a 100644
--- a/third_party/WebKit/Source/core/svg/SVGSVGElement.cpp
+++ b/third_party/WebKit/Source/core/svg/SVGSVGElement.cpp
@@ -609,7 +609,7 @@ FloatRect SVGSVGElement::currentViewBoxRect() const
// If no viewBox is specified but non-relative width/height values, then we
// should always synthesize a viewBox if we're embedded through a SVGImage.
- return FloatRect(FloatPoint(), FloatSize(floatValueForLength(intrinsicWidth(), 0), floatValueForLength(intrinsicHeight(), 0)));
+ return FloatRect(FloatPoint(), FloatSize(intrinsicWidth(), intrinsicHeight()));
}
FloatSize SVGSVGElement::currentViewportSize() const
@@ -636,22 +636,22 @@ bool SVGSVGElement::hasIntrinsicHeight() const
return height()->currentValue()->typeWithCalcResolved() != CSSPrimitiveValue::UnitType::Percentage;
}
-Length SVGSVGElement::intrinsicWidth() const
+float SVGSVGElement::intrinsicWidth() const
{
if (width()->currentValue()->typeWithCalcResolved() == CSSPrimitiveValue::UnitType::Percentage)
- return Length(0, Fixed);
+ return 0;
SVGLengthContext lengthContext(this);
- return Length(width()->currentValue()->value(lengthContext), Fixed);
+ return width()->currentValue()->value(lengthContext);
}
-Length SVGSVGElement::intrinsicHeight() const
+float SVGSVGElement::intrinsicHeight() const
{
if (height()->currentValue()->typeWithCalcResolved() == CSSPrimitiveValue::UnitType::Percentage)
- return Length(0, Fixed);
+ return 0;
SVGLengthContext lengthContext(this);
- return Length(height()->currentValue()->value(lengthContext), Fixed);
+ return height()->currentValue()->value(lengthContext);
}
AffineTransform SVGSVGElement::viewBoxToViewTransform(float viewWidth, float viewHeight) const
« no previous file with comments | « third_party/WebKit/Source/core/svg/SVGSVGElement.h ('k') | third_party/WebKit/Source/core/svg/graphics/SVGImage.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698