Index: third_party/WebKit/Source/core/layout/svg/SVGLayoutSupport.cpp |
diff --git a/third_party/WebKit/Source/core/layout/svg/SVGLayoutSupport.cpp b/third_party/WebKit/Source/core/layout/svg/SVGLayoutSupport.cpp |
index 51f3e979d94c282abea135b758f13e1e66e1813a..59ea565b1101fbca4451f940cda413a70e1f2c12 100644 |
--- a/third_party/WebKit/Source/core/layout/svg/SVGLayoutSupport.cpp |
+++ b/third_party/WebKit/Source/core/layout/svg/SVGLayoutSupport.cpp |
@@ -372,7 +372,7 @@ DashArray SVGLayoutSupport::resolveSVGDashArray(const SVGDashArray& svgDashArray |
return dashArray; |
} |
-void SVGLayoutSupport::applyStrokeStyleToStrokeData(StrokeData& strokeData, const ComputedStyle& style, const LayoutObject& object) |
+void SVGLayoutSupport::applyStrokeStyleToStrokeData(StrokeData& strokeData, const ComputedStyle& style, const LayoutObject& object, float dashScaleFactor) |
{ |
ASSERT(object.node()); |
ASSERT(object.node()->isSVGElement()); |
@@ -386,7 +386,15 @@ void SVGLayoutSupport::applyStrokeStyleToStrokeData(StrokeData& strokeData, cons |
strokeData.setMiterLimit(svgStyle.strokeMiterLimit()); |
DashArray dashArray = resolveSVGDashArray(*svgStyle.strokeDashArray(), style, lengthContext); |
- strokeData.setLineDash(dashArray, lengthContext.valueForLength(svgStyle.strokeDashOffset(), style)); |
+ float dashOffset = lengthContext.valueForLength(svgStyle.strokeDashOffset(), style); |
+ // Apply scaling from 'pathLength'. |
+ if (dashScaleFactor != 1) { |
+ ASSERT(dashScaleFactor >= 0); |
+ dashOffset *= dashScaleFactor; |
+ for (auto& dashItem : dashArray) |
+ dashItem *= dashScaleFactor; |
+ } |
+ strokeData.setLineDash(dashArray, dashOffset); |
} |
bool SVGLayoutSupport::isLayoutableTextNode(const LayoutObject* object) |