String CSSVariablesDeclaration::getVariableValue(const String& variableName) { CSSValue* val = m_variablesMap.get(variableName).get(); if (val) return val->cssText(); return ""; }
JSValue jsCSSValueCssText(ExecState* exec, JSValue slotBase, const Identifier&) { JSCSSValue* castedThis = static_cast<JSCSSValue*>(asObject(slotBase)); UNUSED_PARAM(exec); CSSValue* imp = static_cast<CSSValue*>(castedThis->impl()); JSValue result = jsStringOrNull(exec, imp->cssText()); return result; }
bool CSSValue::equals(const CSSValue& other) const { if (m_isTextClone) { ASSERT(isCSSOMSafe()); return static_cast<const TextCloneCSSValue*>(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 CanvasClass: return compareCSSValues<CSSCanvasValue>(*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<FontValue>(*this, other); case FontFaceSrcClass: return compareCSSValues<CSSFontFaceSrcValue>(*this, other); case FontFeatureClass: return compareCSSValues<FontFeatureValue>(*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 ReflectClass: return compareCSSValues<CSSReflectValue>(*this, other); case ShadowClass: return compareCSSValues<ShadowValue>(*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 WebKitCSSTransformClass: return compareCSSValues<WebKitCSSTransformValue>(*this, other); case LineBoxContainClass: return compareCSSValues<CSSLineBoxContainValue>(*this, other); case CalculationClass: return compareCSSValues<CSSCalcValue>(*this, other); #if ENABLE(CSS_IMAGE_SET) case ImageSetClass: return compareCSSValues<CSSImageSetValue>(*this, other); #endif #if ENABLE(CSS_FILTERS) case WebKitCSSFilterClass: return compareCSSValues<WebKitCSSFilterValue>(*this, other); #if ENABLE(CSS_SHADERS) case WebKitCSSArrayFunctionValueClass: return compareCSSValues<WebKitCSSArrayFunctionValue>(*this, other); case WebKitCSSMatFunctionValueClass: return compareCSSValues<WebKitCSSMatFunctionValue>(*this, other); case WebKitCSSMixFunctionValueClass: return compareCSSValues<WebKitCSSMixFunctionValue>(*this, other); case WebKitCSSShaderClass: return compareCSSValues<WebKitCSSShaderValue>(*this, other); #endif #endif #if ENABLE(CSS_VARIABLES) case VariableClass: return compareCSSValues<CSSVariableValue>(*this, other); #endif #if ENABLE(SVG) case SVGColorClass: return compareCSSValues<SVGColor>(*this, other); case SVGPaintClass: return compareCSSValues<SVGPaint>(*this, other); case WebKitCSSSVGDocumentClass: return compareCSSValues<WebKitCSSSVGDocumentValue>(*this, other); #endif default: ASSERT_NOT_REACHED(); return false; } } else if (m_classType == ValueListClass && other.m_classType != ValueListClass) return static_cast<const CSSValueList*>(this)->equals(other); else if (m_classType != ValueListClass && other.m_classType == ValueListClass) return static_cast<const CSSValueList&>(other).equals(*this); return false; }
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; }
static v8::Handle<v8::Value> cssTextAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info) { INC_STATS("DOM.CSSValue.cssText._get"); CSSValue* imp = V8CSSValue::toNative(info.Holder()); return v8StringOrNull(imp->cssText()); }
bool CSSValue::equals(const CSSValue& other) const { if (m_isTextClone) { ASSERT(isCSSOMSafe()); return static_cast<const TextCloneCSSValue*>(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 CanvasClass: return compareCSSValues<CSSCanvasValue>(*this, other); case NamedImageClass: return compareCSSValues<CSSNamedImageValue>(*this, other); case CursorImageClass: return compareCSSValues<CSSCursorImageValue>(*this, other); case FilterImageClass: return compareCSSValues<CSSFilterImageValue>(*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 UnsetClass: return compareCSSValues<CSSUnsetValue>(*this, other); case RevertClass: return compareCSSValues<CSSRevertValue>(*this, other); #if ENABLE(CSS_GRID_LAYOUT) case GridAutoRepeatClass: return compareCSSValues<CSSGridAutoRepeatValue>(*this, other); case GridLineNamesClass: return compareCSSValues<CSSGridLineNamesValue>(*this, other); case GridTemplateAreasClass: return compareCSSValues<CSSGridTemplateAreasValue>(*this, other); #endif case PrimitiveClass: return compareCSSValues<CSSPrimitiveValue>(*this, other); case ReflectClass: return compareCSSValues<CSSReflectValue>(*this, other); case ShadowClass: return compareCSSValues<CSSShadowValue>(*this, other); case CubicBezierTimingFunctionClass: return compareCSSValues<CSSCubicBezierTimingFunctionValue>(*this, other); case StepsTimingFunctionClass: return compareCSSValues<CSSStepsTimingFunctionValue>(*this, other); case SpringTimingFunctionClass: return compareCSSValues<CSSSpringTimingFunctionValue>(*this, other); case UnicodeRangeClass: return compareCSSValues<CSSUnicodeRangeValue>(*this, other); case ValueListClass: return compareCSSValues<CSSValueList>(*this, other); case WebKitCSSTransformClass: return compareCSSValues<WebKitCSSTransformValue>(*this, other); case LineBoxContainClass: return compareCSSValues<CSSLineBoxContainValue>(*this, other); case CalculationClass: return compareCSSValues<CSSCalcValue>(*this, other); case ImageSetClass: return compareCSSValues<CSSImageSetValue>(*this, other); case WebKitCSSFilterClass: return compareCSSValues<WebKitCSSFilterValue>(*this, other); 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)) return static_cast<const CSSValueList&>(other).equals(*this); return false; }