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

Side by Side Diff: Source/core/css/SVGCSSComputedStyleDeclaration.cpp

Issue 20061003: Move isValid/isCurrentColor from Color to StyleColor (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 5 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 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 const Vector<SVGLength>::const_iterator end = dashes.end(); 55 const Vector<SVGLength>::const_iterator end = dashes.end();
56 for (Vector<SVGLength>::const_iterator it = dashes.begin(); it != end; ++it) 56 for (Vector<SVGLength>::const_iterator it = dashes.begin(); it != end; ++it)
57 list->append(SVGLength::toCSSPrimitiveValue(*it)); 57 list->append(SVGLength::toCSSPrimitiveValue(*it));
58 58
59 return list.release(); 59 return list.release();
60 } 60 }
61 61
62 PassRefPtr<SVGPaint> CSSComputedStyleDeclaration::adjustSVGPaintForCurrentColor( PassRefPtr<SVGPaint> newPaint, RenderStyle* style) const 62 PassRefPtr<SVGPaint> CSSComputedStyleDeclaration::adjustSVGPaintForCurrentColor( PassRefPtr<SVGPaint> newPaint, RenderStyle* style) const
63 { 63 {
64 RefPtr<SVGPaint> paint = newPaint; 64 RefPtr<SVGPaint> paint = newPaint;
65 if (paint->paintType() == SVGPaint::SVG_PAINTTYPE_CURRENTCOLOR || paint->pai ntType() == SVGPaint::SVG_PAINTTYPE_URI_CURRENTCOLOR) 65 if (paint->paintType() == SVGPaint::SVG_PAINTTYPE_CURRENTCOLOR || paint->pai ntType() == SVGPaint::SVG_PAINTTYPE_URI_CURRENTCOLOR) {
66 paint->setColor(style->color()); 66 // SVG handles currentColor itself, style->color() is guaranteed not to be currentColor.
67 ASSERT(!style->color().isCurrentColor());
68 paint->setColor(style->color().color());
69 }
67 return paint.release(); 70 return paint.release();
68 } 71 }
69 72
70 PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getSVGPropertyCSSValue(CSSProp ertyID propertyID, EUpdateLayout updateLayout) const 73 PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getSVGPropertyCSSValue(CSSProp ertyID propertyID, EUpdateLayout updateLayout) const
71 { 74 {
72 Node* node = m_node.get(); 75 Node* node = m_node.get();
73 if (!node) 76 if (!node)
74 return 0; 77 return 0;
75 78
76 // Make sure our layout is up to date before we allow a query on these attri butes. 79 // Make sure our layout is up to date before we allow a query on these attri butes.
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 case CSSPropertyGlyphOrientationVertical: { 186 case CSSPropertyGlyphOrientationVertical: {
184 if (RefPtr<CSSPrimitiveValue> value = glyphOrientationToCSSPrimitive Value(svgStyle->glyphOrientationVertical())) 187 if (RefPtr<CSSPrimitiveValue> value = glyphOrientationToCSSPrimitive Value(svgStyle->glyphOrientationVertical()))
185 return value.release(); 188 return value.release();
186 189
187 if (svgStyle->glyphOrientationVertical() == GO_AUTO) 190 if (svgStyle->glyphOrientationVertical() == GO_AUTO)
188 return CSSPrimitiveValue::createIdentifier(CSSValueAuto); 191 return CSSPrimitiveValue::createIdentifier(CSSValueAuto);
189 192
190 return 0; 193 return 0;
191 } 194 }
192 case CSSPropertyWebkitSvgShadow: 195 case CSSPropertyWebkitSvgShadow:
193 return valueForShadow(svgStyle->shadow(), propertyID, style); 196 return valueForShadow(node->renderer(), svgStyle->shadow(), property ID, style);
194 case CSSPropertyVectorEffect: 197 case CSSPropertyVectorEffect:
195 return CSSPrimitiveValue::create(svgStyle->vectorEffect()); 198 return CSSPrimitiveValue::create(svgStyle->vectorEffect());
196 case CSSPropertyMaskType: 199 case CSSPropertyMaskType:
197 return CSSPrimitiveValue::create(svgStyle->maskType()); 200 return CSSPrimitiveValue::create(svgStyle->maskType());
198 case CSSPropertyMarker: 201 case CSSPropertyMarker:
199 case CSSPropertyEnableBackground: 202 case CSSPropertyEnableBackground:
200 case CSSPropertyColorProfile: 203 case CSSPropertyColorProfile:
201 // the above properties are not yet implemented in the engine 204 // the above properties are not yet implemented in the engine
202 break; 205 break;
203 default: 206 default:
204 // If you crash here, it's because you added a css property and are not handling it 207 // If you crash here, it's because you added a css property and are not handling it
205 // in either this switch statement or the one in CSSComputedStyleDelcara tion::getPropertyCSSValue 208 // in either this switch statement or the one in CSSComputedStyleDelcara tion::getPropertyCSSValue
206 ASSERT_WITH_MESSAGE(0, "unimplemented propertyID: %d", propertyID); 209 ASSERT_WITH_MESSAGE(0, "unimplemented propertyID: %d", propertyID);
207 } 210 }
208 LOG_ERROR("unimplemented propertyID: %d", propertyID); 211 LOG_ERROR("unimplemented propertyID: %d", propertyID);
209 return 0; 212 return 0;
210 } 213 }
211 214
212 } 215 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698