summaryrefslogtreecommitdiff
path: root/Source/WebCore/css/CSSValue.cpp
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2016-04-10 09:28:39 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2016-04-10 09:28:39 +0000
commit32761a6cee1d0dee366b885b7b9c777e67885688 (patch)
treed6bec92bebfb216f4126356e55518842c2f476a1 /Source/WebCore/css/CSSValue.cpp
parenta4e969f4965059196ca948db781e52f7cfebf19e (diff)
downloadWebKitGtk-tarball-32761a6cee1d0dee366b885b7b9c777e67885688.tar.gz
webkitgtk-2.4.11webkitgtk-2.4.11
Diffstat (limited to 'Source/WebCore/css/CSSValue.cpp')
-rw-r--r--Source/WebCore/css/CSSValue.cpp327
1 files changed, 121 insertions, 206 deletions
diff --git a/Source/WebCore/css/CSSValue.cpp b/Source/WebCore/css/CSSValue.cpp
index 229820551..760e8d0ad 100644
--- a/Source/WebCore/css/CSSValue.cpp
+++ b/Source/WebCore/css/CSSValue.cpp
@@ -11,10 +11,10 @@
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
@@ -28,47 +28,35 @@
#include "config.h"
#include "CSSValue.h"
-#include "CSSAnimationTriggerScrollValue.h"
#include "CSSAspectRatioValue.h"
#include "CSSBorderImageSliceValue.h"
#include "CSSCalculationValue.h"
#include "CSSCanvasValue.h"
-#include "CSSContentDistributionValue.h"
#include "CSSCrossfadeValue.h"
#include "CSSCursorImageValue.h"
-#include "CSSCustomPropertyValue.h"
#include "CSSFilterImageValue.h"
#include "CSSFontFaceSrcValue.h"
#include "CSSFontFeatureValue.h"
#include "CSSFontValue.h"
#include "CSSFunctionValue.h"
#include "CSSGradientValue.h"
+#include "CSSGridTemplateValue.h"
#include "CSSImageSetValue.h"
#include "CSSImageValue.h"
#include "CSSInheritedValue.h"
#include "CSSInitialValue.h"
#include "CSSLineBoxContainValue.h"
-#include "CSSNamedImageValue.h"
#include "CSSPrimitiveValue.h"
-#include "CSSProperty.h"
#include "CSSReflectValue.h"
#include "CSSShadowValue.h"
#include "CSSTimingFunctionValue.h"
#include "CSSUnicodeRangeValue.h"
-#include "CSSUnsetValue.h"
#include "CSSValueList.h"
-#include "CSSVariableDependentValue.h"
-#include "CSSVariableValue.h"
#include "SVGColor.h"
#include "SVGPaint.h"
#include "WebKitCSSFilterValue.h"
#include "WebKitCSSTransformValue.h"
-#if ENABLE(CSS_GRID_LAYOUT)
-#include "CSSGridLineNamesValue.h"
-#include "CSSGridTemplateAreasValue.h"
-#endif
-
namespace WebCore {
struct SameSizeAsCSSValue : public RefCounted<SameSizeAsCSSValue> {
@@ -79,7 +67,7 @@ COMPILE_ASSERT(sizeof(CSSValue) == sizeof(SameSizeAsCSSValue), CSS_value_should_
class TextCloneCSSValue : public CSSValue {
public:
- static Ref<TextCloneCSSValue> create(ClassType classType, const String& text)
+ static PassRef<TextCloneCSSValue> create(ClassType classType, const String& text)
{
return adoptRef(*new TextCloneCSSValue(classType, text));
}
@@ -99,7 +87,7 @@ private:
bool CSSValue::isImplicitInitialValue() const
{
- return m_classType == InitialClass && downcast<CSSInitialValue>(*this).isImplicit();
+ return m_classType == InitialClass && toCSSInitialValue(this)->isImplicit();
}
CSSValue::Type CSSValue::cssValueType() const
@@ -112,10 +100,6 @@ CSSValue::Type CSSValue::cssValueType() const
return CSS_VALUE_LIST;
if (isInitialValue())
return CSS_INITIAL;
- if (isUnsetValue())
- return CSS_UNSET;
- if (isRevertValue())
- return CSS_REVERT;
return CSS_CUSTOM;
}
@@ -124,34 +108,36 @@ void CSSValue::addSubresourceStyleURLs(ListHashSet<URL>& urls, const StyleSheetC
// This should get called for internal instances only.
ASSERT(!isCSSOMSafe());
- if (is<CSSPrimitiveValue>(*this))
- downcast<CSSPrimitiveValue>(*this).addSubresourceStyleURLs(urls, styleSheet);
- else if (is<CSSValueList>(*this))
- downcast<CSSValueList>(*this).addSubresourceStyleURLs(urls, styleSheet);
- else if (is<CSSFontFaceSrcValue>(*this))
- downcast<CSSFontFaceSrcValue>(*this).addSubresourceStyleURLs(urls, styleSheet);
- else if (is<CSSReflectValue>(*this))
- downcast<CSSReflectValue>(*this).addSubresourceStyleURLs(urls, styleSheet);
+ if (isPrimitiveValue())
+ toCSSPrimitiveValue(this)->addSubresourceStyleURLs(urls, styleSheet);
+ else if (isValueList())
+ toCSSValueList(this)->addSubresourceStyleURLs(urls, styleSheet);
+ else if (classType() == FontFaceSrcClass)
+ toCSSFontFaceSrcValue(this)->addSubresourceStyleURLs(urls, styleSheet);
+ else if (classType() == ReflectClass)
+ toCSSReflectValue(this)->addSubresourceStyleURLs(urls, styleSheet);
}
-bool CSSValue::traverseSubresources(const std::function<bool (const CachedResource&)>& handler) const
+bool CSSValue::hasFailedOrCanceledSubresources() const
{
// This should get called for internal instances only.
ASSERT(!isCSSOMSafe());
- if (is<CSSValueList>(*this))
- return downcast<CSSValueList>(*this).traverseSubresources(handler);
- if (is<CSSFontFaceSrcValue>(*this))
- return downcast<CSSFontFaceSrcValue>(*this).traverseSubresources(handler);
- if (is<CSSImageValue>(*this))
- return downcast<CSSImageValue>(*this).traverseSubresources(handler);
- if (is<CSSCrossfadeValue>(*this))
- return downcast<CSSCrossfadeValue>(*this).traverseSubresources(handler);
- if (is<CSSFilterImageValue>(*this))
- return downcast<CSSFilterImageValue>(*this).traverseSubresources(handler);
+ if (isValueList())
+ return toCSSValueList(this)->hasFailedOrCanceledSubresources();
+ if (classType() == FontFaceSrcClass)
+ return toCSSFontFaceSrcValue(this)->hasFailedOrCanceledSubresources();
+ if (classType() == ImageClass)
+ return toCSSImageValue(this)->hasFailedOrCanceledSubresources();
+ if (classType() == CrossfadeClass)
+ return toCSSCrossfadeValue(this)->hasFailedOrCanceledSubresources();
+#if ENABLE(CSS_FILTERS)
+ if (classType() == FilterImageClass)
+ return toCSSFilterImageValue(this)->hasFailedOrCanceledSubresources();
+#endif
#if ENABLE(CSS_IMAGE_SET)
- if (is<CSSImageSetValue>(*this))
- return downcast<CSSImageSetValue>(*this).traverseSubresources(handler);
+ if (classType() == ImageSetClass)
+ return toCSSImageSetValue(this)->hasFailedOrCanceledSubresources();
#endif
return false;
}
@@ -177,12 +163,12 @@ bool CSSValue::equals(const CSSValue& other) const
return compareCSSValues<CSSBorderImageSliceValue>(*this, other);
case CanvasClass:
return compareCSSValues<CSSCanvasValue>(*this, other);
- case NamedImageClass:
- return compareCSSValues<CSSNamedImageValue>(*this, other);
case CursorImageClass:
return compareCSSValues<CSSCursorImageValue>(*this, other);
+#if ENABLE(CSS_FILTERS)
case FilterImageClass:
return compareCSSValues<CSSFilterImageValue>(*this, other);
+#endif
case FontClass:
return compareCSSValues<CSSFontValue>(*this, other);
case FontFaceSrcClass:
@@ -203,16 +189,8 @@ bool CSSValue::equals(const CSSValue& other) const
return compareCSSValues<CSSInheritedValue>(*this, other);
case InitialClass:
return compareCSSValues<CSSInitialValue>(*this, other);
- case UnsetClass:
- return compareCSSValues<CSSUnsetValue>(*this, other);
- case RevertClass:
- return compareCSSValues<CSSRevertValue>(*this, other);
-#if ENABLE(CSS_GRID_LAYOUT)
- case GridLineNamesClass:
- return compareCSSValues<CSSGridLineNamesValue>(*this, other);
- case GridTemplateAreasClass:
- return compareCSSValues<CSSGridTemplateAreasValue>(*this, other);
-#endif
+ case GridTemplateClass:
+ return compareCSSValues<CSSGridTemplateValue>(*this, other);
case PrimitiveClass:
return compareCSSValues<CSSPrimitiveValue>(*this, other);
case ReflectClass:
@@ -237,31 +215,23 @@ bool CSSValue::equals(const CSSValue& other) const
case ImageSetClass:
return compareCSSValues<CSSImageSetValue>(*this, other);
#endif
+#if ENABLE(CSS_FILTERS)
case WebKitCSSFilterClass:
return compareCSSValues<WebKitCSSFilterValue>(*this, other);
+#endif
+#if ENABLE(SVG)
case SVGColorClass:
return compareCSSValues<SVGColor>(*this, other);
case SVGPaintClass:
return compareCSSValues<SVGPaint>(*this, other);
-#if ENABLE(CSS_ANIMATIONS_LEVEL_2)
- case AnimationTriggerScrollClass:
- return compareCSSValues<CSSAnimationTriggerScrollValue>(*this, other);
#endif
- case CSSContentDistributionClass:
- return compareCSSValues<CSSContentDistributionValue>(*this, other);
- case CustomPropertyClass:
- return compareCSSValues<CSSCustomPropertyValue>(*this, other);
- case VariableDependentClass:
- return compareCSSValues<CSSVariableDependentValue>(*this, other);
- case VariableClass:
- return compareCSSValues<CSSVariableValue>(*this, other);
default:
ASSERT_NOT_REACHED();
return false;
}
- } else if (is<CSSValueList>(*this) && !is<CSSValueList>(other))
- return downcast<CSSValueList>(*this).equals(other);
- else if (!is<CSSValueList>(*this) && is<CSSValueList>(other))
+ } else if (m_classType == ValueListClass && other.m_classType != ValueListClass)
+ return toCSSValueList(this)->equals(other);
+ else if (m_classType != ValueListClass && other.m_classType == ValueListClass)
return static_cast<const CSSValueList&>(other).equals(*this);
return false;
}
@@ -276,91 +246,74 @@ String CSSValue::cssText() const
switch (classType()) {
case AspectRatioClass:
- return downcast<CSSAspectRatioValue>(*this).customCSSText();
+ return toCSSAspectRatioValue(this)->customCSSText();
case BorderImageSliceClass:
- return downcast<CSSBorderImageSliceValue>(*this).customCSSText();
+ return toCSSBorderImageSliceValue(this)->customCSSText();
case CanvasClass:
- return downcast<CSSCanvasValue>(*this).customCSSText();
- case NamedImageClass:
- return downcast<CSSNamedImageValue>(*this).customCSSText();
+ return toCSSCanvasValue(this)->customCSSText();
case CursorImageClass:
- return downcast<CSSCursorImageValue>(*this).customCSSText();
+ return toCSSCursorImageValue(this)->customCSSText();
+#if ENABLE(CSS_FILTERS)
case FilterImageClass:
- return downcast<CSSFilterImageValue>(*this).customCSSText();
+ return toCSSFilterImageValue(this)->customCSSText();
+#endif
case FontClass:
- return downcast<CSSFontValue>(*this).customCSSText();
+ return toCSSFontValue(this)->customCSSText();
case FontFaceSrcClass:
- return downcast<CSSFontFaceSrcValue>(*this).customCSSText();
+ return toCSSFontFaceSrcValue(this)->customCSSText();
case FontFeatureClass:
- return downcast<CSSFontFeatureValue>(*this).customCSSText();
+ return toCSSFontFeatureValue(this)->customCSSText();
case FunctionClass:
- return downcast<CSSFunctionValue>(*this).customCSSText();
+ return toCSSFunctionValue(this)->customCSSText();
case LinearGradientClass:
- return downcast<CSSLinearGradientValue>(*this).customCSSText();
+ return toCSSLinearGradientValue(this)->customCSSText();
case RadialGradientClass:
- return downcast<CSSRadialGradientValue>(*this).customCSSText();
+ return toCSSRadialGradientValue(this)->customCSSText();
case CrossfadeClass:
- return downcast<CSSCrossfadeValue>(*this).customCSSText();
+ return toCSSCrossfadeValue(this)->customCSSText();
case ImageClass:
- return downcast<CSSImageValue>(*this).customCSSText();
+ return toCSSImageValue(this)->customCSSText();
case InheritedClass:
- return downcast<CSSInheritedValue>(*this).customCSSText();
+ return toCSSInheritedValue(this)->customCSSText();
case InitialClass:
- return downcast<CSSInitialValue>(*this).customCSSText();
- case UnsetClass:
- return downcast<CSSUnsetValue>(*this).customCSSText();
- case RevertClass:
- return downcast<CSSRevertValue>(*this).customCSSText();
-#if ENABLE(CSS_GRID_LAYOUT)
- case GridLineNamesClass:
- return downcast<CSSGridLineNamesValue>(*this).customCSSText();
- case GridTemplateAreasClass:
- return downcast<CSSGridTemplateAreasValue>(*this).customCSSText();
-#endif
+ return toCSSInitialValue(this)->customCSSText();
+ case GridTemplateClass:
+ return toCSSGridTemplateValue(this)->customCSSText();
case PrimitiveClass:
- return downcast<CSSPrimitiveValue>(*this).customCSSText();
+ return toCSSPrimitiveValue(this)->customCSSText();
case ReflectClass:
- return downcast<CSSReflectValue>(*this).customCSSText();
+ return toCSSReflectValue(this)->customCSSText();
case ShadowClass:
- return downcast<CSSShadowValue>(*this).customCSSText();
+ return toCSSShadowValue(this)->customCSSText();
case CubicBezierTimingFunctionClass:
- return downcast<CSSCubicBezierTimingFunctionValue>(*this).customCSSText();
+ return toCSSCubicBezierTimingFunctionValue(this)->customCSSText();
case StepsTimingFunctionClass:
- return downcast<CSSStepsTimingFunctionValue>(*this).customCSSText();
+ return toCSSStepsTimingFunctionValue(this)->customCSSText();
case UnicodeRangeClass:
- return downcast<CSSUnicodeRangeValue>(*this).customCSSText();
+ return toCSSUnicodeRangeValue(this)->customCSSText();
case ValueListClass:
- return downcast<CSSValueList>(*this).customCSSText();
+ return toCSSValueList(this)->customCSSText();
case WebKitCSSTransformClass:
- return downcast<WebKitCSSTransformValue>(*this).customCSSText();
+ return toWebKitCSSTransformValue(this)->customCSSText();
case LineBoxContainClass:
- return downcast<CSSLineBoxContainValue>(*this).customCSSText();
+ return toCSSLineBoxContainValue(this)->customCSSText();
case CalculationClass:
- return downcast<CSSCalcValue>(*this).customCSSText();
+ return toCSSCalcValue(this)->customCSSText();
#if ENABLE(CSS_IMAGE_SET)
case ImageSetClass:
- return downcast<CSSImageSetValue>(*this).customCSSText();
+ return toCSSImageSetValue(this)->customCSSText();
#endif
+#if ENABLE(CSS_FILTERS)
case WebKitCSSFilterClass:
- return downcast<WebKitCSSFilterValue>(*this).customCSSText();
+ return toWebKitCSSFilterValue(this)->customCSSText();
+#endif
+#if ENABLE(SVG)
case SVGColorClass:
- return downcast<SVGColor>(*this).customCSSText();
+ return toSVGColor(this)->customCSSText();
case SVGPaintClass:
- return downcast<SVGPaint>(*this).customCSSText();
-#if ENABLE(CSS_ANIMATIONS_LEVEL_2)
- case AnimationTriggerScrollClass:
- return downcast<CSSAnimationTriggerScrollValue>(*this).customCSSText();
+ return toSVGPaint(this)->customCSSText();
#endif
- case CSSContentDistributionClass:
- return downcast<CSSContentDistributionValue>(*this).customCSSText();
- case CustomPropertyClass:
- return downcast<CSSCustomPropertyValue>(*this).customCSSText();
- case VariableDependentClass:
- return downcast<CSSVariableDependentValue>(*this).customCSSText();
- case VariableClass:
- return downcast<CSSVariableValue>(*this).customCSSText();
}
-
ASSERT_NOT_REACHED();
return String();
}
@@ -376,173 +329,135 @@ void CSSValue::destroy()
switch (classType()) {
case AspectRatioClass:
- delete downcast<CSSAspectRatioValue>(this);
+ delete toCSSAspectRatioValue(this);
return;
case BorderImageSliceClass:
- delete downcast<CSSBorderImageSliceValue>(this);
+ delete toCSSBorderImageSliceValue(this);
return;
case CanvasClass:
- delete downcast<CSSCanvasValue>(this);
- return;
- case NamedImageClass:
- delete downcast<CSSNamedImageValue>(this);
+ delete toCSSCanvasValue(this);
return;
case CursorImageClass:
- delete downcast<CSSCursorImageValue>(this);
+ delete toCSSCursorImageValue(this);
return;
case FontClass:
- delete downcast<CSSFontValue>(this);
+ delete toCSSFontValue(this);
return;
case FontFaceSrcClass:
- delete downcast<CSSFontFaceSrcValue>(this);
+ delete toCSSFontFaceSrcValue(this);
return;
case FontFeatureClass:
- delete downcast<CSSFontFeatureValue>(this);
+ delete toCSSFontFeatureValue(this);
return;
case FunctionClass:
- delete downcast<CSSFunctionValue>(this);
+ delete toCSSFunctionValue(this);
return;
case LinearGradientClass:
- delete downcast<CSSLinearGradientValue>(this);
+ delete toCSSLinearGradientValue(this);
return;
case RadialGradientClass:
- delete downcast<CSSRadialGradientValue>(this);
+ delete toCSSRadialGradientValue(this);
return;
case CrossfadeClass:
- delete downcast<CSSCrossfadeValue>(this);
+ delete toCSSCrossfadeValue(this);
return;
case ImageClass:
- delete downcast<CSSImageValue>(this);
+ delete toCSSImageValue(this);
return;
case InheritedClass:
- delete downcast<CSSInheritedValue>(this);
+ delete toCSSInheritedValue(this);
return;
case InitialClass:
- delete downcast<CSSInitialValue>(this);
+ delete toCSSInitialValue(this);
return;
- case UnsetClass:
- delete downcast<CSSUnsetValue>(this);
+ case GridTemplateClass:
+ delete toCSSGridTemplateValue(this);
return;
- case RevertClass:
- delete downcast<CSSRevertValue>(this);
- return;
-#if ENABLE(CSS_GRID_LAYOUT)
- case GridLineNamesClass:
- delete downcast<CSSGridLineNamesValue>(this);
- return;
- case GridTemplateAreasClass:
- delete downcast<CSSGridTemplateAreasValue>(this);
- return;
-#endif
case PrimitiveClass:
- delete downcast<CSSPrimitiveValue>(this);
+ delete toCSSPrimitiveValue(this);
return;
case ReflectClass:
- delete downcast<CSSReflectValue>(this);
+ delete toCSSReflectValue(this);
return;
case ShadowClass:
- delete downcast<CSSShadowValue>(this);
+ delete toCSSShadowValue(this);
return;
case CubicBezierTimingFunctionClass:
- delete downcast<CSSCubicBezierTimingFunctionValue>(this);
+ delete toCSSCubicBezierTimingFunctionValue(this);
return;
case StepsTimingFunctionClass:
- delete downcast<CSSStepsTimingFunctionValue>(this);
+ delete toCSSStepsTimingFunctionValue(this);
return;
case UnicodeRangeClass:
- delete downcast<CSSUnicodeRangeValue>(this);
+ delete toCSSUnicodeRangeValue(this);
return;
case ValueListClass:
- delete downcast<CSSValueList>(this);
+ delete toCSSValueList(this);
return;
case WebKitCSSTransformClass:
- delete downcast<WebKitCSSTransformValue>(this);
+ delete toWebKitCSSTransformValue(this);
return;
case LineBoxContainClass:
- delete downcast<CSSLineBoxContainValue>(this);
+ delete toCSSLineBoxContainValue(this);
return;
case CalculationClass:
- delete downcast<CSSCalcValue>(this);
+ delete toCSSCalcValue(this);
return;
#if ENABLE(CSS_IMAGE_SET)
case ImageSetClass:
- delete downcast<CSSImageSetValue>(this);
+ delete toCSSImageSetValue(this);
return;
#endif
+#if ENABLE(CSS_FILTERS)
case FilterImageClass:
- delete downcast<CSSFilterImageValue>(this);
+ delete toCSSFilterImageValue(this);
return;
case WebKitCSSFilterClass:
- delete downcast<WebKitCSSFilterValue>(this);
+ delete toWebKitCSSFilterValue(this);
return;
+#endif
+#if ENABLE(SVG)
case SVGColorClass:
- delete downcast<SVGColor>(this);
+ delete toSVGColor(this);
return;
case SVGPaintClass:
- delete downcast<SVGPaint>(this);
- return;
-#if ENABLE(CSS_ANIMATIONS_LEVEL_2)
- case AnimationTriggerScrollClass:
- delete downcast<CSSAnimationTriggerScrollValue>(this);
+ delete toSVGPaint(this);
return;
#endif
- case CSSContentDistributionClass:
- delete downcast<CSSContentDistributionValue>(this);
- return;
- case CustomPropertyClass:
- delete downcast<CSSCustomPropertyValue>(this);
- return;
- case VariableDependentClass:
- delete downcast<CSSVariableDependentValue>(this);
- return;
- case VariableClass:
- delete downcast<CSSVariableValue>(this);
- return;
}
ASSERT_NOT_REACHED();
}
-RefPtr<CSSValue> CSSValue::cloneForCSSOM() const
+PassRefPtr<CSSValue> CSSValue::cloneForCSSOM() const
{
switch (classType()) {
case PrimitiveClass:
- return downcast<CSSPrimitiveValue>(*this).cloneForCSSOM();
+ return toCSSPrimitiveValue(this)->cloneForCSSOM();
case ValueListClass:
- return downcast<CSSValueList>(*this).cloneForCSSOM();
+ return toCSSValueList(this)->cloneForCSSOM();
case ImageClass:
case CursorImageClass:
- return downcast<CSSImageValue>(*this).cloneForCSSOM();
+ return toCSSImageValue(this)->cloneForCSSOM();
+#if ENABLE(CSS_FILTERS)
case WebKitCSSFilterClass:
- return downcast<WebKitCSSFilterValue>(*this).cloneForCSSOM();
+ return toWebKitCSSFilterValue(this)->cloneForCSSOM();
+#endif
case WebKitCSSTransformClass:
- return downcast<WebKitCSSTransformValue>(*this).cloneForCSSOM();
+ return toWebKitCSSTransformValue(this)->cloneForCSSOM();
#if ENABLE(CSS_IMAGE_SET)
case ImageSetClass:
- return downcast<CSSImageSetValue>(*this).cloneForCSSOM();
+ return toCSSImageSetValue(this)->cloneForCSSOM();
#endif
+#if ENABLE(SVG)
case SVGColorClass:
- return downcast<SVGColor>(*this).cloneForCSSOM();
+ return toSVGColor(this)->cloneForCSSOM();
case SVGPaintClass:
- return downcast<SVGPaint>(*this).cloneForCSSOM();
+ return toSVGPaint(this)->cloneForCSSOM();
+#endif
default:
ASSERT(!isSubtypeExposedToCSSOM());
return TextCloneCSSValue::create(classType(), cssText());
}
}
-bool CSSValue::isInvalidCustomPropertyValue() const
-{
- return isCustomPropertyValue() && downcast<CSSCustomPropertyValue>(*this).isInvalid();
-}
-
-bool CSSValue::treatAsInheritedValue(CSSPropertyID propertyID) const
-{
- return classType() == InheritedClass || (classType() == UnsetClass && CSSProperty::isInheritedProperty(propertyID));
-}
-
-bool CSSValue::treatAsInitialValue(CSSPropertyID propertyID) const
-{
- return classType() == InitialClass || (classType() == UnsetClass && !CSSProperty::isInheritedProperty(propertyID));
-}
-
}