| OLD | NEW |
| 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 24 matching lines...) Expand all Loading... |
| 35 switch (orientation) { | 35 switch (orientation) { |
| 36 case GO_0DEG: | 36 case GO_0DEG: |
| 37 return CSSPrimitiveValue::create(0.0f, CSSPrimitiveValue::CSS_DEG); | 37 return CSSPrimitiveValue::create(0.0f, CSSPrimitiveValue::CSS_DEG); |
| 38 case GO_90DEG: | 38 case GO_90DEG: |
| 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 nullptr; |
| 46 } | 46 } |
| 47 } | 47 } |
| 48 | 48 |
| 49 static PassRefPtrWillBeRawPtr<CSSValue> strokeDashArrayToCSSValueList(PassRefPtr
<SVGLengthList> passDashes) | 49 static PassRefPtrWillBeRawPtr<CSSValue> strokeDashArrayToCSSValueList(PassRefPtr
<SVGLengthList> passDashes) |
| 50 { | 50 { |
| 51 RefPtr<SVGLengthList> dashes = passDashes; | 51 RefPtr<SVGLengthList> dashes = passDashes; |
| 52 | 52 |
| 53 if (dashes->isEmpty()) | 53 if (dashes->isEmpty()) |
| 54 return CSSPrimitiveValue::createIdentifier(CSSValueNone); | 54 return CSSPrimitiveValue::createIdentifier(CSSValueNone); |
| 55 | 55 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 RefPtrWillBeRawPtr<SVGPaint> paint = newPaint; | 88 RefPtrWillBeRawPtr<SVGPaint> paint = newPaint; |
| 89 if (paint->paintType() == SVGPaint::SVG_PAINTTYPE_CURRENTCOLOR || paint->pai
ntType() == SVGPaint::SVG_PAINTTYPE_URI_CURRENTCOLOR) | 89 if (paint->paintType() == SVGPaint::SVG_PAINTTYPE_CURRENTCOLOR || paint->pai
ntType() == SVGPaint::SVG_PAINTTYPE_URI_CURRENTCOLOR) |
| 90 paint->setColor(style.color()); | 90 paint->setColor(style.color()); |
| 91 return paint.release(); | 91 return paint.release(); |
| 92 } | 92 } |
| 93 | 93 |
| 94 PassRefPtrWillBeRawPtr<CSSValue> CSSComputedStyleDeclaration::getSVGPropertyCSSV
alue(CSSPropertyID propertyID, EUpdateLayout updateLayout) const | 94 PassRefPtrWillBeRawPtr<CSSValue> CSSComputedStyleDeclaration::getSVGPropertyCSSV
alue(CSSPropertyID propertyID, EUpdateLayout updateLayout) const |
| 95 { | 95 { |
| 96 Node* node = m_node.get(); | 96 Node* node = m_node.get(); |
| 97 if (!node) | 97 if (!node) |
| 98 return 0; | 98 return nullptr; |
| 99 | 99 |
| 100 // Make sure our layout is up to date before we allow a query on these attri
butes. | 100 // Make sure our layout is up to date before we allow a query on these attri
butes. |
| 101 if (updateLayout) | 101 if (updateLayout) |
| 102 node->document().updateLayout(); | 102 node->document().updateLayout(); |
| 103 | 103 |
| 104 RenderStyle* style = node->computedStyle(); | 104 RenderStyle* style = node->computedStyle(); |
| 105 if (!style) | 105 if (!style) |
| 106 return 0; | 106 return nullptr; |
| 107 | 107 |
| 108 const SVGRenderStyle* svgStyle = style->svgStyle(); | 108 const SVGRenderStyle* svgStyle = style->svgStyle(); |
| 109 if (!svgStyle) | 109 if (!svgStyle) |
| 110 return 0; | 110 return nullptr; |
| 111 | 111 |
| 112 switch (propertyID) { | 112 switch (propertyID) { |
| 113 case CSSPropertyClipRule: | 113 case CSSPropertyClipRule: |
| 114 return CSSPrimitiveValue::create(svgStyle->clipRule()); | 114 return CSSPrimitiveValue::create(svgStyle->clipRule()); |
| 115 case CSSPropertyFloodOpacity: | 115 case CSSPropertyFloodOpacity: |
| 116 return CSSPrimitiveValue::create(svgStyle->floodOpacity(), CSSPrimit
iveValue::CSS_NUMBER); | 116 return CSSPrimitiveValue::create(svgStyle->floodOpacity(), CSSPrimit
iveValue::CSS_NUMBER); |
| 117 case CSSPropertyStopOpacity: | 117 case CSSPropertyStopOpacity: |
| 118 return CSSPrimitiveValue::create(svgStyle->stopOpacity(), CSSPrimiti
veValue::CSS_NUMBER); | 118 return CSSPrimitiveValue::create(svgStyle->stopOpacity(), CSSPrimiti
veValue::CSS_NUMBER); |
| 119 case CSSPropertyColorInterpolation: | 119 case CSSPropertyColorInterpolation: |
| 120 return CSSPrimitiveValue::create(svgStyle->colorInterpolation()); | 120 return CSSPrimitiveValue::create(svgStyle->colorInterpolation()); |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 case BS_BASELINE: | 191 case BS_BASELINE: |
| 192 return CSSPrimitiveValue::createIdentifier(CSSValueBaseline)
; | 192 return CSSPrimitiveValue::createIdentifier(CSSValueBaseline)
; |
| 193 case BS_SUPER: | 193 case BS_SUPER: |
| 194 return CSSPrimitiveValue::createIdentifier(CSSValueSuper); | 194 return CSSPrimitiveValue::createIdentifier(CSSValueSuper); |
| 195 case BS_SUB: | 195 case BS_SUB: |
| 196 return CSSPrimitiveValue::createIdentifier(CSSValueSub); | 196 return CSSPrimitiveValue::createIdentifier(CSSValueSub); |
| 197 case BS_LENGTH: | 197 case BS_LENGTH: |
| 198 return SVGLength::toCSSPrimitiveValue(svgStyle->baselineShif
tValue()); | 198 return SVGLength::toCSSPrimitiveValue(svgStyle->baselineShif
tValue()); |
| 199 } | 199 } |
| 200 ASSERT_NOT_REACHED(); | 200 ASSERT_NOT_REACHED(); |
| 201 return 0; | 201 return nullptr; |
| 202 } | 202 } |
| 203 case CSSPropertyBufferedRendering: | 203 case CSSPropertyBufferedRendering: |
| 204 return CSSPrimitiveValue::create(svgStyle->bufferedRendering()); | 204 return CSSPrimitiveValue::create(svgStyle->bufferedRendering()); |
| 205 case CSSPropertyGlyphOrientationHorizontal: | 205 case CSSPropertyGlyphOrientationHorizontal: |
| 206 return glyphOrientationToCSSPrimitiveValue(svgStyle->glyphOrientatio
nHorizontal()); | 206 return glyphOrientationToCSSPrimitiveValue(svgStyle->glyphOrientatio
nHorizontal()); |
| 207 case CSSPropertyGlyphOrientationVertical: { | 207 case CSSPropertyGlyphOrientationVertical: { |
| 208 if (RefPtrWillBeRawPtr<CSSPrimitiveValue> value = glyphOrientationTo
CSSPrimitiveValue(svgStyle->glyphOrientationVertical())) | 208 if (RefPtrWillBeRawPtr<CSSPrimitiveValue> value = glyphOrientationTo
CSSPrimitiveValue(svgStyle->glyphOrientationVertical())) |
| 209 return value.release(); | 209 return value.release(); |
| 210 | 210 |
| 211 if (svgStyle->glyphOrientationVertical() == GO_AUTO) | 211 if (svgStyle->glyphOrientationVertical() == GO_AUTO) |
| 212 return CSSPrimitiveValue::createIdentifier(CSSValueAuto); | 212 return CSSPrimitiveValue::createIdentifier(CSSValueAuto); |
| 213 | 213 |
| 214 return 0; | 214 return nullptr; |
| 215 } | 215 } |
| 216 case CSSPropertyPaintOrder: | 216 case CSSPropertyPaintOrder: |
| 217 return paintOrderToCSSValueList(svgStyle->paintOrder()); | 217 return paintOrderToCSSValueList(svgStyle->paintOrder()); |
| 218 case CSSPropertyVectorEffect: | 218 case CSSPropertyVectorEffect: |
| 219 return CSSPrimitiveValue::create(svgStyle->vectorEffect()); | 219 return CSSPrimitiveValue::create(svgStyle->vectorEffect()); |
| 220 case CSSPropertyMaskType: | 220 case CSSPropertyMaskType: |
| 221 return CSSPrimitiveValue::create(svgStyle->maskType()); | 221 return CSSPrimitiveValue::create(svgStyle->maskType()); |
| 222 case CSSPropertyMarker: | 222 case CSSPropertyMarker: |
| 223 case CSSPropertyEnableBackground: | 223 case CSSPropertyEnableBackground: |
| 224 case CSSPropertyColorProfile: | 224 case CSSPropertyColorProfile: |
| 225 // the above properties are not yet implemented in the engine | 225 // the above properties are not yet implemented in the engine |
| 226 break; | 226 break; |
| 227 default: | 227 default: |
| 228 // If you crash here, it's because you added a css property and are not
handling it | 228 // If you crash here, it's because you added a css property and are not
handling it |
| 229 // in either this switch statement or the one in CSSComputedStyleDelcara
tion::getPropertyCSSValue | 229 // in either this switch statement or the one in CSSComputedStyleDelcara
tion::getPropertyCSSValue |
| 230 ASSERT_WITH_MESSAGE(0, "unimplemented propertyID: %d", propertyID); | 230 ASSERT_WITH_MESSAGE(0, "unimplemented propertyID: %d", propertyID); |
| 231 } | 231 } |
| 232 WTF_LOG_ERROR("unimplemented propertyID: %d", propertyID); | 232 WTF_LOG_ERROR("unimplemented propertyID: %d", propertyID); |
| 233 return 0; | 233 return nullptr; |
| 234 } | 234 } |
| 235 | 235 |
| 236 } | 236 } |
| OLD | NEW |