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

Side by Side Diff: Source/core/css/SVGCSSComputedStyleDeclaration.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) 2007 Eric Seidel <eric@webkit.org> 2 Copyright (C) 2007 Eric Seidel <eric@webkit.org>
3 Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> 3 Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
4 4
5 This library is free software; you can redistribute it and/or 5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public 6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either 7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version. 8 version 2 of the License, or (at your option) any later version.
9 9
10 This library is distributed in the hope that it will be useful, 10 This library is distributed in the hope that it will be useful,
(...skipping 28 matching lines...) Expand all
39 return CSSPrimitiveValue::create(90.0f, CSSPrimitiveValue::CSS_DEG); 39 return CSSPrimitiveValue::create(90.0f, CSSPrimitiveValue::CSS_DEG);
40 case GO_180DEG: 40 case GO_180DEG:
41 return CSSPrimitiveValue::create(180.0f, CSSPrimitiveValue::CSS_DEG) ; 41 return CSSPrimitiveValue::create(180.0f, CSSPrimitiveValue::CSS_DEG) ;
42 case GO_270DEG: 42 case GO_270DEG:
43 return CSSPrimitiveValue::create(270.0f, CSSPrimitiveValue::CSS_DEG) ; 43 return CSSPrimitiveValue::create(270.0f, CSSPrimitiveValue::CSS_DEG) ;
44 default: 44 default:
45 return 0; 45 return 0;
46 } 46 }
47 } 47 }
48 48
49 static PassRefPtr<CSSValue> strokeDashArrayToCSSValueList(const Vector<SVGLength >& dashes) 49 static PassRefPtr<CSSValue> strokeDashArrayToCSSValueList(PassRefPtr<SVGLengthLi st> passDashes)
50 { 50 {
51 if (dashes.isEmpty()) 51 RefPtr<SVGLengthList> dashes = passDashes;
52
53 if (dashes->isEmpty())
52 return CSSPrimitiveValue::createIdentifier(CSSValueNone); 54 return CSSPrimitiveValue::createIdentifier(CSSValueNone);
53 55
54 RefPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); 56 RefPtr<CSSValueList> list = CSSValueList::createCommaSeparated();
55 const Vector<SVGLength>::const_iterator end = dashes.end(); 57 size_t length = dashes->numberOfItems();
56 for (Vector<SVGLength>::const_iterator it = dashes.begin(); it != end; ++it) 58 for (size_t i = 0; i < length; ++i)
57 list->append(SVGLength::toCSSPrimitiveValue(*it)); 59 list->append(SVGLength::toCSSPrimitiveValue(dashes->at(i)));
58 60
59 return list.release(); 61 return list.release();
60 } 62 }
61 63
62 static PassRefPtr<CSSValue> paintOrderToCSSValueList(EPaintOrder paintorder) 64 static PassRefPtr<CSSValue> paintOrderToCSSValueList(EPaintOrder paintorder)
63 { 65 {
64 RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); 66 RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
65 do { 67 do {
66 EPaintOrderType paintOrderType = (EPaintOrderType)(paintorder & ((1 << k PaintOrderBitwidth) - 1)); 68 EPaintOrderType paintOrderType = (EPaintOrderType)(paintorder & ((1 << k PaintOrderBitwidth) - 1));
67 switch (paintOrderType) { 69 switch (paintOrderType) {
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 default: 226 default:
225 // If you crash here, it's because you added a css property and are not handling it 227 // If you crash here, it's because you added a css property and are not handling it
226 // in either this switch statement or the one in CSSComputedStyleDelcara tion::getPropertyCSSValue 228 // in either this switch statement or the one in CSSComputedStyleDelcara tion::getPropertyCSSValue
227 ASSERT_WITH_MESSAGE(0, "unimplemented propertyID: %d", propertyID); 229 ASSERT_WITH_MESSAGE(0, "unimplemented propertyID: %d", propertyID);
228 } 230 }
229 WTF_LOG_ERROR("unimplemented propertyID: %d", propertyID); 231 WTF_LOG_ERROR("unimplemented propertyID: %d", propertyID);
230 return 0; 232 return 0;
231 } 233 }
232 234
233 } 235 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698