bool StyleBuilderConverter::convertGridTrackList(CSSValue* value, Vector<GridTrackSize>& trackSizes, NamedGridLinesMap& namedGridLines, OrderedNamedGridLines& orderedNamedGridLines, StyleResolverState& state) { // Handle 'none'. if (value->isPrimitiveValue()) { CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); return primitiveValue->getValueID() == CSSValueNone; } if (!value->isValueList()) return false; size_t currentNamedGridLine = 0; for (CSSValueListIterator i = value; i.hasMore(); i.advance()) { CSSValue* currValue = i.value(); if (currValue->isGridLineNamesValue()) { CSSGridLineNamesValue* lineNamesValue = toCSSGridLineNamesValue(currValue); for (CSSValueListIterator j = lineNamesValue; j.hasMore(); j.advance()) { String namedGridLine = toCSSPrimitiveValue(j.value())->getStringValue(); NamedGridLinesMap::AddResult result = namedGridLines.add(namedGridLine, Vector<size_t>()); result.storedValue->value.append(currentNamedGridLine); OrderedNamedGridLines::AddResult orderedInsertionResult = orderedNamedGridLines.add(currentNamedGridLine, Vector<String>()); orderedInsertionResult.storedValue->value.append(namedGridLine); } continue; } ++currentNamedGridLine; trackSizes.append(convertGridTrackSize(state, currValue)); } // The parser should have rejected any <track-list> without any <track-size> as // this is not conformant to the syntax. ASSERT(!trackSizes.isEmpty()); return true; }
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(); }
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; #if ENABLE(CSS_GRID_LAYOUT) case GridLineNamesClass: delete toCSSGridLineNamesValue(this); return; case GridTemplateAreasClass: delete toCSSGridTemplateAreasValue(this); return; #endif 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; #endif case SVGColorClass: delete toSVGColor(this); return; case SVGPaintClass: delete toSVGPaint(this); return; } ASSERT_NOT_REACHED(); }
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(); }
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(); }