String CSSValue::cssText() const { if (m_isTextClone) { ASSERT(isCSSOMSafe()); return toTextCloneCSSValue(this)->cssText(); } ASSERT(!isCSSOMSafe() || isSubtypeExposedToCSSOM()); switch (classType()) { case AspectRatioClass: return toCSSAspectRatioValue(this)->customCSSText(); case BorderImageSliceClass: return toCSSBorderImageSliceValue(this)->customCSSText(); case FontClass: return toCSSFontValue(this)->customCSSText(); case FontFaceSrcClass: return toCSSFontFaceSrcValue(this)->customCSSText(); case FontFeatureClass: return toCSSFontFeatureValue(this)->customCSSText(); case FunctionClass: return toCSSFunctionValue(this)->customCSSText(); case LinearGradientClass: return toCSSLinearGradientValue(this)->customCSSText(); case RadialGradientClass: return toCSSRadialGradientValue(this)->customCSSText(); case CrossfadeClass: return toCSSCrossfadeValue(this)->customCSSText(); case ImageClass: return toCSSImageValue(this)->customCSSText(); case InheritedClass: return toCSSInheritedValue(this)->customCSSText(); case InitialClass: return toCSSInitialValue(this)->customCSSText(); case PrimitiveClass: return toCSSPrimitiveValue(this)->customCSSText(); case ShadowClass: return toCSSShadowValue(this)->customCSSText(); case CubicBezierTimingFunctionClass: return toCSSCubicBezierTimingFunctionValue(this)->customCSSText(); case StepsTimingFunctionClass: return toCSSStepsTimingFunctionValue(this)->customCSSText(); case UnicodeRangeClass: return toCSSUnicodeRangeValue(this)->customCSSText(); case ValueListClass: return toCSSValueList(this)->customCSSText(); case CSSTransformClass: return toCSSTransformValue(this)->customCSSText(); case LineBoxContainClass: return toCSSLineBoxContainValue(this)->customCSSText(); case CalculationClass: return toCSSCalcValue(this)->customCSSText(); case ImageSetClass: return toCSSImageSetValue(this)->customCSSText(); case CSSFilterClass: return toCSSFilterValue(this)->customCSSText(); } ASSERT_NOT_REACHED(); return String(); }
bool CSSValue::equals(const CSSValue& other) const { if (m_isTextClone) { ASSERT(isCSSOMSafe()); return toTextCloneCSSValue(this)->cssText() == other.cssText(); } if (m_classType == other.m_classType) { switch (m_classType) { case AspectRatioClass: return compareCSSValues<CSSAspectRatioValue>(*this, other); case BorderImageSliceClass: return compareCSSValues<CSSBorderImageSliceValue>(*this, other); case FontClass: return compareCSSValues<CSSFontValue>(*this, other); case FontFaceSrcClass: return compareCSSValues<CSSFontFaceSrcValue>(*this, other); case FontFeatureClass: return compareCSSValues<CSSFontFeatureValue>(*this, other); case FunctionClass: return compareCSSValues<CSSFunctionValue>(*this, other); case LinearGradientClass: return compareCSSValues<CSSLinearGradientValue>(*this, other); case RadialGradientClass: return compareCSSValues<CSSRadialGradientValue>(*this, other); case CrossfadeClass: return compareCSSValues<CSSCrossfadeValue>(*this, other); case ImageClass: return compareCSSValues<CSSImageValue>(*this, other); case InheritedClass: return compareCSSValues<CSSInheritedValue>(*this, other); case InitialClass: return compareCSSValues<CSSInitialValue>(*this, other); case PrimitiveClass: return compareCSSValues<CSSPrimitiveValue>(*this, other); case ShadowClass: return compareCSSValues<CSSShadowValue>(*this, other); case CubicBezierTimingFunctionClass: return compareCSSValues<CSSCubicBezierTimingFunctionValue>(*this, other); case StepsTimingFunctionClass: return compareCSSValues<CSSStepsTimingFunctionValue>(*this, other); case UnicodeRangeClass: return compareCSSValues<CSSUnicodeRangeValue>(*this, other); case ValueListClass: return compareCSSValues<CSSValueList>(*this, other); case CSSTransformClass: return compareCSSValues<CSSTransformValue>(*this, other); case LineBoxContainClass: return compareCSSValues<CSSLineBoxContainValue>(*this, other); case CalculationClass: return compareCSSValues<CSSCalcValue>(*this, other); case ImageSetClass: return compareCSSValues<CSSImageSetValue>(*this, other); case CSSFilterClass: return compareCSSValues<CSSFilterValue>(*this, other); default: ASSERT_NOT_REACHED(); return false; } } 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; }
void CSSValue::trace(Visitor* visitor) { if (m_isTextClone) { ASSERT(isCSSOMSafe()); toTextCloneCSSValue(this)->traceAfterDispatch(visitor); return; } ASSERT(!isCSSOMSafe() || isSubtypeExposedToCSSOM()); switch (classType()) { case AspectRatioClass: toCSSAspectRatioValue(this)->traceAfterDispatch(visitor); return; case BorderImageSliceClass: toCSSBorderImageSliceValue(this)->traceAfterDispatch(visitor); return; case CanvasClass: toCSSCanvasValue(this)->traceAfterDispatch(visitor); return; case CursorImageClass: toCSSCursorImageValue(this)->traceAfterDispatch(visitor); return; case FontClass: toCSSFontValue(this)->traceAfterDispatch(visitor); return; case FontFaceSrcClass: toCSSFontFaceSrcValue(this)->traceAfterDispatch(visitor); return; case FontFeatureClass: toCSSFontFeatureValue(this)->traceAfterDispatch(visitor); return; case FunctionClass: toCSSFunctionValue(this)->traceAfterDispatch(visitor); return; case LinearGradientClass: toCSSLinearGradientValue(this)->traceAfterDispatch(visitor); return; case RadialGradientClass: toCSSRadialGradientValue(this)->traceAfterDispatch(visitor); return; case CrossfadeClass: toCSSCrossfadeValue(this)->traceAfterDispatch(visitor); return; case ImageClass: toCSSImageValue(this)->traceAfterDispatch(visitor); return; case InheritedClass: toCSSInheritedValue(this)->traceAfterDispatch(visitor); return; case InitialClass: toCSSInitialValue(this)->traceAfterDispatch(visitor); return; case GridLineNamesClass: toCSSGridLineNamesValue(this)->traceAfterDispatch(visitor); return; case GridTemplateAreasClass: toCSSGridTemplateAreasValue(this)->traceAfterDispatch(visitor); return; case PrimitiveClass: toCSSPrimitiveValue(this)->traceAfterDispatch(visitor); return; case ShadowClass: toCSSShadowValue(this)->traceAfterDispatch(visitor); return; case CubicBezierTimingFunctionClass: toCSSCubicBezierTimingFunctionValue(this)->traceAfterDispatch(visitor); return; case StepsTimingFunctionClass: toCSSStepsTimingFunctionValue(this)->traceAfterDispatch(visitor); return; case UnicodeRangeClass: toCSSUnicodeRangeValue(this)->traceAfterDispatch(visitor); return; case ValueListClass: toCSSValueList(this)->traceAfterDispatch(visitor); return; case CSSTransformClass: toCSSTransformValue(this)->traceAfterDispatch(visitor); return; case LineBoxContainClass: toCSSLineBoxContainValue(this)->traceAfterDispatch(visitor); return; case CalculationClass: toCSSCalcValue(this)->traceAfterDispatch(visitor); return; case ImageSetClass: toCSSImageSetValue(this)->traceAfterDispatch(visitor); return; case CSSFilterClass: toCSSFilterValue(this)->traceAfterDispatch(visitor); return; } ASSERT_NOT_REACHED(); }