Exemple #1
0
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();
}
TEST(BisonCSSParserTest, ParseAnimationTimingFunctionValue)
{
    RefPtr<CSSValue> timingFunctionValue;
    timingFunctionValue = BisonCSSParser::parseAnimationTimingFunctionValue("ease");
    EXPECT_EQ(CSSValueEase, toCSSPrimitiveValue(timingFunctionValue.get())->getValueID());

    timingFunctionValue = BisonCSSParser::parseAnimationTimingFunctionValue("linear");
    EXPECT_EQ(CSSValueLinear, toCSSPrimitiveValue(timingFunctionValue.get())->getValueID());

    timingFunctionValue = BisonCSSParser::parseAnimationTimingFunctionValue("ease-in");
    EXPECT_EQ(CSSValueEaseIn, toCSSPrimitiveValue(timingFunctionValue.get())->getValueID());

    timingFunctionValue = BisonCSSParser::parseAnimationTimingFunctionValue("ease-out");
    EXPECT_EQ(CSSValueEaseOut, toCSSPrimitiveValue(timingFunctionValue.get())->getValueID());

    timingFunctionValue = BisonCSSParser::parseAnimationTimingFunctionValue("ease-in-out");
    EXPECT_EQ(CSSValueEaseInOut, toCSSPrimitiveValue(timingFunctionValue.get())->getValueID());

    timingFunctionValue = BisonCSSParser::parseAnimationTimingFunctionValue("step-start");
    EXPECT_EQ(CSSValueStepStart, toCSSPrimitiveValue(timingFunctionValue.get())->getValueID());

    timingFunctionValue = BisonCSSParser::parseAnimationTimingFunctionValue("step-middle");
    EXPECT_EQ(CSSValueStepMiddle, toCSSPrimitiveValue(timingFunctionValue.get())->getValueID());

    timingFunctionValue = BisonCSSParser::parseAnimationTimingFunctionValue("step-end");
    EXPECT_EQ(CSSValueStepEnd, toCSSPrimitiveValue(timingFunctionValue.get())->getValueID());

    timingFunctionValue = BisonCSSParser::parseAnimationTimingFunctionValue("steps(3, start)");
    EXPECT_TRUE(CSSStepsTimingFunctionValue::create(3, StepsTimingFunction::StepAtStart)->equals(toCSSStepsTimingFunctionValue(*timingFunctionValue.get())));

    timingFunctionValue = BisonCSSParser::parseAnimationTimingFunctionValue("steps(3, middle)");
    EXPECT_TRUE(CSSStepsTimingFunctionValue::create(3, StepsTimingFunction::StepAtMiddle)->equals(toCSSStepsTimingFunctionValue(*timingFunctionValue.get())));

    timingFunctionValue = BisonCSSParser::parseAnimationTimingFunctionValue("steps(3, end)");
    EXPECT_TRUE(CSSStepsTimingFunctionValue::create(3, StepsTimingFunction::StepAtEnd)->equals(toCSSStepsTimingFunctionValue(*timingFunctionValue.get())));

    timingFunctionValue = BisonCSSParser::parseAnimationTimingFunctionValue("steps(3, nowhere)");
    EXPECT_EQ(0, timingFunctionValue.get());

    timingFunctionValue = BisonCSSParser::parseAnimationTimingFunctionValue("steps(-3, end)");
    EXPECT_EQ(0, timingFunctionValue.get());

    timingFunctionValue = BisonCSSParser::parseAnimationTimingFunctionValue("steps(3)");
    EXPECT_TRUE(CSSStepsTimingFunctionValue::create(3, StepsTimingFunction::StepAtEnd)->equals(toCSSStepsTimingFunctionValue(*timingFunctionValue.get())));

    timingFunctionValue = BisonCSSParser::parseAnimationTimingFunctionValue("cubic-bezier(0.1, 5, 0.23, 0)");
    EXPECT_TRUE(CSSCubicBezierTimingFunctionValue::create(0.1, 5, 0.23, 0)->equals(toCSSCubicBezierTimingFunctionValue(*timingFunctionValue.get())));

    timingFunctionValue = BisonCSSParser::parseAnimationTimingFunctionValue("cubic-bezier(0.1, 0, 4, 0.4)");
    EXPECT_EQ(0, timingFunctionValue.get());
}
Exemple #3
0
PassRefPtr<TimingFunction> CSSToStyleMap::animationTimingFunction(CSSValue* value, bool allowInitial)
{
    if (allowInitial && value->isInitialValue()) {
        return CSSAnimationData::initialAnimationTimingFunction();
    }

    if (value->isPrimitiveValue()) {
        CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
        switch (primitiveValue->getValueID()) {
        case CSSValueLinear:
            return LinearTimingFunction::preset();
            break;
        case CSSValueEase:
            return CubicBezierTimingFunction::preset(CubicBezierTimingFunction::Ease);
            break;
        case CSSValueEaseIn:
            return CubicBezierTimingFunction::preset(CubicBezierTimingFunction::EaseIn);
            break;
        case CSSValueEaseOut:
            return CubicBezierTimingFunction::preset(CubicBezierTimingFunction::EaseOut);
            break;
        case CSSValueEaseInOut:
            return CubicBezierTimingFunction::preset(CubicBezierTimingFunction::EaseInOut);
            break;
        case CSSValueStepStart:
            return StepsTimingFunction::preset(StepsTimingFunction::Start);
            break;
        case CSSValueStepMiddle:
            return StepsTimingFunction::preset(StepsTimingFunction::Middle);
            break;
        case CSSValueStepEnd:
            return StepsTimingFunction::preset(StepsTimingFunction::End);
            break;
        default:
            break;
        }
        return nullptr;
    }

    if (value->isCubicBezierTimingFunctionValue()) {
        CSSCubicBezierTimingFunctionValue* cubicTimingFunction = toCSSCubicBezierTimingFunctionValue(value);
        return CubicBezierTimingFunction::create(cubicTimingFunction->x1(), cubicTimingFunction->y1(), cubicTimingFunction->x2(), cubicTimingFunction->y2());
    } else if (value->isStepsTimingFunctionValue()) {
        CSSStepsTimingFunctionValue* stepsTimingFunction = toCSSStepsTimingFunctionValue(value);
        return StepsTimingFunction::create(stepsTimingFunction->numberOfSteps(), stepsTimingFunction->stepAtPosition());
    }

    return nullptr;
}
Exemple #4
0
PassRefPtr<TimingFunction> CSSToStyleMap::mapAnimationTimingFunction(CSSValue* value, bool allowStepMiddle)
{
    // FIXME: We should probably only call into this function with a valid
    // single timing function value which isn't initial or inherit. We can
    // currently get into here with initial since the parser expands unset
    // properties in shorthands to initial.

    if (value->isPrimitiveValue()) {
        CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
        switch (primitiveValue->getValueID()) {
        case CSSValueLinear:
            return LinearTimingFunction::shared();
        case CSSValueEase:
            return CubicBezierTimingFunction::preset(CubicBezierTimingFunction::Ease);
        case CSSValueEaseIn:
            return CubicBezierTimingFunction::preset(CubicBezierTimingFunction::EaseIn);
        case CSSValueEaseOut:
            return CubicBezierTimingFunction::preset(CubicBezierTimingFunction::EaseOut);
        case CSSValueEaseInOut:
            return CubicBezierTimingFunction::preset(CubicBezierTimingFunction::EaseInOut);
        case CSSValueStepStart:
            return StepsTimingFunction::preset(StepsTimingFunction::Start);
        case CSSValueStepMiddle:
            if (allowStepMiddle)
                return StepsTimingFunction::preset(StepsTimingFunction::Middle);
            return CSSTimingData::initialTimingFunction();
        case CSSValueStepEnd:
            return StepsTimingFunction::preset(StepsTimingFunction::End);
        default:
            ASSERT_NOT_REACHED();
            return CSSTimingData::initialTimingFunction();
        }
    }

    if (value->isCubicBezierTimingFunctionValue()) {
        CSSCubicBezierTimingFunctionValue* cubicTimingFunction = toCSSCubicBezierTimingFunctionValue(value);
        return CubicBezierTimingFunction::create(cubicTimingFunction->x1(), cubicTimingFunction->y1(), cubicTimingFunction->x2(), cubicTimingFunction->y2());
    }

    if (value->isInitialValue())
        return CSSTimingData::initialTimingFunction();

    CSSStepsTimingFunctionValue* stepsTimingFunction = toCSSStepsTimingFunctionValue(value);
    if (stepsTimingFunction->stepAtPosition() == StepsTimingFunction::Middle && !allowStepMiddle)
        return CSSTimingData::initialTimingFunction();
    return StepsTimingFunction::create(stepsTimingFunction->numberOfSteps(), stepsTimingFunction->stepAtPosition());
}
void CSSToStyleMap::mapAnimationTimingFunction(CSSAnimationData* animation, CSSValue* value) const
{
    if (value->isInitialValue()) {
        animation->setTimingFunction(CSSAnimationData::initialAnimationTimingFunction());
        return;
    }

    if (value->isPrimitiveValue()) {
        CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
        switch (primitiveValue->getValueID()) {
        case CSSValueLinear:
            animation->setTimingFunction(LinearTimingFunction::create());
            break;
        case CSSValueEase:
            animation->setTimingFunction(CubicBezierTimingFunction::preset(CubicBezierTimingFunction::Ease));
            break;
        case CSSValueEaseIn:
            animation->setTimingFunction(CubicBezierTimingFunction::preset(CubicBezierTimingFunction::EaseIn));
            break;
        case CSSValueEaseOut:
            animation->setTimingFunction(CubicBezierTimingFunction::preset(CubicBezierTimingFunction::EaseOut));
            break;
        case CSSValueEaseInOut:
            animation->setTimingFunction(CubicBezierTimingFunction::preset(CubicBezierTimingFunction::EaseInOut));
            break;
        case CSSValueStepStart:
            animation->setTimingFunction(StepsTimingFunction::preset(StepsTimingFunction::Start));
            break;
        case CSSValueStepEnd:
            animation->setTimingFunction(StepsTimingFunction::preset(StepsTimingFunction::End));
            break;
        default:
            break;
        }
        return;
    }

    if (value->isCubicBezierTimingFunctionValue()) {
        CSSCubicBezierTimingFunctionValue* cubicTimingFunction = toCSSCubicBezierTimingFunctionValue(value);
        animation->setTimingFunction(CubicBezierTimingFunction::create(cubicTimingFunction->x1(), cubicTimingFunction->y1(), cubicTimingFunction->x2(), cubicTimingFunction->y2()));
    } else if (value->isStepsTimingFunctionValue()) {
        CSSStepsTimingFunctionValue* stepsTimingFunction = toCSSStepsTimingFunctionValue(value);
        animation->setTimingFunction(StepsTimingFunction::create(stepsTimingFunction->numberOfSteps(), stepsTimingFunction->stepAtStart()));
    }
}
Exemple #6
0
void CSSValue::finalizeGarbageCollectedObject() {
  switch (getClassType()) {
    case BasicShapeCircleClass:
      toCSSBasicShapeCircleValue(this)->~CSSBasicShapeCircleValue();
      return;
    case BasicShapeEllipseClass:
      toCSSBasicShapeEllipseValue(this)->~CSSBasicShapeEllipseValue();
      return;
    case BasicShapePolygonClass:
      toCSSBasicShapePolygonValue(this)->~CSSBasicShapePolygonValue();
      return;
    case BasicShapeInsetClass:
      toCSSBasicShapeInsetValue(this)->~CSSBasicShapeInsetValue();
      return;
    case BorderImageSliceClass:
      toCSSBorderImageSliceValue(this)->~CSSBorderImageSliceValue();
      return;
    case ColorClass:
      toCSSColorValue(this)->~CSSColorValue();
      return;
    case CounterClass:
      toCSSCounterValue(this)->~CSSCounterValue();
      return;
    case CursorImageClass:
      toCSSCursorImageValue(this)->~CSSCursorImageValue();
      return;
    case FontFaceSrcClass:
      toCSSFontFaceSrcValue(this)->~CSSFontFaceSrcValue();
      return;
    case FontFamilyClass:
      toCSSFontFamilyValue(this)->~CSSFontFamilyValue();
      return;
    case FontFeatureClass:
      toCSSFontFeatureValue(this)->~CSSFontFeatureValue();
      return;
    case FunctionClass:
      toCSSFunctionValue(this)->~CSSFunctionValue();
      return;
    case LinearGradientClass:
      toCSSLinearGradientValue(this)->~CSSLinearGradientValue();
      return;
    case RadialGradientClass:
      toCSSRadialGradientValue(this)->~CSSRadialGradientValue();
      return;
    case CrossfadeClass:
      toCSSCrossfadeValue(this)->~CSSCrossfadeValue();
      return;
    case PaintClass:
      toCSSPaintValue(this)->~CSSPaintValue();
      return;
    case CustomIdentClass:
      toCSSCustomIdentValue(this)->~CSSCustomIdentValue();
      return;
    case ImageClass:
      toCSSImageValue(this)->~CSSImageValue();
      return;
    case InheritedClass:
      toCSSInheritedValue(this)->~CSSInheritedValue();
      return;
    case InitialClass:
      toCSSInitialValue(this)->~CSSInitialValue();
      return;
    case UnsetClass:
      toCSSUnsetValue(this)->~CSSUnsetValue();
      return;
    case GridAutoRepeatClass:
      toCSSGridAutoRepeatValue(this)->~CSSGridAutoRepeatValue();
      return;
    case GridLineNamesClass:
      toCSSGridLineNamesValue(this)->~CSSGridLineNamesValue();
      return;
    case GridTemplateAreasClass:
      toCSSGridTemplateAreasValue(this)->~CSSGridTemplateAreasValue();
      return;
    case PathClass:
      toCSSPathValue(this)->~CSSPathValue();
      return;
    case PrimitiveClass:
      toCSSPrimitiveValue(this)->~CSSPrimitiveValue();
      return;
    case IdentifierClass:
      toCSSIdentifierValue(this)->~CSSIdentifierValue();
      return;
    case QuadClass:
      toCSSQuadValue(this)->~CSSQuadValue();
      return;
    case ReflectClass:
      toCSSReflectValue(this)->~CSSReflectValue();
      return;
    case ShadowClass:
      toCSSShadowValue(this)->~CSSShadowValue();
      return;
    case StringClass:
      toCSSStringValue(this)->~CSSStringValue();
      return;
    case CubicBezierTimingFunctionClass:
      toCSSCubicBezierTimingFunctionValue(this)
          ->~CSSCubicBezierTimingFunctionValue();
      return;
    case StepsTimingFunctionClass:
      toCSSStepsTimingFunctionValue(this)->~CSSStepsTimingFunctionValue();
      return;
    case UnicodeRangeClass:
      toCSSUnicodeRangeValue(this)->~CSSUnicodeRangeValue();
      return;
    case URIClass:
      toCSSURIValue(this)->~CSSURIValue();
      return;
    case ValueListClass:
      toCSSValueList(this)->~CSSValueList();
      return;
    case ValuePairClass:
      toCSSValuePair(this)->~CSSValuePair();
      return;
    case ImageSetClass:
      toCSSImageSetValue(this)->~CSSImageSetValue();
      return;
    case CSSContentDistributionClass:
      toCSSContentDistributionValue(this)->~CSSContentDistributionValue();
      return;
    case VariableReferenceClass:
      toCSSVariableReferenceValue(this)->~CSSVariableReferenceValue();
      return;
    case CustomPropertyDeclarationClass:
      toCSSCustomPropertyDeclaration(this)->~CSSCustomPropertyDeclaration();
      return;
    case PendingSubstitutionValueClass:
      toCSSPendingSubstitutionValue(this)->~CSSPendingSubstitutionValue();
      return;
  }
  ASSERT_NOT_REACHED();
}
Exemple #7
0
void CSSValue::finalizeGarbageCollectedObject()
{
    switch (classType()) {
    case BorderImageSliceClass:
        toCSSBorderImageSliceValue(this)->~CSSBorderImageSliceValue();
        return;
    case CanvasClass:
        toCSSCanvasValue(this)->~CSSCanvasValue();
        return;
    case CounterClass:
        toCSSCounterValue(this)->~CSSCounterValue();
        return;
    case CursorImageClass:
        toCSSCursorImageValue(this)->~CSSCursorImageValue();
        return;
    case FontFaceSrcClass:
        toCSSFontFaceSrcValue(this)->~CSSFontFaceSrcValue();
        return;
    case FontFeatureClass:
        toCSSFontFeatureValue(this)->~CSSFontFeatureValue();
        return;
    case FunctionClass:
        toCSSFunctionValue(this)->~CSSFunctionValue();
        return;
    case LinearGradientClass:
        toCSSLinearGradientValue(this)->~CSSLinearGradientValue();
        return;
    case RadialGradientClass:
        toCSSRadialGradientValue(this)->~CSSRadialGradientValue();
        return;
    case CrossfadeClass:
        toCSSCrossfadeValue(this)->~CSSCrossfadeValue();
        return;
    case ImageClass:
        toCSSImageValue(this)->~CSSImageValue();
        return;
    case InheritedClass:
        toCSSInheritedValue(this)->~CSSInheritedValue();
        return;
    case InitialClass:
        toCSSInitialValue(this)->~CSSInitialValue();
        return;
    case UnsetClass:
        toCSSUnsetValue(this)->~CSSUnsetValue();
        return;
    case GridLineNamesClass:
        toCSSGridLineNamesValue(this)->~CSSGridLineNamesValue();
        return;
    case GridTemplateAreasClass:
        toCSSGridTemplateAreasValue(this)->~CSSGridTemplateAreasValue();
        return;
    case PathClass:
        toCSSPathValue(this)->~CSSPathValue();
        return;
    case PrimitiveClass:
        toCSSPrimitiveValue(this)->~CSSPrimitiveValue();
        return;
    case QuadClass:
        toCSSQuadValue(this)->~CSSQuadValue();
        return;
    case ReflectClass:
        toCSSReflectValue(this)->~CSSReflectValue();
        return;
    case ShadowClass:
        toCSSShadowValue(this)->~CSSShadowValue();
        return;
    case CubicBezierTimingFunctionClass:
        toCSSCubicBezierTimingFunctionValue(this)->~CSSCubicBezierTimingFunctionValue();
        return;
    case StepsTimingFunctionClass:
        toCSSStepsTimingFunctionValue(this)->~CSSStepsTimingFunctionValue();
        return;
    case UnicodeRangeClass:
        toCSSUnicodeRangeValue(this)->~CSSUnicodeRangeValue();
        return;
    case ValueListClass:
        toCSSValueList(this)->~CSSValueList();
        return;
    case ValuePairClass:
        toCSSValuePair(this)->~CSSValuePair();
        return;
    case ImageSetClass:
        toCSSImageSetValue(this)->~CSSImageSetValue();
        return;
    case CSSSVGDocumentClass:
        toCSSSVGDocumentValue(this)->~CSSSVGDocumentValue();
        return;
    case CSSContentDistributionClass:
        toCSSContentDistributionValue(this)->~CSSContentDistributionValue();
        return;
    }
    ASSERT_NOT_REACHED();
}
Exemple #8
0
void CSSValue::destroy()
{
    if (m_isTextClone) {
        ASSERT(isCSSOMSafe());
        delete static_cast<TextCloneCSSValue*>(this);
        return;
    }
    ASSERT(!isCSSOMSafe() || isSubtypeExposedToCSSOM());

    switch (classType()) {
    case AspectRatioClass:
        delete toCSSAspectRatioValue(this);
        return;
    case BorderImageSliceClass:
        delete toCSSBorderImageSliceValue(this);
        return;
    case CanvasClass:
        delete toCSSCanvasValue(this);
        return;
    case CursorImageClass:
        delete toCSSCursorImageValue(this);
        return;
    case FontClass:
        delete toCSSFontValue(this);
        return;
    case FontFaceSrcClass:
        delete toCSSFontFaceSrcValue(this);
        return;
    case FontFeatureClass:
        delete toCSSFontFeatureValue(this);
        return;
    case FunctionClass:
        delete toCSSFunctionValue(this);
        return;
    case LinearGradientClass:
        delete toCSSLinearGradientValue(this);
        return;
    case RadialGradientClass:
        delete toCSSRadialGradientValue(this);
        return;
    case CrossfadeClass:
        delete toCSSCrossfadeValue(this);
        return;
    case ImageClass:
        delete toCSSImageValue(this);
        return;
    case InheritedClass:
        delete toCSSInheritedValue(this);
        return;
    case InitialClass:
        delete toCSSInitialValue(this);
        return;
    case GridTemplateClass:
        delete toCSSGridTemplateValue(this);
        return;
    case PrimitiveClass:
        delete toCSSPrimitiveValue(this);
        return;
    case ReflectClass:
        delete toCSSReflectValue(this);
        return;
    case ShadowClass:
        delete toCSSShadowValue(this);
        return;
    case CubicBezierTimingFunctionClass:
        delete toCSSCubicBezierTimingFunctionValue(this);
        return;
    case StepsTimingFunctionClass:
        delete toCSSStepsTimingFunctionValue(this);
        return;
    case UnicodeRangeClass:
        delete toCSSUnicodeRangeValue(this);
        return;
    case ValueListClass:
        delete toCSSValueList(this);
        return;
    case WebKitCSSTransformClass:
        delete toWebKitCSSTransformValue(this);
        return;
    case LineBoxContainClass:
        delete toCSSLineBoxContainValue(this);
        return;
    case CalculationClass:
        delete toCSSCalcValue(this);
        return;
#if ENABLE(CSS_IMAGE_SET)
    case ImageSetClass:
        delete toCSSImageSetValue(this);
        return;
#endif
#if ENABLE(CSS_FILTERS)
    case FilterImageClass:
        delete toCSSFilterImageValue(this);
        return;
    case WebKitCSSFilterClass:
        delete toWebKitCSSFilterValue(this);
        return;
#if ENABLE(CSS_SHADERS)
    case WebKitCSSArrayFunctionValueClass:
        delete toWebKitCSSArrayFunctionValue(this);
        return;
    case WebKitCSSMatFunctionValueClass:
        delete toWebKitCSSMatFunctionValue(this);
        return;
    case WebKitCSSMixFunctionValueClass:
        delete toWebKitCSSMixFunctionValue(this);
        return;
    case WebKitCSSShaderClass:
        delete toWebKitCSSShaderValue(this);
        return;
#endif
#endif
#if ENABLE(SVG)
    case SVGColorClass:
        delete toSVGColor(this);
        return;
    case SVGPaintClass:
        delete toSVGPaint(this);
        return;
    case WebKitCSSSVGDocumentClass:
        delete toWebKitCSSSVGDocumentValue(this);
        return;
#endif
    }
    ASSERT_NOT_REACHED();
}
Exemple #9
0
String CSSValue::cssText() const
{
    if (m_isTextClone) {
         ASSERT(isCSSOMSafe());
        return static_cast<const TextCloneCSSValue*>(this)->cssText();
    }
    ASSERT(!isCSSOMSafe() || isSubtypeExposedToCSSOM());

    switch (classType()) {
    case AspectRatioClass:
        return toCSSAspectRatioValue(this)->customCSSText();
    case BorderImageSliceClass:
        return toCSSBorderImageSliceValue(this)->customCSSText();
    case CanvasClass:
        return toCSSCanvasValue(this)->customCSSText();
    case CursorImageClass:
        return toCSSCursorImageValue(this)->customCSSText();
#if ENABLE(CSS_FILTERS)
    case FilterImageClass:
        return toCSSFilterImageValue(this)->customCSSText();
#endif
    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();
#if ENABLE(CSS_GRID_LAYOUT)
    case GridLineNamesClass:
        return toCSSGridLineNamesValue(this)->customCSSText();
    case GridTemplateAreasClass:
        return toCSSGridTemplateAreasValue(this)->customCSSText();
#endif
    case PrimitiveClass:
        return toCSSPrimitiveValue(this)->customCSSText();
    case ReflectClass:
        return toCSSReflectValue(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 WebKitCSSTransformClass:
        return toWebKitCSSTransformValue(this)->customCSSText();
    case LineBoxContainClass:
        return toCSSLineBoxContainValue(this)->customCSSText();
    case CalculationClass:
        return toCSSCalcValue(this)->customCSSText();
#if ENABLE(CSS_IMAGE_SET)
    case ImageSetClass:
        return toCSSImageSetValue(this)->customCSSText();
#endif
#if ENABLE(CSS_FILTERS)
    case WebKitCSSFilterClass:
        return toWebKitCSSFilterValue(this)->customCSSText();
#endif
    case SVGColorClass:
        return toSVGColor(this)->customCSSText();
    case SVGPaintClass:
        return toSVGPaint(this)->customCSSText();
    }
    ASSERT_NOT_REACHED();
    return String();
}
Exemple #10
0
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();
}