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

Side by Side Diff: Source/core/css/resolver/StyleBuilderCustom.cpp

Issue 112003003: [SVG] SVGLength{,List} migration to new SVG property impl. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebaselined Created 7 years 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 3 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
4 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) 4 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com)
5 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) 5 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com)
6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved. 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved.
7 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> 7 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
8 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> 8 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org>
9 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 9 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
10 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. 10 * Copyright (c) 2011, Code Aurora Forum. All rights reserved.
(...skipping 2094 matching lines...) Expand 10 before | Expand all | Expand 10 after
2105 case CSSPropertyStrokeDasharray: 2105 case CSSPropertyStrokeDasharray:
2106 { 2106 {
2107 HANDLE_SVG_INHERIT_AND_INITIAL(strokeDashArray, StrokeDashArray) 2107 HANDLE_SVG_INHERIT_AND_INITIAL(strokeDashArray, StrokeDashArray)
2108 if (!value->isValueList()) { 2108 if (!value->isValueList()) {
2109 state.style()->accessSVGStyle()->setStrokeDashArray(SVGRenderStyle:: initialStrokeDashArray()); 2109 state.style()->accessSVGStyle()->setStrokeDashArray(SVGRenderStyle:: initialStrokeDashArray());
2110 break; 2110 break;
2111 } 2111 }
2112 2112
2113 CSSValueList* dashes = toCSSValueList(value); 2113 CSSValueList* dashes = toCSSValueList(value);
2114 2114
2115 Vector<SVGLength> array; 2115 RefPtr<SVGLengthList> array = SVGLengthList::create();
2116 size_t length = dashes->length(); 2116 size_t length = dashes->length();
2117 for (size_t i = 0; i < length; ++i) { 2117 for (size_t i = 0; i < length; ++i) {
2118 CSSValue* currValue = dashes->itemWithoutBoundsCheck(i); 2118 CSSValue* currValue = dashes->itemWithoutBoundsCheck(i);
2119 if (!currValue->isPrimitiveValue()) 2119 if (!currValue->isPrimitiveValue())
2120 continue; 2120 continue;
2121 2121
2122 CSSPrimitiveValue* dash = toCSSPrimitiveValue(dashes->itemWithoutBou ndsCheck(i)); 2122 CSSPrimitiveValue* dash = toCSSPrimitiveValue(dashes->itemWithoutBou ndsCheck(i));
2123 array.append(SVGLength::fromCSSPrimitiveValue(dash)); 2123 array->append(SVGLength::fromCSSPrimitiveValue(dash));
2124 } 2124 }
2125 2125
2126 state.style()->accessSVGStyle()->setStrokeDashArray(array); 2126 state.style()->accessSVGStyle()->setStrokeDashArray(array.release());
2127 break; 2127 break;
2128 } 2128 }
2129 case CSSPropertyStopColor: 2129 case CSSPropertyStopColor:
2130 { 2130 {
2131 HANDLE_SVG_INHERIT_AND_INITIAL(stopColor, StopColor); 2131 HANDLE_SVG_INHERIT_AND_INITIAL(stopColor, StopColor);
2132 if (value->isSVGColor()) 2132 if (value->isSVGColor())
2133 state.style()->accessSVGStyle()->setStopColor(colorFromSVGColorCSSVa lue(toSVGColor(value), state.style()->color())); 2133 state.style()->accessSVGStyle()->setStopColor(colorFromSVGColorCSSVa lue(toSVGColor(value), state.style()->color()));
2134 break; 2134 break;
2135 } 2135 }
2136 case CSSPropertyLightingColor: 2136 case CSSPropertyLightingColor:
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
2174 break; 2174 break;
2175 } 2175 }
2176 case CSSPropertyEnableBackground: 2176 case CSSPropertyEnableBackground:
2177 // Silently ignoring this property for now 2177 // Silently ignoring this property for now
2178 // http://bugs.webkit.org/show_bug.cgi?id=6022 2178 // http://bugs.webkit.org/show_bug.cgi?id=6022
2179 break; 2179 break;
2180 } 2180 }
2181 } 2181 }
2182 2182
2183 } // namespace WebCore 2183 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698