Use toCSSFooValue() instead of using static_cast<const CSSFooValue*>
authorgyuyoung.kim@samsung.com <gyuyoung.kim@samsung.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 8 Oct 2013 12:07:31 +0000 (12:07 +0000)
committergyuyoung.kim@samsung.com <gyuyoung.kim@samsung.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 8 Oct 2013 12:07:31 +0000 (12:07 +0000)
https://bugs.webkit.org/show_bug.cgi?id=122491

Reviewed by Andreas Kling.

static_cast<const CSSFooValue*> wasn't cleanup. So, we need to use toCSSFooValue() for it.
To use toCSSValue() will help to detect bad type-cast.

Besides static_cast<const WebKitCSSFooValue*> helper functions need to be added to support this use.

No new tests, no behavior change.

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::propertyMatches):
* css/CSSImageGeneratorValue.cpp:
(WebCore::CSSImageGeneratorValue::isFixedSize):
(WebCore::CSSImageGeneratorValue::isPending):
(WebCore::CSSImageGeneratorValue::knownToBeOpaque):
* css/CSSValue.cpp:
(WebCore::CSSValue::isImplicitInitialValue):
(WebCore::CSSValue::addSubresourceStyleURLs):
(WebCore::CSSValue::hasFailedOrCanceledSubresources):
(WebCore::CSSValue::equals):
(WebCore::CSSValue::cssText):
(WebCore::CSSValue::serializeResolvingVariables):
(WebCore::CSSValue::cloneForCSSOM):
* css/StylePropertySet.cpp:
(WebCore::StylePropertySet::PropertyReference::cssName):
* css/WebKitCSSSVGDocumentValue.h:
(WebCore::toWebKitCSSSVGDocumentValue):
* css/WebKitCSSTransformValue.h:
(WebCore::toWebKitCSSTransformValue):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@157098 268f45cc-cd09-0410-ab3c-d52691b4dbfc

12 files changed:
Source/WebCore/ChangeLog
Source/WebCore/css/CSSComputedStyleDeclaration.cpp
Source/WebCore/css/CSSImageGeneratorValue.cpp
Source/WebCore/css/CSSValue.cpp
Source/WebCore/css/StylePropertySet.cpp
Source/WebCore/css/WebKitCSSArrayFunctionValue.h
Source/WebCore/css/WebKitCSSFilterValue.h
Source/WebCore/css/WebKitCSSMatFunctionValue.h
Source/WebCore/css/WebKitCSSMixFunctionValue.h
Source/WebCore/css/WebKitCSSSVGDocumentValue.h
Source/WebCore/css/WebKitCSSShaderValue.h
Source/WebCore/css/WebKitCSSTransformValue.h

index 2bc05ad..cea5a48 100644 (file)
@@ -1,3 +1,38 @@
+2013-10-08  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
+
+        Use toCSSFooValue() instead of using static_cast<const CSSFooValue*>
+        https://bugs.webkit.org/show_bug.cgi?id=122491
+
+        Reviewed by Andreas Kling.
+
+        static_cast<const CSSFooValue*> wasn't cleanup. So, we need to use toCSSFooValue() for it.
+        To use toCSSValue() will help to detect bad type-cast.
+
+        Besides static_cast<const WebKitCSSFooValue*> helper functions need to be added to support this use.
+
+        No new tests, no behavior change.
+
+        * css/CSSComputedStyleDeclaration.cpp:
+        (WebCore::ComputedStyleExtractor::propertyMatches):
+        * css/CSSImageGeneratorValue.cpp:
+        (WebCore::CSSImageGeneratorValue::isFixedSize):
+        (WebCore::CSSImageGeneratorValue::isPending):
+        (WebCore::CSSImageGeneratorValue::knownToBeOpaque):
+        * css/CSSValue.cpp:
+        (WebCore::CSSValue::isImplicitInitialValue):
+        (WebCore::CSSValue::addSubresourceStyleURLs):
+        (WebCore::CSSValue::hasFailedOrCanceledSubresources):
+        (WebCore::CSSValue::equals):
+        (WebCore::CSSValue::cssText):
+        (WebCore::CSSValue::serializeResolvingVariables):
+        (WebCore::CSSValue::cloneForCSSOM):
+        * css/StylePropertySet.cpp:
+        (WebCore::StylePropertySet::PropertyReference::cssName):
+        * css/WebKitCSSSVGDocumentValue.h:
+        (WebCore::toWebKitCSSSVGDocumentValue):
+        * css/WebKitCSSTransformValue.h:
+        (WebCore::toWebKitCSSTransformValue):
+
 2013-10-08  Thiago de Barros Lacerda  <thiago.lacerda@openbossa.org>
 
         Get MediaStreamCenterGStreamer compiling again
index 1f3966e..9f65af6 100644 (file)
@@ -3121,7 +3121,7 @@ bool ComputedStyleExtractor::propertyMatches(CSSPropertyID propertyID, const CSS
         RenderStyle* style = m_node->computedStyle(m_pseudoElementSpecifier);
         if (style && style->fontDescription().keywordSize()) {
             CSSValueID sizeValue = cssIdentifierForFontSizeKeyword(style->fontDescription().keywordSize());
-            const CSSPrimitiveValue* primitiveValue = static_cast<const CSSPrimitiveValue*>(value);
+            const CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
             if (primitiveValue->isValueID() && primitiveValue->getValueID() == sizeValue)
                 return true;
         }
index 168d3a7..e73c034 100644 (file)
@@ -129,17 +129,17 @@ bool CSSImageGeneratorValue::isFixedSize() const
 {
     switch (classType()) {
     case CanvasClass:
-        return static_cast<const CSSCanvasValue*>(this)->isFixedSize();
+        return toCSSCanvasValue(this)->isFixedSize();
     case CrossfadeClass:
-        return static_cast<const CSSCrossfadeValue*>(this)->isFixedSize();
+        return toCSSCrossfadeValue(this)->isFixedSize();
 #if ENABLE(CSS_FILTERS)
     case FilterImageClass:
-        return static_cast<const CSSFilterImageValue*>(this)->isFixedSize();
+        return toCSSFilterImageValue(this)->isFixedSize();
 #endif
     case LinearGradientClass:
-        return static_cast<const CSSLinearGradientValue*>(this)->isFixedSize();
+        return toCSSLinearGradientValue(this)->isFixedSize();
     case RadialGradientClass:
-        return static_cast<const CSSRadialGradientValue*>(this)->isFixedSize();
+        return toCSSRadialGradientValue(this)->isFixedSize();
     default:
         ASSERT_NOT_REACHED();
     }
@@ -171,17 +171,17 @@ bool CSSImageGeneratorValue::isPending() const
 {
     switch (classType()) {
     case CrossfadeClass:
-        return static_cast<const CSSCrossfadeValue*>(this)->isPending();
+        return toCSSCrossfadeValue(this)->isPending();
     case CanvasClass:
-        return static_cast<const CSSCanvasValue*>(this)->isPending();
+        return toCSSCanvasValue(this)->isPending();
 #if ENABLE(CSS_FILTERS)
     case FilterImageClass:
-        return static_cast<const CSSFilterImageValue*>(this)->isPending();
+        return toCSSFilterImageValue(this)->isPending();
 #endif
     case LinearGradientClass:
-        return static_cast<const CSSLinearGradientValue*>(this)->isPending();
+        return toCSSLinearGradientValue(this)->isPending();
     case RadialGradientClass:
-        return static_cast<const CSSRadialGradientValue*>(this)->isPending();
+        return toCSSRadialGradientValue(this)->isPending();
     default:
         ASSERT_NOT_REACHED();
     }
@@ -192,17 +192,17 @@ bool CSSImageGeneratorValue::knownToBeOpaque(const RenderElement* renderer) cons
 {
     switch (classType()) {
     case CrossfadeClass:
-        return static_cast<const CSSCrossfadeValue*>(this)->knownToBeOpaque(renderer);
+        return toCSSCrossfadeValue(this)->knownToBeOpaque(renderer);
     case CanvasClass:
         return false;
 #if ENABLE(CSS_FILTERS)
     case FilterImageClass:
-        return static_cast<const CSSFilterImageValue*>(this)->knownToBeOpaque(renderer);
+        return toCSSFilterImageValue(this)->knownToBeOpaque(renderer);
 #endif
     case LinearGradientClass:
-        return static_cast<const CSSLinearGradientValue*>(this)->knownToBeOpaque(renderer);
+        return toCSSLinearGradientValue(this)->knownToBeOpaque(renderer);
     case RadialGradientClass:
-        return static_cast<const CSSRadialGradientValue*>(this)->knownToBeOpaque(renderer);
+        return toCSSRadialGradientValue(this)->knownToBeOpaque(renderer);
     default:
         ASSERT_NOT_REACHED();
     }
index 2023de8..203eb62 100644 (file)
@@ -96,7 +96,7 @@ private:
 
 bool CSSValue::isImplicitInitialValue() const
 {
-    return m_classType == InitialClass && static_cast<const CSSInitialValue*>(this)->isImplicit();
+    return m_classType == InitialClass && toCSSInitialValue(this)->isImplicit();
 }
 
 CSSValue::Type CSSValue::cssValueType() const
@@ -118,13 +118,13 @@ void CSSValue::addSubresourceStyleURLs(ListHashSet<URL>& urls, const StyleSheetC
     ASSERT(!isCSSOMSafe());
 
     if (isPrimitiveValue())
-        static_cast<const CSSPrimitiveValue*>(this)->addSubresourceStyleURLs(urls, styleSheet);
+        toCSSPrimitiveValue(this)->addSubresourceStyleURLs(urls, styleSheet);
     else if (isValueList())
-        static_cast<const CSSValueList*>(this)->addSubresourceStyleURLs(urls, styleSheet);
+        toCSSValueList(this)->addSubresourceStyleURLs(urls, styleSheet);
     else if (classType() == FontFaceSrcClass)
-        static_cast<const CSSFontFaceSrcValue*>(this)->addSubresourceStyleURLs(urls, styleSheet);
+        toCSSFontFaceSrcValue(this)->addSubresourceStyleURLs(urls, styleSheet);
     else if (classType() == ReflectClass)
-        static_cast<const CSSReflectValue*>(this)->addSubresourceStyleURLs(urls, styleSheet);
+        toCSSReflectValue(this)->addSubresourceStyleURLs(urls, styleSheet);
 }
 
 bool CSSValue::hasFailedOrCanceledSubresources() const
@@ -133,20 +133,20 @@ bool CSSValue::hasFailedOrCanceledSubresources() const
     ASSERT(!isCSSOMSafe());
 
     if (isValueList())
-        return static_cast<const CSSValueList*>(this)->hasFailedOrCanceledSubresources();
+        return toCSSValueList(this)->hasFailedOrCanceledSubresources();
     if (classType() == FontFaceSrcClass)
-        return static_cast<const CSSFontFaceSrcValue*>(this)->hasFailedOrCanceledSubresources();
+        return toCSSFontFaceSrcValue(this)->hasFailedOrCanceledSubresources();
     if (classType() == ImageClass)
-        return static_cast<const CSSImageValue*>(this)->hasFailedOrCanceledSubresources();
+        return toCSSImageValue(this)->hasFailedOrCanceledSubresources();
     if (classType() == CrossfadeClass)
-        return static_cast<const CSSCrossfadeValue*>(this)->hasFailedOrCanceledSubresources();
+        return toCSSCrossfadeValue(this)->hasFailedOrCanceledSubresources();
 #if ENABLE(CSS_FILTERS)
     if (classType() == FilterImageClass)
-        return static_cast<const CSSFilterImageValue*>(this)->hasFailedOrCanceledSubresources();
+        return toCSSFilterImageValue(this)->hasFailedOrCanceledSubresources();
 #endif
 #if ENABLE(CSS_IMAGE_SET)
     if (classType() == ImageSetClass)
-        return static_cast<const CSSImageSetValue*>(this)->hasFailedOrCanceledSubresources();
+        return toCSSImageSetValue(this)->hasFailedOrCanceledSubresources();
 #endif
     return false;
 }
@@ -253,7 +253,7 @@ bool CSSValue::equals(const CSSValue& other) const
             return false;
         }
     } else if (m_classType == ValueListClass && other.m_classType != ValueListClass)
-        return static_cast<const CSSValueList*>(this)->equals(other);
+        return toCSSValueList(this)->equals(other);
     else if (m_classType != ValueListClass && other.m_classType == ValueListClass)
         return static_cast<const CSSValueList&>(other).equals(*this);
     return false;
@@ -269,78 +269,78 @@ String CSSValue::cssText() const
 
     switch (classType()) {
     case AspectRatioClass:
-        return static_cast<const CSSAspectRatioValue*>(this)->customCSSText();
+        return toCSSAspectRatioValue(this)->customCSSText();
     case BorderImageSliceClass:
-        return static_cast<const CSSBorderImageSliceValue*>(this)->customCSSText();
+        return toCSSBorderImageSliceValue(this)->customCSSText();
     case CanvasClass:
-        return static_cast<const CSSCanvasValue*>(this)->customCSSText();
+        return toCSSCanvasValue(this)->customCSSText();
     case CursorImageClass:
-        return static_cast<const CSSCursorImageValue*>(this)->customCSSText();
+        return toCSSCursorImageValue(this)->customCSSText();
 #if ENABLE(CSS_FILTERS)
     case FilterImageClass:
-        return static_cast<const CSSFilterImageValue*>(this)->customCSSText();
+        return toCSSFilterImageValue(this)->customCSSText();
 #endif
     case FontClass:
-        return static_cast<const CSSFontValue*>(this)->customCSSText();
+        return toCSSFontValue(this)->customCSSText();
     case FontFaceSrcClass:
-        return static_cast<const CSSFontFaceSrcValue*>(this)->customCSSText();
+        return toCSSFontFaceSrcValue(this)->customCSSText();
     case FontFeatureClass:
-        return static_cast<const CSSFontFeatureValue*>(this)->customCSSText();
+        return toCSSFontFeatureValue(this)->customCSSText();
     case FunctionClass:
-        return static_cast<const CSSFunctionValue*>(this)->customCSSText();
+        return toCSSFunctionValue(this)->customCSSText();
     case LinearGradientClass:
-        return static_cast<const CSSLinearGradientValue*>(this)->customCSSText();
+        return toCSSLinearGradientValue(this)->customCSSText();
     case RadialGradientClass:
-        return static_cast<const CSSRadialGradientValue*>(this)->customCSSText();
+        return toCSSRadialGradientValue(this)->customCSSText();
     case CrossfadeClass:
-        return static_cast<const CSSCrossfadeValue*>(this)->customCSSText();
+        return toCSSCrossfadeValue(this)->customCSSText();
     case ImageClass:
-        return static_cast<const CSSImageValue*>(this)->customCSSText();
+        return toCSSImageValue(this)->customCSSText();
     case InheritedClass:
-        return static_cast<const CSSInheritedValue*>(this)->customCSSText();
+        return toCSSInheritedValue(this)->customCSSText();
     case InitialClass:
-        return static_cast<const CSSInitialValue*>(this)->customCSSText();
+        return toCSSInitialValue(this)->customCSSText();
     case PrimitiveClass:
-        return static_cast<const CSSPrimitiveValue*>(this)->customCSSText();
+        return toCSSPrimitiveValue(this)->customCSSText();
     case ReflectClass:
-        return static_cast<const CSSReflectValue*>(this)->customCSSText();
+        return toCSSReflectValue(this)->customCSSText();
     case ShadowClass:
-        return static_cast<const CSSShadowValue*>(this)->customCSSText();
+        return toCSSShadowValue(this)->customCSSText();
     case CubicBezierTimingFunctionClass:
-        return static_cast<const CSSCubicBezierTimingFunctionValue*>(this)->customCSSText();
+        return toCSSCubicBezierTimingFunctionValue(this)->customCSSText();
     case StepsTimingFunctionClass:
-        return static_cast<const CSSStepsTimingFunctionValue*>(this)->customCSSText();
+        return toCSSStepsTimingFunctionValue(this)->customCSSText();
     case UnicodeRangeClass:
-        return static_cast<const CSSUnicodeRangeValue*>(this)->customCSSText();
+        return toCSSUnicodeRangeValue(this)->customCSSText();
     case ValueListClass:
-        return static_cast<const CSSValueList*>(this)->customCSSText();
+        return toCSSValueList(this)->customCSSText();
     case WebKitCSSTransformClass:
-        return static_cast<const WebKitCSSTransformValue*>(this)->customCSSText();
+        return toWebKitCSSTransformValue(this)->customCSSText();
     case LineBoxContainClass:
-        return static_cast<const CSSLineBoxContainValue*>(this)->customCSSText();
+        return toCSSLineBoxContainValue(this)->customCSSText();
     case CalculationClass:
-        return static_cast<const CSSCalcValue*>(this)->customCSSText();
+        return toCSSCalcValue(this)->customCSSText();
 #if ENABLE(CSS_IMAGE_SET)
     case ImageSetClass:
-        return static_cast<const CSSImageSetValue*>(this)->customCSSText();
+        return toCSSImageSetValue(this)->customCSSText();
 #endif
 #if ENABLE(CSS_FILTERS)
     case WebKitCSSFilterClass:
-        return static_cast<const WebKitCSSFilterValue*>(this)->customCSSText();
+        return toWebKitCSSFilterValue(this)->customCSSText();
 #if ENABLE(CSS_SHADERS)
     case WebKitCSSArrayFunctionValueClass:
-        return static_cast<const WebKitCSSArrayFunctionValue*>(this)->customCSSText();
+        return toWebKitCSSArrayFunctionValue(this)->customCSSText();
     case WebKitCSSMatFunctionValueClass:
-        return static_cast<const WebKitCSSMatFunctionValue*>(this)->customCSSText();
+        return toWebKitCSSMatFunctionValue(this)->customCSSText();
     case WebKitCSSMixFunctionValueClass:
-        return static_cast<const WebKitCSSMixFunctionValue*>(this)->customCSSText();
+        return toWebKitCSSMixFunctionValue(this)->customCSSText();
     case WebKitCSSShaderClass:
-        return static_cast<const WebKitCSSShaderValue*>(this)->customCSSText();
+        return toWebKitCSSShaderValue(this)->customCSSText();
 #endif
 #endif
 #if ENABLE(CSS_VARIABLES)
     case VariableClass:
-        return static_cast<const CSSVariableValue*>(this)->value();
+        return toCSSVariableValue(this)->value();
 #endif
 #if ENABLE(SVG)
     case SVGColorClass:
@@ -348,7 +348,7 @@ String CSSValue::cssText() const
     case SVGPaintClass:
         return static_cast<const SVGPaint*>(this)->customCSSText();
     case WebKitCSSSVGDocumentClass:
-        return static_cast<const WebKitCSSSVGDocumentValue*>(this)->customCSSText();
+        return toWebKitCSSSVGDocumentValue(this)->customCSSText();
 #endif
     }
     ASSERT_NOT_REACHED();
@@ -360,13 +360,13 @@ String CSSValue::serializeResolvingVariables(const HashMap<AtomicString, String>
 {
     switch (classType()) {
     case PrimitiveClass:
-        return static_cast<const CSSPrimitiveValue*>(this)->customSerializeResolvingVariables(variables);
+        return toCSSPrimitiveValue(this)->customSerializeResolvingVariables(variables);
     case ReflectClass:
-        return static_cast<const CSSReflectValue*>(this)->customSerializeResolvingVariables(variables);
+        return toCSSReflectValue(this)->customSerializeResolvingVariables(variables);
     case ValueListClass:
-        return static_cast<const CSSValueList*>(this)->customSerializeResolvingVariables(variables);
+        return toCSSValueList(this)->customSerializeResolvingVariables(variables);
     case WebKitCSSTransformClass:
-        return static_cast<const WebKitCSSTransformValue*>(this)->customSerializeResolvingVariables(variables);
+        return toWebKitCSSTransformValue(this)->customSerializeResolvingVariables(variables);
     default:
         return cssText();
     }
@@ -506,29 +506,29 @@ PassRefPtr<CSSValue> CSSValue::cloneForCSSOM() const
 {
     switch (classType()) {
     case PrimitiveClass:
-        return static_cast<const CSSPrimitiveValue*>(this)->cloneForCSSOM();
+        return toCSSPrimitiveValue(this)->cloneForCSSOM();
     case ValueListClass:
-        return static_cast<const CSSValueList*>(this)->cloneForCSSOM();
+        return toCSSValueList(this)->cloneForCSSOM();
     case ImageClass:
     case CursorImageClass:
-        return static_cast<const CSSImageValue*>(this)->cloneForCSSOM();
+        return toCSSImageValue(this)->cloneForCSSOM();
 #if ENABLE(CSS_FILTERS)
     case WebKitCSSFilterClass:
-        return static_cast<const WebKitCSSFilterValue*>(this)->cloneForCSSOM();
+        return toWebKitCSSFilterValue(this)->cloneForCSSOM();
 #if ENABLE(CSS_SHADERS)
     case WebKitCSSArrayFunctionValueClass:
-        return static_cast<const WebKitCSSArrayFunctionValue*>(this)->cloneForCSSOM();
+        return toWebKitCSSArrayFunctionValue(this)->cloneForCSSOM();
     case WebKitCSSMatFunctionValueClass:
-        return static_cast<const WebKitCSSMatFunctionValue*>(this)->cloneForCSSOM();
+        return toWebKitCSSMatFunctionValue(this)->cloneForCSSOM();
     case WebKitCSSMixFunctionValueClass:
-        return static_cast<const WebKitCSSMixFunctionValue*>(this)->cloneForCSSOM();
+        return toWebKitCSSMixFunctionValue(this)->cloneForCSSOM();
 #endif
 #endif
     case WebKitCSSTransformClass:
-        return static_cast<const WebKitCSSTransformValue*>(this)->cloneForCSSOM();
+        return toWebKitCSSTransformValue(this)->cloneForCSSOM();
 #if ENABLE(CSS_IMAGE_SET)
     case ImageSetClass:
-        return static_cast<const CSSImageSetValue*>(this)->cloneForCSSOM();
+        return toCSSImageSetValue(this)->cloneForCSSOM();
 #endif
 #if ENABLE(SVG)
     case SVGColorClass:
index dd0ab73..5fcbc6f 100644 (file)
@@ -1272,7 +1272,7 @@ String StylePropertySet::PropertyReference::cssName() const
         ASSERT(propertyValue()->isVariableValue());
         if (!propertyValue()->isVariableValue())
             return emptyString(); // Should not happen, but if it does, avoid a bad cast.
-        return "-webkit-var-" + static_cast<const CSSVariableValue*>(propertyValue())->name();
+        return "-webkit-var-" + toCSSVariableValue(propertyValue())->name();
     }
 #endif
     return getPropertyNameString(id());
index 34f21ac..d40d76e 100644 (file)
@@ -61,6 +61,12 @@ inline WebKitCSSArrayFunctionValue* toWebKitCSSArrayFunctionValue(CSSValue* valu
     return static_cast<WebKitCSSArrayFunctionValue*>(value);
 }
 
+inline const WebKitCSSArrayFunctionValue* toWebKitCSSArrayFunctionValue(const CSSValue* value)
+{
+    ASSERT_WITH_SECURITY_IMPLICATION(!value || value->isWebKitCSSArrayFunctionValue());
+    return static_cast<const WebKitCSSArrayFunctionValue*>(value);
+}
+
 } // namespace WebCore
 
 #endif // ENABLE(CSS_SHADERS)
index 86a2552..e0a5b5e 100644 (file)
@@ -83,6 +83,12 @@ inline WebKitCSSFilterValue* toWebKitCSSFilterValue(CSSValue* value)
     return static_cast<WebKitCSSFilterValue*>(value);
 }
 
+inline const WebKitCSSFilterValue* toWebKitCSSFilterValue(const CSSValue* value)
+{
+    ASSERT_WITH_SECURITY_IMPLICATION(!value || value->isWebKitCSSFilterValue());
+    return static_cast<const WebKitCSSFilterValue*>(value);
+}
+
 }
 
 #endif // ENABLE(CSS_FILTERS)
index 39dac9a..ef34d7a 100644 (file)
@@ -61,6 +61,12 @@ inline WebKitCSSMatFunctionValue* toWebKitCSSMatFunctionValue(CSSValue* value)
     return static_cast<WebKitCSSMatFunctionValue*>(value);
 }
 
+inline const WebKitCSSMatFunctionValue* toWebKitCSSMatFunctionValue(const CSSValue* value)
+{
+    ASSERT_WITH_SECURITY_IMPLICATION(!value || value->isWebKitCSSMatFunctionValue());
+    return static_cast<const WebKitCSSMatFunctionValue*>(value);
+}
+
 } // namespace WebCore
 
 #endif // ENABLE(CSS_SHADERS)
index f57fc06..5b70fde 100644 (file)
@@ -60,7 +60,13 @@ inline WebKitCSSMixFunctionValue* toWebKitCSSMixFunctionValue(CSSValue* value)
     ASSERT_WITH_SECURITY_IMPLICATION(!value || value->isWebKitCSSMixFunctionValue());
     return static_cast<WebKitCSSMixFunctionValue*>(value);
 }
-    
+
+inline const WebKitCSSMixFunctionValue* toWebKitCSSMixFunctionValue(const CSSValue* value)
+{
+    ASSERT_WITH_SECURITY_IMPLICATION(!value || value->isWebKitCSSMixFunctionValue());
+    return static_cast<const WebKitCSSMixFunctionValue*>(value);
+}
+
 } // namespace WebCore
 
 #endif // ENABLE(CSS_SHADERS)
index 30f71f9..2185007 100644 (file)
@@ -60,6 +60,12 @@ inline WebKitCSSSVGDocumentValue* toWebKitCSSSVGDocumentValue(CSSValue* value)
     return static_cast<WebKitCSSSVGDocumentValue*>(value);
 }
 
+inline const WebKitCSSSVGDocumentValue* toWebKitCSSSVGDocumentValue(const CSSValue* value)
+{
+    ASSERT_WITH_SECURITY_IMPLICATION(!value || value->isWebKitCSSSVGDocumentValue());
+    return static_cast<const WebKitCSSSVGDocumentValue*>(value);
+}
+
 } // namespace WebCore
 
 #endif // WebKitCSSSVGDocumentValue_h
index 40ed7b2..59962a9 100644 (file)
@@ -75,6 +75,12 @@ inline WebKitCSSShaderValue* toWebKitCSSShaderValue(CSSValue* value)
     return static_cast<WebKitCSSShaderValue*>(value);
 }
 
+inline const WebKitCSSShaderValue* toWebKitCSSShaderValue(const CSSValue* value)
+{
+    ASSERT_WITH_SECURITY_IMPLICATION(!value || value->isWebKitCSSShaderValue());
+    return static_cast<const WebKitCSSShaderValue*>(value);
+}
+
 } // namespace WebCore
 
 #endif // ENABLE(CSS_SHADERS)
index ff34424..4375802 100644 (file)
@@ -88,6 +88,12 @@ inline WebKitCSSTransformValue* toWebKitCSSTransformValue(CSSValue* value)
     return static_cast<WebKitCSSTransformValue*>(value);
 }
 
+inline const WebKitCSSTransformValue* toWebKitCSSTransformValue(const CSSValue* value)
+{
+    ASSERT_WITH_SECURITY_IMPLICATION(!value || value->isWebKitCSSTransformValue());
+    return static_cast<const WebKitCSSTransformValue*>(value);
+}
+
 }
 
 #endif