| Index: Source/core/svg/SVGLengthContext.cpp
|
| diff --git a/Source/core/svg/SVGLengthContext.cpp b/Source/core/svg/SVGLengthContext.cpp
|
| index 13c8784f7473ca59b853d36378192259f97b00fa..018cd6db6ecc3e16970cf9a22a89b846741cfcce 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;
|
| }
|
|
|