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

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

Issue 983103003: Use Length for the stroke-width property in SVGLayoutStyle (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: lengthSetterForProperty Created 5 years, 9 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
« no previous file with comments | « Source/core/css/CSSProperties.in ('k') | Source/core/css/resolver/AnimatedStyleBuilder.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/LayoutStyleCSSValueMapping.cpp
diff --git a/Source/core/css/LayoutStyleCSSValueMapping.cpp b/Source/core/css/LayoutStyleCSSValueMapping.cpp
index a33156932f6c3e183d3e8143a2626baca6d2b4a8..4f3d85cb7b9e4a923b0cbb9316e474e95946f6b1 100644
--- a/Source/core/css/LayoutStyleCSSValueMapping.cpp
+++ b/Source/core/css/LayoutStyleCSSValueMapping.cpp
@@ -72,6 +72,14 @@ static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> zoomAdjustedPixelValueForLength
return cssValuePool().createValue(length, style);
}
+static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> pixelValueForUnzoomedLength(const UnzoomedLength& unzoomedLength, const LayoutStyle& style)
+{
+ const Length& length = unzoomedLength.length();
+ if (length.isFixed())
+ return cssValuePool().createValue(length.value(), CSSPrimitiveValue::CSS_PX);
+ return cssValuePool().createValue(length, style);
+}
+
static PassRefPtrWillBeRawPtr<CSSValueList> createPositionListForLayer(CSSPropertyID propertyID, const FillLayer& layer, const LayoutStyle& style)
{
RefPtrWillBeRawPtr<CSSValueList> positionList = CSSValueList::createSpaceSeparated();
@@ -2522,7 +2530,7 @@ PassRefPtrWillBeRawPtr<CSSValue> LayoutStyleCSSValueMapping::get(CSSPropertyID p
case CSSPropertyStrokeDashoffset:
return zoomAdjustedPixelValueForLength(svgStyle.strokeDashOffset(), style);
case CSSPropertyStrokeWidth:
- return SVGLength::toCSSPrimitiveValue(svgStyle.strokeWidth());
+ return pixelValueForUnzoomedLength(svgStyle.strokeWidth(), style);
case CSSPropertyBaselineShift: {
switch (svgStyle.baselineShift()) {
case BS_SUPER:
« no previous file with comments | « Source/core/css/CSSProperties.in ('k') | Source/core/css/resolver/AnimatedStyleBuilder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698