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

Unified Diff: Source/core/css/LayoutStyleCSSValueMapping.cpp

Issue 975733002: Use Length for the stroke-dasharray property in SVGLayoutStyle (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add test for style-change responsive-ness. Created 5 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: Source/core/css/LayoutStyleCSSValueMapping.cpp
diff --git a/Source/core/css/LayoutStyleCSSValueMapping.cpp b/Source/core/css/LayoutStyleCSSValueMapping.cpp
index 7ca1508d04eaa67fde8a22424daecc8893634e19..92c2fb061a1a5643753c77352ee119c3f2ac308f 100644
--- a/Source/core/css/LayoutStyleCSSValueMapping.cpp
+++ b/Source/core/css/LayoutStyleCSSValueMapping.cpp
@@ -1120,18 +1120,14 @@ static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> glyphOrientationToCSSPrimitiveV
}
}
-static PassRefPtrWillBeRawPtr<CSSValue> strokeDashArrayToCSSValueList(PassRefPtrWillBeRawPtr<SVGLengthList> passDashes)
+static PassRefPtrWillBeRawPtr<CSSValue> strokeDashArrayToCSSValueList(const SVGDashArray& dashes, const LayoutStyle& style)
{
- RefPtrWillBeRawPtr<SVGLengthList> dashes = passDashes;
-
- if (dashes->isEmpty())
+ if (dashes.isEmpty())
return CSSPrimitiveValue::createIdentifier(CSSValueNone);
RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparated();
- SVGLengthList::ConstIterator it = dashes->begin();
- SVGLengthList::ConstIterator itEnd = dashes->end();
- for (; it != itEnd; ++it)
- list->append(SVGLength::toCSSPrimitiveValue(*it));
+ for (const Length& dashLength : dashes.vector())
+ list->append(zoomAdjustedPixelValueForLength(dashLength, style));
return list.release();
}
@@ -2518,7 +2514,7 @@ PassRefPtrWillBeRawPtr<CSSValue> LayoutStyleCSSValueMapping::get(CSSPropertyID p
case CSSPropertyStroke:
return adjustSVGPaintForCurrentColor(svgStyle.strokePaintType(), svgStyle.strokePaintUri(), svgStyle.strokePaintColor(), style.color());
case CSSPropertyStrokeDasharray:
- return strokeDashArrayToCSSValueList(svgStyle.strokeDashArray());
+ return strokeDashArrayToCSSValueList(*svgStyle.strokeDashArray(), style);
case CSSPropertyStrokeDashoffset:
return zoomAdjustedPixelValueForLength(svgStyle.strokeDashOffset(), style);
case CSSPropertyStrokeWidth:

Powered by Google App Engine
This is Rietveld 408576698