Index: Source/core/svg/SVGLengthContext.cpp |
diff --git a/Source/core/svg/SVGLengthContext.cpp b/Source/core/svg/SVGLengthContext.cpp |
index 3e2eb6f6393e3557a01b4cf57469743e5dde6d54..f1b5ffceebe4232d09b09d7adb8a71706b85bf90 100644 |
--- a/Source/core/svg/SVGLengthContext.cpp |
+++ b/Source/core/svg/SVGLengthContext.cpp |
@@ -96,8 +96,18 @@ float SVGLengthContext::resolveLength(const SVGElement* context, SVGUnitTypes::S |
return x.valueAsPercentage(); |
} |
+float SVGLengthContext::valueForLength(const UnzoomedLength& unzoomedLength, SVGLengthMode mode) const |
+{ |
+ return valueForLength(unzoomedLength.length(), 1, mode); |
+} |
+ |
float SVGLengthContext::valueForLength(const Length& length, const LayoutStyle& style, SVGLengthMode mode) const |
{ |
+ return valueForLength(length, style.effectiveZoom(), mode); |
+} |
+ |
+float SVGLengthContext::valueForLength(const Length& length, float zoom, SVGLengthMode mode) const |
+{ |
float dimension = 0; |
if (length.isPercent()) { |
FloatSize viewportSize; |
@@ -105,12 +115,16 @@ float SVGLengthContext::valueForLength(const Length& length, const LayoutStyle& |
// The viewport will be unaffected by zoom. |
dimension = dimensionForLengthMode(mode, viewportSize); |
} |
- return valueForLength(length, style, dimension); |
+ return valueForLength(length, zoom, dimension); |
} |
float SVGLengthContext::valueForLength(const Length& length, const LayoutStyle& style, float dimension) |
{ |
- const float zoom = style.effectiveZoom(); |
+ return valueForLength(length, style.effectiveZoom(), dimension); |
+} |
+ |
+float SVGLengthContext::valueForLength(const Length& length, float zoom, float dimension) |
+{ |
ASSERT(zoom != 0); |
return floatValueForLength(length, dimension * zoom) / zoom; |
} |