| 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 12 matching lines...) Expand all Loading... |
| 23 #include "core/css/CSSComputedStyleDeclaration.h" | 23 #include "core/css/CSSComputedStyleDeclaration.h" |
| 24 | 24 |
| 25 #include "CSSPropertyNames.h" | 25 #include "CSSPropertyNames.h" |
| 26 #include "core/css/CSSPrimitiveValueMappings.h" | 26 #include "core/css/CSSPrimitiveValueMappings.h" |
| 27 #include "core/dom/Document.h" | 27 #include "core/dom/Document.h" |
| 28 #include "core/rendering/style/RenderStyle.h" | 28 #include "core/rendering/style/RenderStyle.h" |
| 29 #include "core/svg/SVGPaint.h" | 29 #include "core/svg/SVGPaint.h" |
| 30 | 30 |
| 31 namespace WebCore { | 31 namespace WebCore { |
| 32 | 32 |
| 33 static PassRefPtr<CSSPrimitiveValue> glyphOrientationToCSSPrimitiveValue(EGlyphO
rientation orientation) | 33 static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> glyphOrientationToCSSPrimitiveV
alue(EGlyphOrientation orientation) |
| 34 { | 34 { |
| 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)
; |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 0; |
| 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 (RefPtr<CSSPrimitiveValue> value = glyphOrientationToCSSPrimitive
Value(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 0; |
| 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 0; |
| 234 } | 234 } |
| 235 | 235 |
| 236 } | 236 } |
| OLD | NEW |