Changeset 156253 in webkit
- Timestamp:
- Sep 22, 2013, 6:20:19 PM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 45 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r156252 r156253 1 2013-09-22 Gyuyoung Kim <[email protected]> 2 3 Introduce CSS_VALUE_TYPE_CASTS macro in order to cast CSSValue type 4 https://bugs.webkit.org/show_bug.cgi?id=121462 5 6 Reviewed by Andreas Kling. 7 8 As r155429 introduced ELEMENT_TYPE_CASTS, CSS_VALUE_TYPE_CASTS can be used 9 by css value type casting as well. This type cast macros will help to detect 10 bad-cast bugs as well as improve a code readibility. 11 12 This patch adds the following methods, 13 14 - CSSFooValue* toCSSFooValue(CSSValue*) 15 - const CSSFooValue* toCSSFooValue(const CSSValue*) 16 17 To be consistent with other is*Value() naming style, isCSSLineBoxContainValue() and isCalculationValue() 18 are changed with isLineBoxContainValue() and isCalcValue(). 19 20 FontValue, FontFeatureValue, ShadowValue have a manual type case function because of different 21 class naming style. So, toFontValue(), toFontFeatureValue() and toShadowValue() are added manually. 22 23 This patch removes unnecessary local variables. 24 25 No new tests, no behavior change. 26 27 * css/CSSAspectRatioValue.h: 28 * css/CSSBorderImageSliceValue.h: 29 * css/CSSCalculationValue.cpp: 30 (WebCore::CSSCalcExpressionNodeParser::parseValue): 31 * css/CSSCalculationValue.h: 32 * css/CSSCrossfadeValue.cpp: 33 (WebCore::subimageKnownToBeOpaque): 34 * css/CSSCrossfadeValue.h: 35 * css/CSSCursorImageValue.cpp: 36 (WebCore::CSSCursorImageValue::~CSSCursorImageValue): 37 (WebCore::CSSCursorImageValue::updateIfSVGCursorIsUsed): 38 (WebCore::CSSCursorImageValue::cachedImage): 39 (WebCore::CSSCursorImageValue::cachedOrPendingImage): 40 (WebCore::CSSCursorImageValue::isSVGCursor): 41 * css/CSSCursorImageValue.h: 42 * css/CSSFilterImageValue.h: 43 * css/CSSFontSelector.cpp: 44 (WebCore::CSSFontSelector::addFontFaceRule): 45 * css/CSSGradientValue.h: 46 * css/CSSImageGeneratorValue.cpp: 47 (WebCore::CSSImageGeneratorValue::image): 48 (WebCore::CSSImageGeneratorValue::fixedSize): 49 (WebCore::CSSImageGeneratorValue::loadSubimages): 50 (WebCore::CSSImageGeneratorValue::subimageIsPending): 51 (WebCore::CSSImageGeneratorValue::cachedImageForCSSValue): 52 * css/CSSImageGeneratorValue.h: 53 * css/CSSImageSetValue.cpp: 54 (WebCore::CSSImageSetValue::fillImageSet): 55 * css/CSSImageSetValue.h: 56 * css/CSSImageValue.h: 57 * css/CSSInheritedValue.h: 58 * css/CSSInitialValue.h: 59 * css/CSSLineBoxContainValue.h: 60 * css/CSSParser.cpp: 61 (WebCore::CSSParser::parseColor): 62 (WebCore::CSSParser::addProperty): 63 (WebCore::CSSParser::parse3ValuesFillPosition): 64 (WebCore::CSSParser::parseFillPosition): 65 (WebCore::CSSParser::parseFillRepeat): 66 (WebCore::CSSParser::parseDeprecatedRadialGradient): 67 (WebCore::CSSParser::parseRadialGradient): 68 * css/CSSPrimitiveValue.h: 69 * css/CSSReflectValue.h: 70 * css/CSSToStyleMap.cpp: 71 (WebCore::CSSToStyleMap::mapFillAttachment): 72 (WebCore::CSSToStyleMap::mapFillClip): 73 (WebCore::CSSToStyleMap::mapFillComposite): 74 (WebCore::CSSToStyleMap::mapFillBlendMode): 75 (WebCore::CSSToStyleMap::mapFillOrigin): 76 (WebCore::CSSToStyleMap::mapFillRepeatX): 77 (WebCore::CSSToStyleMap::mapFillRepeatY): 78 (WebCore::CSSToStyleMap::mapFillSize): 79 (WebCore::CSSToStyleMap::mapFillXPosition): 80 (WebCore::CSSToStyleMap::mapFillYPosition): 81 (WebCore::CSSToStyleMap::mapFillMaskSourceType): 82 (WebCore::CSSToStyleMap::mapAnimationDelay): 83 (WebCore::CSSToStyleMap::mapAnimationDirection): 84 (WebCore::CSSToStyleMap::mapAnimationDuration): 85 (WebCore::CSSToStyleMap::mapAnimationFillMode): 86 (WebCore::CSSToStyleMap::mapAnimationIterationCount): 87 (WebCore::CSSToStyleMap::mapAnimationName): 88 (WebCore::CSSToStyleMap::mapAnimationPlayState): 89 (WebCore::CSSToStyleMap::mapAnimationProperty): 90 (WebCore::CSSToStyleMap::mapAnimationTimingFunction): 91 (WebCore::CSSToStyleMap::mapNinePieceImageSlice): 92 (WebCore::CSSToStyleMap::mapNinePieceImageQuad): 93 (WebCore::CSSToStyleMap::mapNinePieceImageRepeat): 94 * css/CSSValue.cpp: 95 (WebCore::CSSValue::destroy): 96 * css/CSSValue.h: 97 (WebCore::CSSValue::isLineBoxContainValue): 98 (WebCore::CSSValue::isCalcValue): 99 * css/CSSValueList.h: 100 * css/CSSVariableValue.h: 101 * css/DeprecatedStyleBuilder.cpp: 102 (WebCore::ApplyPropertyDefault::applyValue): 103 (WebCore::ApplyPropertyNumber::applyValue): 104 (WebCore::ApplyPropertyAuto::applyValue): 105 (WebCore::ApplyPropertyClip::applyValue): 106 (WebCore::ApplyPropertyColor::applyValue): 107 (WebCore::ApplyPropertyLength::applyValue): 108 (WebCore::ApplyPropertyString::applyValue): 109 (WebCore::ApplyPropertyBorderRadius::applyValue): 110 (WebCore::ApplyPropertyComputeLength::applyValue): 111 (WebCore::ApplyPropertyFont::applyValue): 112 (WebCore::ApplyPropertyFontFamily::applyValue): 113 (WebCore::ApplyPropertyFontSize::applyValue): 114 (WebCore::ApplyPropertyFontWeight::applyValue): 115 (WebCore::ApplyPropertyFontVariantLigatures::applyValue): 116 (WebCore::ApplyPropertyCounter::applyValue): 117 (WebCore::ApplyPropertyCursor::applyValue): 118 (WebCore::ApplyPropertyTextAlign::applyValue): 119 (WebCore::ApplyPropertyTextDecoration::applyValue): 120 (WebCore::ApplyPropertyMarqueeIncrement::applyValue): 121 (WebCore::ApplyPropertyMarqueeRepetition::applyValue): 122 (WebCore::ApplyPropertyMarqueeSpeed::applyValue): 123 (WebCore::ApplyPropertyTextUnderlinePosition::applyValue): 124 (WebCore::ApplyPropertyLineHeight::applyValue): 125 (WebCore::ApplyPropertyLineHeightForIOSTextAutosizing::applyValue): 126 (WebCore::ApplyPropertyPageSize::applyValue): 127 (WebCore::ApplyPropertyTextEmphasisStyle::applyValue): 128 (WebCore::ApplyPropertyResize::applyValue): 129 (WebCore::ApplyPropertyVerticalAlign::applyValue): 130 (WebCore::ApplyPropertyAspectRatio::applyValue): 131 (WebCore::ApplyPropertyZoom::applyValue): 132 (WebCore::ApplyPropertyDisplay::applyValue): 133 (WebCore::ApplyPropertyClipPath::applyValue): 134 (WebCore::ApplyPropertyShape::applyValue): 135 (WebCore::ApplyPropertyImageResolution::applyValue): 136 (WebCore::ApplyPropertyTextIndent::applyValue): 137 * css/FontFeatureValue.h: 138 (WebCore::toFontFeatureValue): 139 * css/FontValue.h: 140 (WebCore::toFontValue): 141 * css/MediaList.cpp: 142 (WebCore::reportMediaQueryWarningIfNeeded): 143 * css/MediaQueryEvaluator.cpp: 144 (WebCore::compareAspectRatioValue): 145 (WebCore::numberValue): 146 (WebCore::orientationMediaFeatureEval): 147 (WebCore::evalResolution): 148 (WebCore::device_pixel_ratioMediaFeatureEval): 149 (WebCore::resolutionMediaFeatureEval): 150 (WebCore::computeLength): 151 (WebCore::view_modeMediaFeatureEval): 152 (WebCore::pointerMediaFeatureEval): 153 * css/SVGCSSStyleSelector.cpp: 154 (WebCore::StyleResolver::applySVGProperty): 155 * css/ShadowValue.h: 156 (WebCore::toShadowValue): 157 * css/StylePropertySet.cpp: 158 (WebCore::StylePropertySet::getLayeredShorthandValue): 159 * css/StyleResolver.cpp: 160 (WebCore::createGridTrackSize): 161 (WebCore::createGridTrackList): 162 (WebCore::createGridPosition): 163 (WebCore::hasVariableReference): 164 (WebCore::StyleResolver::applyProperty): 165 (WebCore::StyleResolver::styleImage): 166 (WebCore::StyleResolver::generatedOrPendingFromValue): 167 (WebCore::StyleResolver::styleShader): 168 (WebCore::StyleResolver::parseCustomFilterArrayParameter): 169 (WebCore::StyleResolver::parseCustomFilterColorParameter): 170 (WebCore::StyleResolver::parseCustomFilterNumberParameter): 171 (WebCore::StyleResolver::parseCustomFilterParameter): 172 (WebCore::StyleResolver::parseCustomFilterParameterList): 173 (WebCore::StyleResolver::createCustomFilterOperationWithInlineSyntax): 174 (WebCore::StyleResolver::createFilterOperations): 175 * css/TransformFunctions.cpp: 176 (WebCore::transformsForValue): 177 * css/ViewportStyleResolver.cpp: 178 (WebCore::ViewportStyleResolver::getViewportArgumentValue): 179 * css/WebKitCSSMatrix.cpp: 180 (WebCore::WebKitCSSMatrix::setMatrixValue): 181 * css/WebKitCSSShaderValue.h: 182 (WebCore::toWebKitCSSShaderValue): 183 * editing/ApplyStyleCommand.cpp: 184 (WebCore::ApplyStyleCommand::computedFontSize): 185 * editing/EditingStyle.cpp: 186 (WebCore::identifierForStyleProperty): 187 (WebCore::HTMLElementEquivalent::valueIsPresentInStyle): 188 (WebCore::cssValueToRGBA): 189 (WebCore::EditingStyle::extractFontSizeDelta): 190 (WebCore::EditingStyle::textDirection): 191 (WebCore::EditingStyle::prepareToApplyAt): 192 (WebCore::EditingStyle::mergeStyleFromRulesForSerialization): 193 (WebCore::EditingStyle::legacyFontSize): 194 (WebCore::EditingStyle::textDirectionForSelection): 195 (WebCore::StyleChange::extractTextStyles): 196 (WebCore::fontWeightIsBold): 197 (WebCore::isTransparentColorValue): 198 * editing/markup.cpp: 199 (WebCore::propertyMissingOrEqualToNone): 200 * page/PageSerializer.cpp: 201 (WebCore::PageSerializer::retrieveResourcesForProperties): 202 * rendering/style/StylePendingImage.h: 203 (WebCore::StylePendingImage::data): 204 (WebCore::StylePendingImage::cssImageValue): 205 (WebCore::StylePendingImage::cssImageGeneratorValue): 206 (WebCore::StylePendingImage::cssCursorImageValue): 207 (WebCore::StylePendingImage::cssImageSetValue): 208 1 209 2013-09-22 Arunprasad Rajkumar <[email protected]> 2 210 -
trunk/Source/WebCore/css/CSSAspectRatioValue.h
r155060 r156253 61 61 }; 62 62 63 CSS_VALUE_TYPE_CASTS(AspectRatioValue) 64 63 65 } 64 66 -
trunk/Source/WebCore/css/CSSBorderImageSliceValue.h
r155060 r156253 57 57 }; 58 58 59 CSS_VALUE_TYPE_CASTS(BorderImageSliceValue) 60 59 61 } // namespace WebCore 60 62 -
trunk/Source/WebCore/css/CSSCalculationValue.cpp
r155060 r156253 450 450 return false; 451 451 452 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value.get()); 453 result->value = CSSCalcPrimitiveValue::create(primitiveValue, parserValue->isInt); 452 result->value = CSSCalcPrimitiveValue::create(toCSSPrimitiveValue(value.get()), parserValue->isInt); 454 453 455 454 ++*index; -
trunk/Source/WebCore/css/CSSCalculationValue.h
r155060 r156253 128 128 const bool m_nonNegative; 129 129 }; 130 131 CSS_VALUE_TYPE_CASTS(CalcValue) 130 132 131 133 } // namespace WebCore -
trunk/Source/WebCore/css/CSSCrossfadeValue.cpp
r155100 r156253 48 48 { 49 49 if (value->isImageValue()) 50 return static_cast<CSSImageValue*>(value)->knownToBeOpaque(renderer);50 return toCSSImageValue(value)->knownToBeOpaque(renderer); 51 51 52 52 if (value->isImageGeneratorValue()) 53 return static_cast<CSSImageGeneratorValue*>(value)->knownToBeOpaque(renderer);53 return toCSSImageGeneratorValue(value)->knownToBeOpaque(renderer); 54 54 55 55 ASSERT_NOT_REACHED(); -
trunk/Source/WebCore/css/CSSCrossfadeValue.h
r155100 r156253 111 111 }; 112 112 113 inline CSSCrossfadeValue* toCSSCrossfadeValue(CSSImageGeneratorValue* value) 114 { 115 ASSERT_WITH_SECURITY_IMPLICATION(!value || value->isCrossfadeValue()); 116 return static_cast<CSSCrossfadeValue*>(value); 117 } 113 CSS_VALUE_TYPE_CASTS(CrossfadeValue) 118 114 119 115 } // namespace WebCore -
trunk/Source/WebCore/css/CSSCursorImageValue.cpp
r155412 r156253 76 76 HashSet<SVGElement*>::const_iterator it = m_referencedElements.begin(); 77 77 HashSet<SVGElement*>::const_iterator end = m_referencedElements.end(); 78 String url = static_cast<CSSImageValue*>(m_imageValue.get())->url();78 String url = toCSSImageValue(m_imageValue.get())->url(); 79 79 80 80 for (; it != end; ++it) { … … 111 111 return false; 112 112 113 String url = static_cast<CSSImageValue*>(m_imageValue.get())->url();113 String url = toCSSImageValue(m_imageValue.get())->url(); 114 114 if (SVGCursorElement* cursorElement = resourceReferencedByCursorElement(url, &element->document())) { 115 115 // FIXME: This will override hot spot specified in CSS, which is probably incorrect. … … 140 140 #if ENABLE(CSS_IMAGE_SET) 141 141 if (m_imageValue->isImageSetValue()) 142 return static_cast<CSSImageSetValue*>(m_imageValue.get())->cachedImageSet(loader);142 return toCSSImageSetValue(m_imageValue.get())->cachedImageSet(loader); 143 143 #endif 144 144 … … 151 151 // we create an alternate CSSImageValue to use. 152 152 if (isSVGCursor() && loader && loader->document()) { 153 RefPtr<CSSImageValue> imageValue = static_cast<CSSImageValue*>(m_imageValue.get());153 RefPtr<CSSImageValue> imageValue = toCSSImageValue(m_imageValue.get()); 154 154 // FIXME: This will fail if the <cursor> element is in a shadow DOM (bug 59827) 155 155 if (SVGCursorElement* cursorElement = resourceReferencedByCursorElement(imageValue->url(), loader->document())) { … … 163 163 164 164 if (m_imageValue->isImageValue()) 165 m_image = static_cast<CSSImageValue*>(m_imageValue.get())->cachedImage(loader);165 m_image = toCSSImageValue(m_imageValue.get())->cachedImage(loader); 166 166 } 167 167 … … 177 177 // Need to delegate completely so that changes in device scale factor can be handled appropriately. 178 178 if (m_imageValue->isImageSetValue()) 179 return static_cast<CSSImageSetValue*>(m_imageValue.get())->cachedOrPendingImageSet(document);179 return toCSSImageSetValue(m_imageValue.get())->cachedOrPendingImageSet(document); 180 180 #endif 181 181 … … 190 190 { 191 191 if (m_imageValue->isImageValue()) { 192 RefPtr<CSSImageValue> imageValue = static_cast<CSSImageValue*>(m_imageValue.get());192 RefPtr<CSSImageValue> imageValue = toCSSImageValue(m_imageValue.get()); 193 193 KURL kurl(ParsedURLString, imageValue->url()); 194 194 return kurl.hasFragmentIdentifier(); -
trunk/Source/WebCore/css/CSSCursorImageValue.h
r155060 r156253 83 83 }; 84 84 85 CSS_VALUE_TYPE_CASTS(CursorImageValue) 86 85 87 } // namespace WebCore 86 88 -
trunk/Source/WebCore/css/CSSFilterImageValue.h
r155060 r156253 120 120 }; 121 121 122 inline CSSFilterImageValue* toCSSFilterImageValue(CSSImageGeneratorValue* value) 123 { 124 ASSERT_WITH_SECURITY_IMPLICATION(!value || value->isFilterImageValue()); 125 return static_cast<CSSFilterImageValue*>(value); 126 } 122 CSS_VALUE_TYPE_CASTS(FilterImageValue) 127 123 128 124 } // namespace WebCore -
trunk/Source/WebCore/css/CSSFontSelector.cpp
r155729 r156253 117 117 return; 118 118 119 switch ( static_cast<CSSPrimitiveValue*>(fontStyle.get())->getValueID()) {119 switch (toCSSPrimitiveValue(fontStyle.get())->getValueID()) { 120 120 case CSSValueNormal: 121 121 traitsMask |= FontStyleNormalMask; … … 135 135 return; 136 136 137 switch ( static_cast<CSSPrimitiveValue*>(fontWeight.get())->getValueID()) {137 switch (toCSSPrimitiveValue(fontWeight.get())->getValueID()) { 138 138 case CSSValueBold: 139 139 case CSSValue700: … … 186 186 187 187 for (unsigned i = 0; i < numVariants; ++i) { 188 switch ( static_cast<CSSPrimitiveValue*>(variantList->itemWithoutBoundsCheck(i))->getValueID()) {188 switch (toCSSPrimitiveValue(variantList->itemWithoutBoundsCheck(i))->getValueID()) { 189 189 case CSSValueNormal: 190 190 traitsMask |= FontVariantNormalMask; … … 266 266 int familyLength = familyList->length(); 267 267 for (int i = 0; i < familyLength; i++) { 268 CSSPrimitiveValue* item = static_cast<CSSPrimitiveValue*>(familyList->itemWithoutBoundsCheck(i));268 CSSPrimitiveValue* item = toCSSPrimitiveValue(familyList->itemWithoutBoundsCheck(i)); 269 269 String familyName; 270 270 if (item->isString()) { -
trunk/Source/WebCore/css/CSSGradientValue.h
r155060 r156253 233 233 }; 234 234 235 CSS_VALUE_TYPE_CASTS(GradientValue) 236 235 237 } // namespace WebCore 236 238 -
trunk/Source/WebCore/css/CSSImageGeneratorValue.cpp
r156226 r156253 111 111 return static_cast<CSSCanvasValue*>(this)->image(renderer, size); 112 112 case CrossfadeClass: 113 return static_cast<CSSCrossfadeValue*>(this)->image(renderer, size);114 #if ENABLE(CSS_FILTERS) 115 case FilterImageClass: 116 return static_cast<CSSFilterImageValue*>(this)->image(renderer, size);113 return toCSSCrossfadeValue(this)->image(renderer, size); 114 #if ENABLE(CSS_FILTERS) 115 case FilterImageClass: 116 return toCSSFilterImageValue(this)->image(renderer, size); 117 117 #endif 118 118 case LinearGradientClass: … … 153 153 return static_cast<CSSCanvasValue*>(this)->fixedSize(renderer); 154 154 case CrossfadeClass: 155 return static_cast<CSSCrossfadeValue*>(this)->fixedSize(renderer);156 #if ENABLE(CSS_FILTERS) 157 case FilterImageClass: 158 return static_cast<CSSFilterImageValue*>(this)->fixedSize(renderer);155 return toCSSCrossfadeValue(this)->fixedSize(renderer); 156 #if ENABLE(CSS_FILTERS) 157 case FilterImageClass: 158 return toCSSFilterImageValue(this)->fixedSize(renderer); 159 159 #endif 160 160 case LinearGradientClass: … … 214 214 switch (classType()) { 215 215 case CrossfadeClass: 216 static_cast<CSSCrossfadeValue*>(this)->loadSubimages(cachedResourceLoader);216 toCSSCrossfadeValue(this)->loadSubimages(cachedResourceLoader); 217 217 break; 218 218 case CanvasClass: … … 221 221 #if ENABLE(CSS_FILTERS) 222 222 case FilterImageClass: 223 static_cast<CSSFilterImageValue*>(this)->loadSubimages(cachedResourceLoader);223 toCSSFilterImageValue(this)->loadSubimages(cachedResourceLoader); 224 224 break; 225 225 #endif … … 238 238 { 239 239 if (value->isImageValue()) 240 return static_cast<CSSImageValue*>(value)->cachedOrPendingImage()->isPendingImage();240 return toCSSImageValue(value)->cachedOrPendingImage()->isPendingImage(); 241 241 242 242 if (value->isImageGeneratorValue()) 243 return static_cast<CSSImageGeneratorValue*>(value)->isPending();244 245 if (value->isPrimitiveValue() && static_cast<CSSPrimitiveValue*>(value)->getValueID() == CSSValueNone)243 return toCSSImageGeneratorValue(value)->isPending(); 244 245 if (value->isPrimitiveValue() && toCSSPrimitiveValue(value)->getValueID() == CSSValueNone) 246 246 return false; 247 247 … … 257 257 258 258 if (value->isImageValue()) { 259 StyleCachedImage* styleCachedImage = static_cast<CSSImageValue*>(value)->cachedImage(cachedResourceLoader);259 StyleCachedImage* styleCachedImage = toCSSImageValue(value)->cachedImage(cachedResourceLoader); 260 260 if (!styleCachedImage) 261 261 return 0; … … 265 265 266 266 if (value->isImageGeneratorValue()) { 267 static_cast<CSSImageGeneratorValue*>(value)->loadSubimages(cachedResourceLoader);267 toCSSImageGeneratorValue(value)->loadSubimages(cachedResourceLoader); 268 268 // FIXME: Handle CSSImageGeneratorValue (and thus cross-fades with gradients and canvas). 269 269 return 0; 270 270 } 271 271 272 if (value->isPrimitiveValue() && static_cast<CSSPrimitiveValue*>(value)->getValueID() == CSSValueNone) 272 if (value->isPrimitiveValue() && toCSSPrimitiveValue 273 (value)->getValueID() == CSSValueNone) 273 274 return 0; 274 275 -
trunk/Source/WebCore/css/CSSImageGeneratorValue.h
r156226 r156253 93 93 }; 94 94 95 CSS_VALUE_TYPE_CASTS(ImageGeneratorValue) 96 95 97 } // namespace WebCore 96 98 -
trunk/Source/WebCore/css/CSSImageSetValue.cpp
r155060 r156253 63 63 CSSValue* imageValue = item(i); 64 64 ASSERT_WITH_SECURITY_IMPLICATION(imageValue->isImageValue()); 65 String imageURL = static_cast<CSSImageValue*>(imageValue)->url();65 String imageURL = toCSSImageValue(imageValue)->url(); 66 66 67 67 ++i; … … 69 69 CSSValue* scaleFactorValue = item(i); 70 70 ASSERT_WITH_SECURITY_IMPLICATION(scaleFactorValue->isPrimitiveValue()); 71 float scaleFactor = static_cast<CSSPrimitiveValue*>(scaleFactorValue)->getFloatValue();72 71 73 72 ImageWithScale image; 74 73 image.imageURL = imageURL; 75 image.scaleFactor = scaleFactor;74 image.scaleFactor = toCSSPrimitiveValue(scaleFactorValue)->getFloatValue(); 76 75 m_imagesInSet.append(image); 77 76 ++i; -
trunk/Source/WebCore/css/CSSImageSetValue.h
r155060 r156253 85 85 }; 86 86 87 CSS_VALUE_TYPE_CASTS(ImageSetValue) 88 87 89 } // namespace WebCore 88 90 -
trunk/Source/WebCore/css/CSSImageValue.h
r155060 r156253 69 69 }; 70 70 71 CSS_VALUE_TYPE_CASTS(ImageValue) 72 71 73 } // namespace WebCore 72 74 -
trunk/Source/WebCore/css/CSSInheritedValue.h
r155060 r156253 45 45 }; 46 46 47 CSS_VALUE_TYPE_CASTS(InheritedValue) 48 47 49 } // namespace WebCore 48 50 -
trunk/Source/WebCore/css/CSSInitialValue.h
r155060 r156253 54 54 }; 55 55 56 CSS_VALUE_TYPE_CASTS(InitialValue) 57 56 58 } // namespace WebCore 57 59 -
trunk/Source/WebCore/css/CSSLineBoxContainValue.h
r155060 r156253 58 58 }; 59 59 60 CSS_VALUE_TYPE_CASTS(LineBoxContainValue) 61 60 62 } // namespace 61 63 -
trunk/Source/WebCore/css/CSSParser.cpp
r156222 r156253 1390 1390 return false; 1391 1391 1392 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);1392 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); 1393 1393 if (!primitiveValue->isRGBColor()) 1394 1394 return false; … … 1588 1588 if (!m_currentShorthand 1589 1589 #if ENABLE(CSS_VARIABLES) 1590 || (value->isPrimitiveValue() && static_cast<CSSPrimitiveValue*>(value.get())->isVariableName())1590 || (value->isPrimitiveValue() && toCSSPrimitiveValue(value.get())->isVariableName()) 1591 1591 #endif 1592 1592 ) { … … 4119 4119 4120 4120 #ifndef NDEBUG 4121 CSSPrimitiveValue* first = static_cast<CSSPrimitiveValue*>(value1.get());4122 CSSPrimitiveValue* second = static_cast<CSSPrimitiveValue*>(value2.get());4121 CSSPrimitiveValue* first = toCSSPrimitiveValue(value1.get()); 4122 CSSPrimitiveValue* second = toCSSPrimitiveValue(value2.get()); 4123 4123 ident1 = first->getPairValue()->first()->getValueID(); 4124 4124 ident2 = second->getPairValue()->first()->getValueID(); … … 4180 4180 } 4181 4181 4182 RefPtr<CSSPrimitiveValue> parsedValue1 = static_cast<CSSPrimitiveValue*>(value1.get());4183 RefPtr<CSSPrimitiveValue> parsedValue2 = static_cast<CSSPrimitiveValue*>(value2.get());4182 RefPtr<CSSPrimitiveValue> parsedValue1 = toCSSPrimitiveValue(value1.get()); 4183 RefPtr<CSSPrimitiveValue> parsedValue2 = toCSSPrimitiveValue(value2.get()); 4184 4184 4185 4185 value1.clear(); … … 4278 4278 // If only one value was specified, value2 is the same as value1. 4279 4279 m_implicitShorthand = true; 4280 value2 = cssValuePool().createIdentifierValue( static_cast<CSSPrimitiveValue*>(value1.get())->getValueID());4280 value2 = cssValuePool().createIdentifierValue(toCSSPrimitiveValue(value1.get())->getValueID()); 4281 4281 } 4282 4282 … … 7703 7703 ASSERT(!centerY || centerY->isPrimitiveValue()); 7704 7704 7705 result->setFirstX( static_cast<CSSPrimitiveValue*>(centerX.get()));7706 result->setSecondX( static_cast<CSSPrimitiveValue*>(centerX.get()));7705 result->setFirstX(toCSSPrimitiveValue(centerX.get())); 7706 result->setSecondX(toCSSPrimitiveValue(centerX.get())); 7707 7707 // CSS3 radial gradients always share the same start and end point. 7708 result->setFirstY( static_cast<CSSPrimitiveValue*>(centerY.get()));7709 result->setSecondY( static_cast<CSSPrimitiveValue*>(centerY.get()));7708 result->setFirstY(toCSSPrimitiveValue(centerY.get())); 7709 result->setSecondY(toCSSPrimitiveValue(centerY.get())); 7710 7710 7711 7711 RefPtr<CSSPrimitiveValue> shapeValue; … … 7967 7967 if (!a) 7968 7968 return false; 7969 result->setFirstX( static_cast<CSSPrimitiveValue*>(centerX.get()));7970 result->setFirstY( static_cast<CSSPrimitiveValue*>(centerY.get()));7969 result->setFirstX(toCSSPrimitiveValue(centerX.get())); 7970 result->setFirstY(toCSSPrimitiveValue(centerY.get())); 7971 7971 // Right now, CSS radial gradients have the same start and end centers. 7972 result->setSecondX( static_cast<CSSPrimitiveValue*>(centerX.get()));7973 result->setSecondY( static_cast<CSSPrimitiveValue*>(centerY.get()));7972 result->setSecondX(toCSSPrimitiveValue(centerX.get())); 7973 result->setSecondY(toCSSPrimitiveValue(centerY.get())); 7974 7974 } 7975 7975 -
trunk/Source/WebCore/css/CSSPrimitiveValue.h
r156091 r156253 397 397 }; 398 398 399 CSS_VALUE_TYPE_CASTS(PrimitiveValue) 400 399 401 } // namespace WebCore 400 402 -
trunk/Source/WebCore/css/CSSReflectValue.h
r155060 r156253 71 71 }; 72 72 73 CSS_VALUE_TYPE_CASTS(ReflectValue) 74 73 75 } // namespace WebCore 74 76 -
trunk/Source/WebCore/css/CSSToStyleMap.cpp
r156125 r156253 72 72 return; 73 73 74 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value); 75 switch (primitiveValue->getValueID()) { 74 switch (toCSSPrimitiveValue(value)->getValueID()) { 76 75 case CSSValueFixed: 77 76 layer->setAttachment(FixedBackgroundAttachment); … … 98 97 return; 99 98 100 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value); 101 layer->setClip(*primitiveValue); 99 layer->setClip(*toCSSPrimitiveValue(value)); 102 100 } 103 101 … … 112 110 return; 113 111 114 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value); 115 layer->setComposite(*primitiveValue); 112 layer->setComposite(*toCSSPrimitiveValue(value)); 116 113 } 117 114 … … 126 123 return; 127 124 128 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);125 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); 129 126 layer->setBlendMode(*primitiveValue); 130 127 } … … 140 137 return; 141 138 142 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value); 143 layer->setOrigin(*primitiveValue); 139 layer->setOrigin(*toCSSPrimitiveValue(value)); 144 140 } 145 141 … … 165 161 return; 166 162 167 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value); 168 layer->setRepeatX(*primitiveValue); 163 layer->setRepeatX(*toCSSPrimitiveValue(value)); 169 164 } 170 165 … … 179 174 return; 180 175 181 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value); 182 layer->setRepeatY(*primitiveValue); 176 layer->setRepeatY(*toCSSPrimitiveValue(value)); 183 177 } 184 178 … … 190 184 } 191 185 192 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);186 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); 193 187 if (primitiveValue->getValueID() == CSSValueContain) 194 188 layer->setSizeType(Contain); … … 240 234 float zoomFactor = style()->effectiveZoom(); 241 235 242 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);236 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); 243 237 Pair* pair = primitiveValue->getPairValue(); 244 238 if (pair) { … … 276 270 float zoomFactor = style()->effectiveZoom(); 277 271 278 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);272 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); 279 273 Pair* pair = primitiveValue->getPairValue(); 280 274 if (pair) { … … 311 305 return; 312 306 313 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value); 314 switch (primitiveValue->getValueID()) { 307 switch (toCSSPrimitiveValue(value)->getValueID()) { 315 308 case CSSValueAlpha: 316 309 type = EMaskSourceType::MaskAlpha; … … 338 331 return; 339 332 340 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value); 341 animation->setDelay(primitiveValue->computeTime<double, CSSPrimitiveValue::Seconds>()); 333 animation->setDelay(toCSSPrimitiveValue(value)->computeTime<double, CSSPrimitiveValue::Seconds>()); 342 334 } 343 335 … … 352 344 return; 353 345 354 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value); 355 switch (primitiveValue->getValueID()) { 346 switch (toCSSPrimitiveValue(value)->getValueID()) { 356 347 case CSSValueNormal: 357 348 layer->setDirection(Animation::AnimationDirectionNormal); … … 381 372 return; 382 373 383 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value); 384 animation->setDuration(primitiveValue->computeTime<double, CSSPrimitiveValue::Seconds>()); 374 animation->setDuration(toCSSPrimitiveValue(value)->computeTime<double, CSSPrimitiveValue::Seconds>()); 385 375 } 386 376 … … 395 385 return; 396 386 397 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value); 398 switch (primitiveValue->getValueID()) { 387 switch (toCSSPrimitiveValue(value)->getValueID()) { 399 388 case CSSValueNone: 400 389 layer->setFillMode(AnimationFillModeNone); … … 424 413 return; 425 414 426 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);415 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); 427 416 if (primitiveValue->getValueID() == CSSValueInfinite) 428 417 animation->setIterationCount(Animation::IterationCountInfinite); … … 441 430 return; 442 431 443 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);432 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); 444 433 if (primitiveValue->getValueID() == CSSValueNone) 445 434 layer->setIsNoneAnimation(true); … … 458 447 return; 459 448 460 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value); 461 EAnimPlayState playState = (primitiveValue->getValueID() == CSSValuePaused) ? AnimPlayStatePaused : AnimPlayStatePlaying; 449 EAnimPlayState playState = (toCSSPrimitiveValue(value)->getValueID() == CSSValuePaused) ? AnimPlayStatePaused : AnimPlayStatePlaying; 462 450 layer->setPlayState(playState); 463 451 } … … 474 462 return; 475 463 476 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);464 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); 477 465 if (primitiveValue->getValueID() == CSSValueAll) { 478 466 animation->setAnimationMode(Animation::AnimateAll); … … 495 483 496 484 if (value->isPrimitiveValue()) { 497 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value); 498 switch (primitiveValue->getValueID()) { 485 switch (toCSSPrimitiveValue(value)->getValueID()) { 499 486 case CSSValueLinear: 500 487 animation->setTimingFunction(LinearTimingFunction::create()); … … 602 589 603 590 // Retrieve the border image value. 604 CSSBorderImageSliceValue* borderImageSlice = static_cast<CSSBorderImageSliceValue*>(value);591 CSSBorderImageSliceValue* borderImageSlice = toCSSBorderImageSliceValue(value); 605 592 606 593 // Set up a length box to represent our image slices. … … 638 625 639 626 // Retrieve the primitive value. 640 CSSPrimitiveValue* borderWidths = static_cast<CSSPrimitiveValue*>(value);627 CSSPrimitiveValue* borderWidths = toCSSPrimitiveValue(value); 641 628 642 629 // Set up a length box to represent our image slices. … … 679 666 return; 680 667 681 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value); 682 Pair* pair = primitiveValue->getPairValue(); 668 Pair* pair = toCSSPrimitiveValue(value)->getPairValue(); 683 669 if (!pair || !pair->first() || !pair->second()) 684 670 return; -
trunk/Source/WebCore/css/CSSValue.cpp
r156125 r156253 384 384 switch (classType()) { 385 385 case AspectRatioClass: 386 delete static_cast<CSSAspectRatioValue*>(this);386 delete toCSSAspectRatioValue(this); 387 387 return; 388 388 case BorderImageSliceClass: 389 delete static_cast<CSSBorderImageSliceValue*>(this);389 delete toCSSBorderImageSliceValue(this); 390 390 return; 391 391 case CanvasClass: … … 393 393 return; 394 394 case CursorImageClass: 395 delete static_cast<CSSCursorImageValue*>(this);395 delete toCSSCursorImageValue(this); 396 396 return; 397 397 case FontClass: … … 414 414 return; 415 415 case CrossfadeClass: 416 delete static_cast<CSSCrossfadeValue*>(this);416 delete toCSSCrossfadeValue(this); 417 417 return; 418 418 case ImageClass: 419 delete static_cast<CSSImageValue*>(this);419 delete toCSSImageValue(this); 420 420 return; 421 421 case InheritedClass: 422 delete static_cast<CSSInheritedValue*>(this);422 delete toCSSInheritedValue(this); 423 423 return; 424 424 case InitialClass: 425 delete static_cast<CSSInitialValue*>(this);425 delete toCSSInitialValue(this); 426 426 return; 427 427 case PrimitiveClass: 428 delete static_cast<CSSPrimitiveValue*>(this);428 delete toCSSPrimitiveValue(this); 429 429 return; 430 430 case ReflectClass: … … 450 450 return; 451 451 case LineBoxContainClass: 452 delete static_cast<CSSLineBoxContainValue*>(this);452 delete toCSSLineBoxContainValue(this); 453 453 return; 454 454 case CalculationClass: 455 delete static_cast<CSSCalcValue*>(this);455 delete toCSSCalcValue(this); 456 456 return; 457 457 #if ENABLE(CSS_IMAGE_SET) 458 458 case ImageSetClass: 459 delete static_cast<CSSImageSetValue*>(this);459 delete toCSSImageSetValue(this); 460 460 return; 461 461 #endif 462 462 #if ENABLE(CSS_FILTERS) 463 463 case FilterImageClass: 464 delete static_cast<CSSFilterImageValue*>(this);464 delete toCSSFilterImageValue(this); 465 465 return; 466 466 case WebKitCSSFilterClass: … … 478 478 return; 479 479 case WebKitCSSShaderClass: 480 delete static_cast<WebKitCSSShaderValue*>(this);480 delete toWebKitCSSShaderValue(this); 481 481 return; 482 482 #endif -
trunk/Source/WebCore/css/CSSValue.h
r156125 r156253 90 90 bool isStepsTimingFunctionValue() const { return m_classType == StepsTimingFunctionClass; } 91 91 bool isWebKitCSSTransformValue() const { return m_classType == WebKitCSSTransformClass; } 92 bool is CSSLineBoxContainValue() const { return m_classType == LineBoxContainClass; }93 bool isCalc ulationValue() const {return m_classType == CalculationClass; }92 bool isLineBoxContainValue() const { return m_classType == LineBoxContainClass; } 93 bool isCalcValue() const {return m_classType == CalculationClass; } 94 94 #if ENABLE(CSS_FILTERS) 95 95 bool isFilterImageValue() const { return m_classType == FilterImageClass; } … … 265 265 } 266 266 267 #define CSS_VALUE_TYPE_CASTS(ValueTypeName) \ 268 inline const CSS##ValueTypeName* toCSS##ValueTypeName(const CSSValue* value) \ 269 { \ 270 ASSERT_WITH_SECURITY_IMPLICATION(!value || value->is##ValueTypeName()); \ 271 return static_cast<const CSS##ValueTypeName*>(value); \ 272 } \ 273 inline CSS##ValueTypeName* toCSS##ValueTypeName(CSSValue* value) \ 274 { \ 275 ASSERT_WITH_SECURITY_IMPLICATION(!value || value->is##ValueTypeName()); \ 276 return static_cast<CSS##ValueTypeName*>(value); \ 277 } \ 278 void toCSS##ValueTypeName(const CSS##ValueTypeName*); \ 279 void toCSS##ValueTypeName(const CSS##ValueTypeName&); 280 267 281 } // namespace WebCore 268 282 -
trunk/Source/WebCore/css/CSSValueList.h
r155060 r156253 97 97 }; 98 98 99 CSS_VALUE_TYPE_CASTS(ValueList) 100 99 101 // Wrapper that can be used to iterate over any CSSValue. Non-list values and 0 behave as zero-length lists. 100 102 // Objects of this class are intended to be stack-allocated and scoped to a single function. … … 112 114 size_t m_position; 113 115 }; 116 114 117 } // namespace WebCore 115 118 -
trunk/Source/WebCore/css/CSSVariableValue.h
r148921 r156253 62 62 }; 63 63 64 CSS_VALUE_TYPE_CASTS(VariableValue) 65 64 66 } 65 67 -
trunk/Source/WebCore/css/DeprecatedStyleBuilder.cpp
r156132 r156253 151 151 { 152 152 if (value->isPrimitiveValue()) 153 setValue(styleResolver->style(), * static_cast<CSSPrimitiveValue*>(value));153 setValue(styleResolver->style(), *toCSSPrimitiveValue(value)); 154 154 } 155 155 static PropertyHandler createHandler() … … 169 169 return; 170 170 171 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);171 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); 172 172 if (primitiveValue->getValueID() == idMapsToMinusOne) 173 173 setValue(styleResolver->style(), -1); … … 217 217 return; 218 218 219 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);219 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); 220 220 if (primitiveValue->getValueID() == autoIdentity) 221 221 setAuto(styleResolver->style()); … … 256 256 return; 257 257 258 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);258 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); 259 259 260 260 if (Rect* rect = primitiveValue->getRectValue()) { … … 302 302 return; 303 303 304 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);304 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); 305 305 if (inheritColorFromParent && primitiveValue->getValueID() == CSSValueCurrentcolor) 306 306 applyInheritValue(propertyID, styleResolver); … … 363 363 return; 364 364 365 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);365 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); 366 366 if (noneEnabled && primitiveValue->getValueID() == CSSValueNone) { 367 367 if (noneUndefined) … … 417 417 if (!value->isPrimitiveValue()) 418 418 return; 419 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);419 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); 420 420 if ((identBehavior == MapNoneToNull && primitiveValue->getValueID() == CSSValueNone) 421 421 || (identBehavior == MapAutoToNull && primitiveValue->getValueID() == CSSValueAuto)) … … 440 440 return; 441 441 442 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value); 443 Pair* pair = primitiveValue->getPairValue(); 442 Pair* pair = toCSSPrimitiveValue(value)->getPairValue(); 444 443 if (!pair || !pair->first() || !pair->second()) 445 444 return; … … 603 602 return; 604 603 605 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);604 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); 606 605 607 606 CSSValueID ident = primitiveValue->getValueID(); … … 673 672 if (!value->isPrimitiveValue()) 674 673 return; 675 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);676 674 FontDescription fontDescription = styleResolver->fontDescription(); 677 (fontDescription.*setterFunction)(* primitiveValue);675 (fontDescription.*setterFunction)(*toCSSPrimitiveValue(value)); 678 676 styleResolver->setFontDescription(fontDescription); 679 677 } … … 727 725 if (!item->isPrimitiveValue()) 728 726 continue; 729 CSSPrimitiveValue* contentValue = static_cast<CSSPrimitiveValue*>(item);727 CSSPrimitiveValue* contentValue = toCSSPrimitiveValue(item); 730 728 AtomicString face; 731 729 if (contentValue->isString()) … … 837 835 return; 838 836 839 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);837 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); 840 838 841 839 FontDescription fontDescription = styleResolver->style()->fontDescription(); … … 850 848 } 851 849 852 if (CSSValueID ident = primitiveValue->getValueID()) {850 if (CSSValueID ident = toCSSPrimitiveValue(value)->getValueID()) { 853 851 // Keywords are being used. 854 852 switch (ident) { … … 911 909 if (!value->isPrimitiveValue()) 912 910 return; 913 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);911 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); 914 912 FontDescription fontDescription = styleResolver->fontDescription(); 915 913 switch (primitiveValue->getValueID()) { … … 972 970 ASSERT(item->isPrimitiveValue()); 973 971 if (item->isPrimitiveValue()) { 974 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(item); 975 switch (primitiveValue->getValueID()) { 972 switch (toCSSPrimitiveValue(item)->getValueID()) { 976 973 case CSSValueNoCommonLigatures: 977 974 commonLigaturesState = FontDescription::DisabledLigaturesState; … … 1002 999 else { 1003 1000 ASSERT_WITH_SECURITY_IMPLICATION(value->isPrimitiveValue()); 1004 ASSERT( static_cast<CSSPrimitiveValue*>(value)->getValueID() == CSSValueNormal);1001 ASSERT(toCSSPrimitiveValue(value)->getValueID() == CSSValueNormal); 1005 1002 } 1006 1003 #endif … … 1150 1147 static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value) 1151 1148 { 1152 bool setCounterIncrementToNone = counterBehavior == Increment && value->isPrimitiveValue() && static_cast<CSSPrimitiveValue*>(value)->getValueID() == CSSValueNone;1149 bool setCounterIncrementToNone = counterBehavior == Increment && value->isPrimitiveValue() && toCSSPrimitiveValue(value)->getValueID() == CSSValueNone; 1153 1150 1154 1151 if (!value->isValueList() && !setCounterIncrementToNone) … … 1175 1172 continue; 1176 1173 1177 Pair* pair = static_cast<CSSPrimitiveValue*>(currValue)->getPairValue();1174 Pair* pair = toCSSPrimitiveValue(currValue)->getPairValue(); 1178 1175 if (!pair || !pair->first() || !pair->second()) 1179 1176 continue; … … 1217 1214 CSSValue* item = list->itemWithoutBoundsCheck(i); 1218 1215 if (item->isCursorImageValue()) { 1219 CSSCursorImageValue* image = static_cast<CSSCursorImageValue*>(item);1216 CSSCursorImageValue* image = toCSSCursorImageValue(item); 1220 1217 if (image->updateIfSVGCursorIsUsed(styleResolver->element())) // Elements with SVG cursors are not allowed to share style. 1221 1218 styleResolver->style()->setUnique(); 1222 1219 styleResolver->style()->addCursor(styleResolver->styleImage(CSSPropertyCursor, image), image->hotSpot()); 1223 1220 } else if (item->isPrimitiveValue()) { 1224 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(item);1221 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(item); 1225 1222 if (primitiveValue->isValueID()) 1226 1223 styleResolver->style()->setCursor(*primitiveValue); … … 1228 1225 } 1229 1226 } else if (value->isPrimitiveValue()) { 1230 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);1227 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); 1231 1228 if (primitiveValue->isValueID() && styleResolver->style()->cursor() != ECursor(*primitiveValue)) 1232 1229 styleResolver->style()->setCursor(*primitiveValue); … … 1244 1241 return; 1245 1242 1246 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);1243 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); 1247 1244 ASSERT(primitiveValue->isValueID()); 1248 1245 … … 1271 1268 CSSValue* item = i.value(); 1272 1269 ASSERT_WITH_SECURITY_IMPLICATION(item->isPrimitiveValue()); 1273 t |= * static_cast<CSSPrimitiveValue*>(item);1270 t |= *toCSSPrimitiveValue(item); 1274 1271 } 1275 1272 styleResolver->style()->setTextDecoration(t); … … 1289 1286 return; 1290 1287 1291 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);1288 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); 1292 1289 if (primitiveValue->getValueID()) { 1293 1290 switch (primitiveValue->getValueID()) { … … 1324 1321 return; 1325 1322 1326 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);1323 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); 1327 1324 if (primitiveValue->getValueID() == CSSValueInfinite) 1328 1325 styleResolver->style()->setMarqueeLoopCount(-1); // -1 means repeat forever. … … 1344 1341 return; 1345 1342 1346 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);1343 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); 1347 1344 if (CSSValueID ident = primitiveValue->getValueID()) { 1348 1345 switch (ident) { … … 1378 1375 // This is true if value is 'auto' or 'alphabetic'. 1379 1376 if (value->isPrimitiveValue()) { 1380 TextUnderlinePosition t = * static_cast<CSSPrimitiveValue*>(value);1377 TextUnderlinePosition t = *toCSSPrimitiveValue(value); 1381 1378 styleResolver->style()->setTextUnderlinePosition(t); 1382 1379 return; … … 1407 1404 return; 1408 1405 1409 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);1406 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); 1410 1407 Length lineHeight; 1411 1408 … … 1445 1442 return; 1446 1443 1447 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);1444 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); 1448 1445 Length lineHeight; 1449 1446 … … 1587 1584 if (!inspector.first()->isPrimitiveValue() || !inspector.second()->isPrimitiveValue()) 1588 1585 return; 1589 CSSPrimitiveValue* first = static_cast<CSSPrimitiveValue*>(inspector.first());1590 CSSPrimitiveValue* second = static_cast<CSSPrimitiveValue*>(inspector.second());1586 CSSPrimitiveValue* first = toCSSPrimitiveValue(inspector.first()); 1587 CSSPrimitiveValue* second = toCSSPrimitiveValue(inspector.second()); 1591 1588 if (first->isLength()) { 1592 1589 // <length>{2} … … 1608 1605 if (!inspector.first()->isPrimitiveValue()) 1609 1606 return; 1610 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(inspector.first());1607 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(inspector.first()); 1611 1608 if (primitiveValue->isLength()) { 1612 1609 // <length> … … 1672 1669 continue; 1673 1670 1674 CSSPrimitiveValue* value = static_cast<CSSPrimitiveValue*>(item);1671 CSSPrimitiveValue* value = toCSSPrimitiveValue(item); 1675 1672 if (value->getValueID() == CSSValueFilled || value->getValueID() == CSSValueOpen) 1676 1673 styleResolver->style()->setTextEmphasisFill(*value); … … 1684 1681 if (!value->isPrimitiveValue()) 1685 1682 return; 1686 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);1683 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); 1687 1684 1688 1685 if (primitiveValue->isString()) { … … 1813 1810 return; 1814 1811 1815 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);1812 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); 1816 1813 1817 1814 EResize r = RESIZE_NONE; … … 1843 1840 return; 1844 1841 1845 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);1842 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); 1846 1843 1847 1844 if (primitiveValue->getValueID()) … … 1882 1879 return; 1883 1880 } 1884 CSSAspectRatioValue* aspectRatioValue = static_cast<CSSAspectRatioValue*>(value);1881 CSSAspectRatioValue* aspectRatioValue = toCSSAspectRatioValue(value); 1885 1882 styleResolver->style()->setHasAspectRatio(true); 1886 1883 styleResolver->style()->setAspectRatioDenominator(aspectRatioValue->denominatorValue()); … … 1918 1915 { 1919 1916 ASSERT_WITH_SECURITY_IMPLICATION(value->isPrimitiveValue()); 1920 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);1917 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); 1921 1918 1922 1919 if (primitiveValue->getValueID() == CSSValueNormal) { … … 1979 1976 return; 1980 1977 1981 EDisplay display = * static_cast<CSSPrimitiveValue*>(value);1978 EDisplay display = *toCSSPrimitiveValue(value); 1982 1979 1983 1980 if (!isValidDisplayValue(styleResolver, display)) … … 2000 1997 { 2001 1998 if (value->isPrimitiveValue()) { 2002 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);1999 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); 2003 2000 if (primitiveValue->getValueID() == CSSValueNone) 2004 2001 setValue(styleResolver->style(), 0); … … 2031 2028 { 2032 2029 if (value->isPrimitiveValue()) { 2033 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);2030 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); 2034 2031 if (primitiveValue->getValueID() == CSSValueAuto) 2035 2032 setValue(styleResolver->style(), 0); … … 2084 2081 if (!item->isPrimitiveValue()) 2085 2082 continue; 2086 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(item);2083 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(item); 2087 2084 if (primitiveValue->getValueID() == CSSValueFromImage) 2088 2085 source = ImageResolutionFromImage; … … 2140 2137 continue; 2141 2138 2142 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(item);2139 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(item); 2143 2140 if (!primitiveValue->getValueID()) 2144 2141 lengthOrPercentageValue = primitiveValue->convertToLength<FixedIntegerConversion | PercentConversion | CalculatedConversion | ViewportPercentageConversion>(styleResolver->style(), styleResolver->rootElementStyle(), styleResolver->style()->effectiveZoom()); -
trunk/Source/WebCore/css/FontFeatureValue.h
r155060 r156253 52 52 }; 53 53 54 inline FontFeatureValue* toFontFeatureValue(CSSValue* value) 55 { 56 ASSERT_WITH_SECURITY_IMPLICATION(!value || value->isFontFeatureValue()); 57 return static_cast<FontFeatureValue*>(value); 58 } 59 54 60 } // namespace 55 61 -
trunk/Source/WebCore/css/FontValue.h
r155060 r156253 56 56 }; 57 57 58 inline FontValue* toFontValue(CSSValue* value) 59 { 60 ASSERT_WITH_SECURITY_IMPLICATION(!value || value->isFontValue()); 61 return static_cast<FontValue*>(value); 62 } 63 58 64 } // namespace 59 65 -
trunk/Source/WebCore/css/MediaList.cpp
r154533 r156253 335 335 CSSValue* cssValue = exp->value(); 336 336 if (cssValue && cssValue->isPrimitiveValue()) { 337 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(cssValue);337 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(cssValue); 338 338 if (primitiveValue->isDotsPerInch() || primitiveValue->isDotsPerCentimeter()) 339 339 addResolutionWarningMessageToConsole(document, mediaQuerySet->mediaText(), primitiveValue); -
trunk/Source/WebCore/css/MediaQueryEvaluator.cpp
r155630 r156253 183 183 { 184 184 if (value->isAspectRatioValue()) { 185 CSSAspectRatioValue* aspectRatio = static_cast<CSSAspectRatioValue*>(value);185 CSSAspectRatioValue* aspectRatio = toCSSAspectRatioValue(value); 186 186 return compareValue(width * static_cast<int>(aspectRatio->denominatorValue()), height * static_cast<int>(aspectRatio->numeratorValue()), op); 187 187 } … … 193 193 { 194 194 if (value->isPrimitiveValue() 195 && static_cast<CSSPrimitiveValue*>(value)->isNumber()) {196 result = static_cast<CSSPrimitiveValue*>(value)->getFloatValue(CSSPrimitiveValue::CSS_NUMBER);195 && toCSSPrimitiveValue(value)->isNumber()) { 196 result = toCSSPrimitiveValue(value)->getFloatValue(CSSPrimitiveValue::CSS_NUMBER); 197 197 return true; 198 198 } … … 243 243 int height = view->layoutHeight(); 244 244 if (value && value->isPrimitiveValue()) { 245 const CSSValueID id = static_cast<CSSPrimitiveValue*>(value)->getValueID();245 const CSSValueID id = toCSSPrimitiveValue(value)->getValueID(); 246 246 if (width > height) // Square viewport is portrait. 247 247 return CSSValueLandscape == id; … … 307 307 return false; 308 308 309 CSSPrimitiveValue* resolution = static_cast<CSSPrimitiveValue*>(value);309 CSSPrimitiveValue* resolution = toCSSPrimitiveValue(value); 310 310 return compareValue(deviceScaleFactor, resolution->isNumber() ? resolution->getFloatValue() : resolution->getFloatValue(CSSPrimitiveValue::CSS_DPPX), op); 311 311 } … … 313 313 static bool device_pixel_ratioMediaFeatureEval(CSSValue *value, RenderStyle*, Frame* frame, MediaFeaturePrefix op) 314 314 { 315 return (!value || static_cast<CSSPrimitiveValue*>(value)->isNumber()) && evalResolution(value, frame, op);315 return (!value || toCSSPrimitiveValue(value)->isNumber()) && evalResolution(value, frame, op); 316 316 } 317 317 … … 319 319 { 320 320 #if ENABLE(RESOLUTION_MEDIA_QUERY) 321 return (!value || static_cast<CSSPrimitiveValue*>(value)->isResolution()) && evalResolution(value, frame, op);321 return (!value || toCSSPrimitiveValue(value)->isResolution()) && evalResolution(value, frame, op); 322 322 #else 323 323 UNUSED_PARAM(value); … … 343 343 return false; 344 344 345 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);345 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); 346 346 347 347 if (primitiveValue->isNumber()) { … … 597 597 return true; 598 598 599 const int viewModeCSSKeywordID = static_cast<CSSPrimitiveValue*>(value)->getValueID();599 const int viewModeCSSKeywordID = toCSSPrimitiveValue(value)->getValueID(); 600 600 const Page::ViewMode viewMode = frame->page()->viewMode(); 601 601 bool result = false; … … 679 679 return false; 680 680 681 const CSSValueID id = static_cast<CSSPrimitiveValue*>(value)->getValueID();681 const CSSValueID id = toCSSPrimitiveValue(value)->getValueID(); 682 682 return (pointer == NoPointer && id == CSSValueNone) 683 683 || (pointer == TouchPointer && id == CSSValueCoarse) -
trunk/Source/WebCore/css/SVGCSSStyleSelector.cpp
r154887 r156253 108 108 CSSPrimitiveValue* primitiveValue = 0; 109 109 if (value->isPrimitiveValue()) 110 primitiveValue = static_cast<CSSPrimitiveValue*>(value);110 primitiveValue = toCSSPrimitiveValue(value); 111 111 112 112 const State& state = m_state; … … 286 286 continue; 287 287 288 CSSPrimitiveValue* dash = static_cast<CSSPrimitiveValue*>(dashes->itemWithoutBoundsCheck(i));288 CSSPrimitiveValue* dash = toCSSPrimitiveValue(dashes->itemWithoutBoundsCheck(i)); 289 289 array.append(SVGLength::fromCSSPrimitiveValue(dash)); 290 290 } -
trunk/Source/WebCore/css/ShadowValue.h
r155060 r156253 63 63 }; 64 64 65 inline ShadowValue* toShadowValue(CSSValue* value) 66 { 67 ASSERT_WITH_SECURITY_IMPLICATION(!value || value->isShadowValue()); 68 return static_cast<ShadowValue*>(value); 69 } 70 65 71 } // namespace 66 72 -
trunk/Source/WebCore/css/StylePropertySet.cpp
r153880 r156253 417 417 yValue = nextValue; 418 418 419 CSSValueID xId = static_cast<CSSPrimitiveValue*>(value.get())->getValueID();420 CSSValueID yId = static_cast<CSSPrimitiveValue*>(yValue.get())->getValueID();419 CSSValueID xId = toCSSPrimitiveValue(value.get())->getValueID(); 420 CSSValueID yId = toCSSPrimitiveValue(yValue.get())->getValueID(); 421 421 if (xId != yId) { 422 422 if (xId == CSSValueRepeat && yId == CSSValueNoRepeat) { -
trunk/Source/WebCore/css/StyleResolver.cpp
r155938 r156253 1926 1926 return false; 1927 1927 1928 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);1928 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); 1929 1929 Pair* minMaxTrackBreadth = primitiveValue->getPairValue(); 1930 1930 if (!minMaxTrackBreadth) { … … 1950 1950 // Handle 'none'. 1951 1951 if (value->isPrimitiveValue()) { 1952 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);1952 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); 1953 1953 return primitiveValue->getValueID() == CSSValueNone; 1954 1954 } … … 1961 1961 CSSValue* currValue = i.value(); 1962 1962 if (currValue->isPrimitiveValue()) { 1963 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(currValue);1963 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(currValue); 1964 1964 if (primitiveValue->isString()) { 1965 1965 NamedGridLinesMap::AddResult result = namedGridLines.add(primitiveValue->getStringValue(), Vector<size_t>()); … … 1989 1989 if (value->isPrimitiveValue()) { 1990 1990 #if !ASSERT_DISABLED 1991 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value); 1992 ASSERT(primitiveValue->getValueID() == CSSValueAuto); 1991 ASSERT(toCSSPrimitiveValue(value)->getValueID() == CSSValueAuto); 1993 1992 #endif 1994 1993 return true; … … 2005 2004 2006 2005 CSSValueListIterator it = values; 2007 CSSPrimitiveValue* currentValue = static_cast<CSSPrimitiveValue*>(it.value());2006 CSSPrimitiveValue* currentValue = toCSSPrimitiveValue(it.value()); 2008 2007 if (currentValue->getValueID() == CSSValueSpan) { 2009 2008 isSpanPosition = true; 2010 2009 it.advance(); 2011 currentValue = it.hasMore() ? static_cast<CSSPrimitiveValue*>(it.value()) : 0;2010 currentValue = it.hasMore() ? toCSSPrimitiveValue(it.value()) : 0; 2012 2011 } 2013 2012 … … 2015 2014 gridLineNumber = currentValue->getIntValue(); 2016 2015 it.advance(); 2017 currentValue = it.hasMore() ? static_cast<CSSPrimitiveValue*>(it.value()) : 0;2016 currentValue = it.hasMore() ? toCSSPrimitiveValue(it.value()) : 0; 2018 2017 } 2019 2018 … … 2035 2034 static bool hasVariableReference(CSSValue* value) 2036 2035 { 2037 if (value->isPrimitiveValue()) { 2038 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value); 2039 return primitiveValue->hasVariableReference(); 2040 } 2041 2042 if (value->isCalculationValue()) 2043 return static_cast<CSSCalcValue*>(value)->hasVariableReference(); 2036 if (value->isPrimitiveValue()) 2037 return toCSSPrimitiveValue(value)->hasVariableReference(); 2038 2039 if (value->isCalcValue()) 2040 return toCSSCalcValue(value)->hasVariableReference(); 2044 2041 2045 2042 if (value->isReflectValue()) { … … 2134 2131 } 2135 2132 2136 CSSPrimitiveValue* primitiveValue = value->isPrimitiveValue() ? static_cast<CSSPrimitiveValue*>(value) : 0;2133 CSSPrimitiveValue* primitiveValue = value->isPrimitiveValue() ? toCSSPrimitiveValue(value) : 0; 2137 2134 2138 2135 float zoomFactor = state.style()->effectiveZoom(); … … 2161 2158 if (item->isImageGeneratorValue()) { 2162 2159 if (item->isGradientValue()) 2163 state.style()->setContent(StyleGeneratedImage::create( static_cast<CSSGradientValue*>(item)->gradientWithStylesResolved(this).get()), didSet);2160 state.style()->setContent(StyleGeneratedImage::create(toCSSGradientValue(item)->gradientWithStylesResolved(this).get()), didSet); 2164 2161 else 2165 state.style()->setContent(StyleGeneratedImage::create( static_cast<CSSImageGeneratorValue*>(item)), didSet);2162 state.style()->setContent(StyleGeneratedImage::create(toCSSImageGeneratorValue(item)), didSet); 2166 2163 didSet = true; 2167 2164 #if ENABLE(CSS_IMAGE_SET) 2168 2165 } else if (item->isImageSetValue()) { 2169 state.style()->setContent(setOrPendingFromValue(CSSPropertyContent, static_cast<CSSImageSetValue*>(item)), didSet);2166 state.style()->setContent(setOrPendingFromValue(CSSPropertyContent, toCSSImageSetValue(item)), didSet); 2170 2167 didSet = true; 2171 2168 #endif … … 2173 2170 2174 2171 if (item->isImageValue()) { 2175 state.style()->setContent(cachedOrPendingFromValue(CSSPropertyContent, static_cast<CSSImageValue*>(item)), didSet);2172 state.style()->setContent(cachedOrPendingFromValue(CSSPropertyContent, toCSSImageValue(item)), didSet); 2176 2173 didSet = true; 2177 2174 continue; … … 2181 2178 continue; 2182 2179 2183 CSSPrimitiveValue* contentValue = static_cast<CSSPrimitiveValue*>(item);2180 CSSPrimitiveValue* contentValue = toCSSPrimitiveValue(item); 2184 2181 2185 2182 if (contentValue->isString()) { … … 2255 2252 ASSERT_WITH_SECURITY_IMPLICATION(first->isPrimitiveValue()); 2256 2253 ASSERT_WITH_SECURITY_IMPLICATION(second->isPrimitiveValue()); 2257 String startQuote = static_cast<CSSPrimitiveValue*>(first)->getStringValue();2258 String endQuote = static_cast<CSSPrimitiveValue*>(second)->getStringValue();2254 String startQuote = toCSSPrimitiveValue(first)->getStringValue(); 2255 String endQuote = toCSSPrimitiveValue(second)->getStringValue(); 2259 2256 quotes.append(std::make_pair(startQuote, endQuote)); 2260 2257 } … … 2677 2674 } 2678 2675 2679 if (!value->is CSSLineBoxContainValue())2676 if (!value->isLineBoxContainValue()) 2680 2677 return; 2681 2678 2682 CSSLineBoxContainValue* lineBoxContainValue = static_cast<CSSLineBoxContainValue*>(value);2679 CSSLineBoxContainValue* lineBoxContainValue = toCSSLineBoxContainValue(value); 2683 2680 state.style()->setLineBoxContain(lineBoxContainValue->value()); 2684 2681 return; … … 3076 3073 { 3077 3074 if (value->isImageValue()) 3078 return cachedOrPendingFromValue(property, static_cast<CSSImageValue*>(value));3075 return cachedOrPendingFromValue(property, toCSSImageValue(value)); 3079 3076 3080 3077 if (value->isImageGeneratorValue()) { 3081 3078 if (value->isGradientValue()) 3082 return generatedOrPendingFromValue(property, static_cast<CSSGradientValue*>(value)->gradientWithStylesResolved(this).get());3083 return generatedOrPendingFromValue(property, static_cast<CSSImageGeneratorValue*>(value));3079 return generatedOrPendingFromValue(property, toCSSGradientValue(value)->gradientWithStylesResolved(this).get()); 3080 return generatedOrPendingFromValue(property, toCSSImageGeneratorValue(value)); 3084 3081 } 3085 3082 3086 3083 #if ENABLE(CSS_IMAGE_SET) 3087 3084 if (value->isImageSetValue()) 3088 return setOrPendingFromValue(property, static_cast<CSSImageSetValue*>(value));3085 return setOrPendingFromValue(property, toCSSImageSetValue(value)); 3089 3086 #endif 3090 3087 3091 3088 if (value->isCursorImageValue()) 3092 return cursorOrPendingFromValue(property, static_cast<CSSCursorImageValue*>(value));3089 return cursorOrPendingFromValue(property, toCSSCursorImageValue(value)); 3093 3090 3094 3091 return 0; … … 3108 3105 if (value->isFilterImageValue()) { 3109 3106 // FilterImage needs to calculate FilterOperations. 3110 static_cast<CSSFilterImageValue*>(value)->createFilterOperations(this);3107 toCSSFilterImageValue(value)->createFilterOperations(this); 3111 3108 } 3112 3109 #endif … … 3387 3384 { 3388 3385 if (value->isWebKitCSSShaderValue()) 3389 return cachedOrPendingStyleShaderFromValue( static_cast<WebKitCSSShaderValue*>(value));3386 return cachedOrPendingStyleShaderFromValue(toWebKitCSSShaderValue(value)); 3390 3387 return 0; 3391 3388 } … … 3470 3467 if (!value->isPrimitiveValue()) 3471 3468 return 0; 3472 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);3469 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); 3473 3470 if (primitiveValue->primitiveType() != CSSPrimitiveValue::CSS_NUMBER) 3474 3471 return 0; … … 3481 3478 { 3482 3479 ASSERT(values->length()); 3483 CSSPrimitiveValue* firstPrimitiveValue = static_cast<CSSPrimitiveValue*>(values->itemWithoutBoundsCheck(0));3480 CSSPrimitiveValue* firstPrimitiveValue = toCSSPrimitiveValue(values->itemWithoutBoundsCheck(0)); 3484 3481 RefPtr<CustomFilterColorParameter> colorParameter = CustomFilterColorParameter::create(name); 3485 3482 colorParameter->setColor(Color(firstPrimitiveValue->getRGBA32Value())); … … 3494 3491 if (!value->isPrimitiveValue()) 3495 3492 return 0; 3496 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);3493 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); 3497 3494 if (primitiveValue->primitiveType() != CSSPrimitiveValue::CSS_NUMBER) 3498 3495 return 0; … … 3543 3540 return 0; 3544 3541 3545 CSSPrimitiveValue* firstPrimitiveValue = static_cast<CSSPrimitiveValue*>(values->itemWithoutBoundsCheck(0));3542 CSSPrimitiveValue* firstPrimitiveValue = toCSSPrimitiveValue(values->itemWithoutBoundsCheck(0)); 3546 3543 if (firstPrimitiveValue->primitiveType() == CSSPrimitiveValue::CSS_NUMBER) 3547 3544 return parseCustomFilterNumberParameter(name, values); … … 3563 3560 if (!iterator.isPrimitiveValue()) 3564 3561 return false; 3565 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(iterator.value());3562 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(iterator.value()); 3566 3563 if (primitiveValue->primitiveType() != CSSPrimitiveValue::CSS_STRING) 3567 3564 return false; … … 3623 3620 ASSERT(mixFunction->length() <= 3); 3624 3621 while (iterator.hasMore()) { 3625 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(iterator.value());3622 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(iterator.value()); 3626 3623 if (CSSParser::isBlendMode(primitiveValue->getValueID())) 3627 3624 mixSettings.blendMode = *primitiveValue; … … 3655 3652 3656 3653 if (iterator.hasMore() && iterator.isPrimitiveValue()) { 3657 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(iterator.value());3654 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(iterator.value()); 3658 3655 if (primitiveValue->isNumber()) { 3659 3656 // If only one integer value is specified, it will set both … … 3664 3661 // Try to match another number for the rows. 3665 3662 if (iterator.hasMore() && iterator.isPrimitiveValue()) { 3666 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(iterator.value());3663 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(iterator.value()); 3667 3664 if (primitiveValue->isNumber()) { 3668 3665 meshRows = primitiveValue->getIntValue(); … … 3674 3671 3675 3672 if (iterator.hasMore() && iterator.isPrimitiveValue()) { 3676 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(iterator.value()); 3677 if (primitiveValue->getValueID() == CSSValueDetached) { 3673 if (toCSSPrimitiveValue(iterator.value())->getValueID() == CSSValueDetached) { 3678 3674 meshType = MeshTypeDetached; 3679 3675 iterator.advance(); … … 3720 3716 3721 3717 if (inValue->isPrimitiveValue()) { 3722 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(inValue); 3723 if (primitiveValue->getValueID() == CSSValueNone) 3718 if (toCSSPrimitiveValue(inValue)->getValueID() == CSSValueNone) 3724 3719 return true; 3725 3720 } … … 3791 3786 } 3792 3787 3793 CSSPrimitiveValue* firstValue = filterValue->length() ? static_cast<CSSPrimitiveValue*>(filterValue->itemWithoutBoundsCheck(0)) : 0;3788 CSSPrimitiveValue* firstValue = filterValue->length() ? toCSSPrimitiveValue(filterValue->itemWithoutBoundsCheck(0)) : 0; 3794 3789 switch (filterValue->operationType()) { 3795 3790 case WebKitCSSFilterValue::GrayscaleFilterOperation: -
trunk/Source/WebCore/css/TransformFunctions.cpp
r148753 r156253 111 111 continue; 112 112 113 CSSPrimitiveValue* firstValue = static_cast<CSSPrimitiveValue*>(transformValue->itemWithoutBoundsCheck(0));113 CSSPrimitiveValue* firstValue = toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(0)); 114 114 115 115 switch (transformValue->operationType()) { … … 125 125 if (transformValue->operationType() != WebKitCSSTransformValue::ScaleXTransformOperation) { 126 126 if (transformValue->length() > 1) { 127 CSSPrimitiveValue* secondValue = static_cast<CSSPrimitiveValue*>(transformValue->itemWithoutBoundsCheck(1));127 CSSPrimitiveValue* secondValue = toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(1)); 128 128 sy = secondValue->getDoubleValue(); 129 129 } else … … 147 147 if (transformValue->operationType() != WebKitCSSTransformValue::ScaleXTransformOperation) { 148 148 if (transformValue->length() > 2) { 149 CSSPrimitiveValue* thirdValue = static_cast<CSSPrimitiveValue*>(transformValue->itemWithoutBoundsCheck(2));149 CSSPrimitiveValue* thirdValue = toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(2)); 150 150 sz = thirdValue->getDoubleValue(); 151 151 } 152 152 if (transformValue->length() > 1) { 153 CSSPrimitiveValue* secondValue = static_cast<CSSPrimitiveValue*>(transformValue->itemWithoutBoundsCheck(1));153 CSSPrimitiveValue* secondValue = toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(1)); 154 154 sy = secondValue->getDoubleValue(); 155 155 } else … … 171 171 if (transformValue->operationType() != WebKitCSSTransformValue::TranslateXTransformOperation) { 172 172 if (transformValue->length() > 1) { 173 CSSPrimitiveValue* secondValue = static_cast<CSSPrimitiveValue*>(transformValue->itemWithoutBoundsCheck(1));173 CSSPrimitiveValue* secondValue = toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(1)); 174 174 ty = convertToFloatLength(secondValue, style, rootStyle, zoomFactor); 175 175 } … … 196 196 if (transformValue->operationType() != WebKitCSSTransformValue::TranslateXTransformOperation) { 197 197 if (transformValue->length() > 2) { 198 CSSPrimitiveValue* thirdValue = static_cast<CSSPrimitiveValue*>(transformValue->itemWithoutBoundsCheck(2));198 CSSPrimitiveValue* thirdValue = toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(2)); 199 199 tz = convertToFloatLength(thirdValue, style, rootStyle, zoomFactor); 200 200 } 201 201 if (transformValue->length() > 1) { 202 CSSPrimitiveValue* secondValue = static_cast<CSSPrimitiveValue*>(transformValue->itemWithoutBoundsCheck(1));202 CSSPrimitiveValue* secondValue = toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(1)); 203 203 ty = convertToFloatLength(secondValue, style, rootStyle, zoomFactor); 204 204 } … … 237 237 if (transformValue->length() < 4) 238 238 break; 239 CSSPrimitiveValue* secondValue = static_cast<CSSPrimitiveValue*>(transformValue->itemWithoutBoundsCheck(1));240 CSSPrimitiveValue* thirdValue = static_cast<CSSPrimitiveValue*>(transformValue->itemWithoutBoundsCheck(2));241 CSSPrimitiveValue* fourthValue = static_cast<CSSPrimitiveValue*>(transformValue->itemWithoutBoundsCheck(3));239 CSSPrimitiveValue* secondValue = toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(1)); 240 CSSPrimitiveValue* thirdValue = toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(2)); 241 CSSPrimitiveValue* fourthValue = toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(3)); 242 242 double x = firstValue->getDoubleValue(); 243 243 double y = secondValue->getDoubleValue(); … … 259 259 if (transformValue->operationType() == WebKitCSSTransformValue::SkewTransformOperation) { 260 260 if (transformValue->length() > 1) { 261 CSSPrimitiveValue* secondValue = static_cast<CSSPrimitiveValue*>(transformValue->itemWithoutBoundsCheck(1));261 CSSPrimitiveValue* secondValue = toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(1)); 262 262 angleY = secondValue->computeDegrees(); 263 263 } … … 271 271 break; 272 272 double a = firstValue->getDoubleValue(); 273 double b = static_cast<CSSPrimitiveValue*>(transformValue->itemWithoutBoundsCheck(1))->getDoubleValue();274 double c = static_cast<CSSPrimitiveValue*>(transformValue->itemWithoutBoundsCheck(2))->getDoubleValue();275 double d = static_cast<CSSPrimitiveValue*>(transformValue->itemWithoutBoundsCheck(3))->getDoubleValue();276 double e = zoomFactor * static_cast<CSSPrimitiveValue*>(transformValue->itemWithoutBoundsCheck(4))->getDoubleValue();277 double f = zoomFactor * static_cast<CSSPrimitiveValue*>(transformValue->itemWithoutBoundsCheck(5))->getDoubleValue();273 double b = toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(1))->getDoubleValue(); 274 double c = toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(2))->getDoubleValue(); 275 double d = toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(3))->getDoubleValue(); 276 double e = zoomFactor * toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(4))->getDoubleValue(); 277 double f = zoomFactor * toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(5))->getDoubleValue(); 278 278 operations.operations().append(MatrixTransformOperation::create(a, b, c, d, e, f)); 279 279 break; … … 282 282 if (transformValue->length() < 16) 283 283 break; 284 TransformationMatrix matrix( static_cast<CSSPrimitiveValue*>(transformValue->itemWithoutBoundsCheck(0))->getDoubleValue(),285 static_cast<CSSPrimitiveValue*>(transformValue->itemWithoutBoundsCheck(1))->getDoubleValue(),286 static_cast<CSSPrimitiveValue*>(transformValue->itemWithoutBoundsCheck(2))->getDoubleValue(),287 static_cast<CSSPrimitiveValue*>(transformValue->itemWithoutBoundsCheck(3))->getDoubleValue(),288 static_cast<CSSPrimitiveValue*>(transformValue->itemWithoutBoundsCheck(4))->getDoubleValue(),289 static_cast<CSSPrimitiveValue*>(transformValue->itemWithoutBoundsCheck(5))->getDoubleValue(),290 static_cast<CSSPrimitiveValue*>(transformValue->itemWithoutBoundsCheck(6))->getDoubleValue(),291 static_cast<CSSPrimitiveValue*>(transformValue->itemWithoutBoundsCheck(7))->getDoubleValue(),292 static_cast<CSSPrimitiveValue*>(transformValue->itemWithoutBoundsCheck(8))->getDoubleValue(),293 static_cast<CSSPrimitiveValue*>(transformValue->itemWithoutBoundsCheck(9))->getDoubleValue(),294 static_cast<CSSPrimitiveValue*>(transformValue->itemWithoutBoundsCheck(10))->getDoubleValue(),295 static_cast<CSSPrimitiveValue*>(transformValue->itemWithoutBoundsCheck(11))->getDoubleValue(),296 zoomFactor * static_cast<CSSPrimitiveValue*>(transformValue->itemWithoutBoundsCheck(12))->getDoubleValue(),297 zoomFactor * static_cast<CSSPrimitiveValue*>(transformValue->itemWithoutBoundsCheck(13))->getDoubleValue(),298 static_cast<CSSPrimitiveValue*>(transformValue->itemWithoutBoundsCheck(14))->getDoubleValue(),299 static_cast<CSSPrimitiveValue*>(transformValue->itemWithoutBoundsCheck(15))->getDoubleValue());284 TransformationMatrix matrix(toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(0))->getDoubleValue(), 285 toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(1))->getDoubleValue(), 286 toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(2))->getDoubleValue(), 287 toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(3))->getDoubleValue(), 288 toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(4))->getDoubleValue(), 289 toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(5))->getDoubleValue(), 290 toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(6))->getDoubleValue(), 291 toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(7))->getDoubleValue(), 292 toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(8))->getDoubleValue(), 293 toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(9))->getDoubleValue(), 294 toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(10))->getDoubleValue(), 295 toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(11))->getDoubleValue(), 296 zoomFactor * toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(12))->getDoubleValue(), 297 zoomFactor * toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(13))->getDoubleValue(), 298 toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(14))->getDoubleValue(), 299 toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(15))->getDoubleValue()); 300 300 operations.operations().append(Matrix3DTransformOperation::create(matrix)); 301 301 break; -
trunk/Source/WebCore/css/ViewportStyleResolver.cpp
r153880 r156253 111 111 return defaultValue; 112 112 113 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value.get());113 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value.get()); 114 114 115 115 if (primitiveValue->isNumber() || primitiveValue->isPx()) -
trunk/Source/WebCore/css/WebKitCSSMatrix.cpp
r151783 r156253 63 63 64 64 // Check for a "none" or empty transform. In these cases we can use the default identity matrix. 65 if (!value || (value->isPrimitiveValue() && ( static_cast<CSSPrimitiveValue*>(value.get()))->getValueID() == CSSValueNone))65 if (!value || (value->isPrimitiveValue() && (toCSSPrimitiveValue(value.get()))->getValueID() == CSSValueNone)) 66 66 return; 67 67 -
trunk/Source/WebCore/editing/ApplyStyleCommand.cpp
r155957 r156253 1516 1516 RefPtr<CSSValue> value = ComputedStyleExtractor(node).propertyValue(CSSPropertyFontSize); 1517 1517 ASSERT(value && value->isPrimitiveValue()); 1518 return static_cast<CSSPrimitiveValue*>(value.get())->getFloatValue(CSSPrimitiveValue::CSS_PX);1518 return toCSSPrimitiveValue(value.get())->getFloatValue(CSSPrimitiveValue::CSS_PX); 1519 1519 } 1520 1520 -
trunk/Source/WebCore/editing/EditingStyle.cpp
r155496 r156253 145 145 if (!value || !value->isPrimitiveValue()) 146 146 return 0; 147 return static_cast<CSSPrimitiveValue*>(value.get())->getValueID();147 return toCSSPrimitiveValue(value.get())->getValueID(); 148 148 } 149 149 … … 202 202 { 203 203 RefPtr<CSSValue> value = style->getPropertyCSSValue(m_propertyID); 204 return matches(element) && value && value->isPrimitiveValue() && static_cast<CSSPrimitiveValue*>(value.get())->getValueID() == m_primitiveValue->getValueID();204 return matches(element) && value && value->isPrimitiveValue() && toCSSPrimitiveValue(value.get())->getValueID() == m_primitiveValue->getValueID(); 205 205 } 206 206 … … 379 379 return Color::transparent; 380 380 381 CSSPrimitiveValue* primitiveColor = static_cast<CSSPrimitiveValue*>(colorValue);381 CSSPrimitiveValue* primitiveColor = toCSSPrimitiveValue(colorValue); 382 382 if (primitiveColor->isRGBColor()) 383 383 return primitiveColor->getRGBA32Value(); … … 499 499 return; 500 500 501 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value.get());501 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value.get()); 502 502 503 503 // Only PX handled now. If we handle more types in the future, perhaps … … 524 524 return false; 525 525 526 CSSValueID unicodeBidiValue = static_cast<CSSPrimitiveValue*>(unicodeBidi.get())->getValueID();526 CSSValueID unicodeBidiValue = toCSSPrimitiveValue(unicodeBidi.get())->getValueID(); 527 527 if (unicodeBidiValue == CSSValueEmbed) { 528 528 RefPtr<CSSValue> direction = m_mutableStyle->getPropertyCSSValue(CSSPropertyDirection); … … 530 530 return false; 531 531 532 writingDirection = static_cast<CSSPrimitiveValue*>(direction.get())->getValueID() == CSSValueLtr ? LeftToRightWritingDirection : RightToLeftWritingDirection;532 writingDirection = toCSSPrimitiveValue(direction.get())->getValueID() == CSSValueLtr ? LeftToRightWritingDirection : RightToLeftWritingDirection; 533 533 534 534 return true; … … 950 950 951 951 if (unicodeBidi && unicodeBidi->isPrimitiveValue()) { 952 m_mutableStyle->setProperty(CSSPropertyUnicodeBidi, static_cast<CSSValueID>( static_cast<CSSPrimitiveValue*>(unicodeBidi.get())->getValueID()));952 m_mutableStyle->setProperty(CSSPropertyUnicodeBidi, static_cast<CSSValueID>(toCSSPrimitiveValue(unicodeBidi.get())->getValueID())); 953 953 if (direction && direction->isPrimitiveValue()) 954 m_mutableStyle->setProperty(CSSPropertyDirection, static_cast<CSSValueID>( static_cast<CSSPrimitiveValue*>(direction.get())->getValueID()));954 m_mutableStyle->setProperty(CSSPropertyDirection, static_cast<CSSValueID>(toCSSPrimitiveValue(direction.get())->getValueID())); 955 955 } 956 956 } … … 1150 1150 if (!value->isPrimitiveValue()) 1151 1151 continue; 1152 if ( static_cast<CSSPrimitiveValue*>(value)->isPercentage()) {1152 if (toCSSPrimitiveValue(value)->isPercentage()) { 1153 1153 if (RefPtr<CSSValue> computedPropertyValue = computedStyle.propertyValue(property.id())) 1154 1154 fromComputedStyle->addParsedProperty(CSSProperty(property.id(), computedPropertyValue.release())); … … 1223 1223 if (!cssValue || !cssValue->isPrimitiveValue()) 1224 1224 return 0; 1225 return legacyFontSizeFromCSSValue(document, static_cast<CSSPrimitiveValue*>(cssValue.get()),1225 return legacyFontSizeFromCSSValue(document, toCSSPrimitiveValue(cssValue.get()), 1226 1226 m_shouldUseFixedDefaultFontSize, AlwaysUseLegacyFontSize); 1227 1227 } … … 1287 1287 continue; 1288 1288 1289 CSSValueID unicodeBidiValue = static_cast<CSSPrimitiveValue*>(unicodeBidi.get())->getValueID();1289 CSSValueID unicodeBidiValue = toCSSPrimitiveValue(unicodeBidi.get())->getValueID(); 1290 1290 if (unicodeBidiValue == CSSValueEmbed || unicodeBidiValue == CSSValueBidiOverride) 1291 1291 return NaturalWritingDirection; … … 1316 1316 continue; 1317 1317 1318 CSSValueID unicodeBidiValue = static_cast<CSSPrimitiveValue*>(unicodeBidi.get())->getValueID();1318 CSSValueID unicodeBidiValue = toCSSPrimitiveValue(unicodeBidi.get())->getValueID(); 1319 1319 if (unicodeBidiValue == CSSValueNormal) 1320 1320 continue; … … 1328 1328 continue; 1329 1329 1330 CSSValueID directionValue = static_cast<CSSPrimitiveValue*>(direction.get())->getValueID();1330 CSSValueID directionValue = toCSSPrimitiveValue(direction.get())->getValueID(); 1331 1331 if (directionValue != CSSValueLtr && directionValue != CSSValueRtl) 1332 1332 continue; … … 1468 1468 if (!fontSize->isPrimitiveValue()) 1469 1469 style->removeProperty(CSSPropertyFontSize); // Can't make sense of the number. Put no font size. 1470 else if (int legacyFontSize = legacyFontSizeFromCSSValue(document, static_cast<CSSPrimitiveValue*>(fontSize.get()),1470 else if (int legacyFontSize = legacyFontSizeFromCSSValue(document, toCSSPrimitiveValue(fontSize.get()), 1471 1471 shouldUseFixedFontDefaultSize, UseLegacyFontSizeOnlyIfPixelValuesMatch)) { 1472 1472 m_applyFontSize = String::number(legacyFontSize); … … 1500 1500 // Because b tag can only bold text, there are only two states in plain html: bold and not bold. 1501 1501 // Collapse all other values to either one of these two states for editing purposes. 1502 switch ( static_cast<CSSPrimitiveValue*>(fontWeight)->getValueID()) {1502 switch (toCSSPrimitiveValue(fontWeight)->getValueID()) { 1503 1503 case CSSValue100: 1504 1504 case CSSValue200: … … 1594 1594 if (!cssValue->isPrimitiveValue()) 1595 1595 return false; 1596 CSSPrimitiveValue* value = static_cast<CSSPrimitiveValue*>(cssValue);1596 CSSPrimitiveValue* value = toCSSPrimitiveValue(cssValue); 1597 1597 if (value->isRGBColor()) 1598 1598 return !alphaChannel(value->getRGBA32Value()); -
trunk/Source/WebCore/editing/markup.cpp
r155938 r156253 468 468 if (!value->isPrimitiveValue()) 469 469 return false; 470 return static_cast<CSSPrimitiveValue*>(value.get())->getValueID() == CSSValueNone;470 return toCSSPrimitiveValue(value.get())->getValueID() == CSSValueNone; 471 471 } 472 472 -
trunk/Source/WebCore/page/PageSerializer.cpp
r156144 r156253 333 333 continue; 334 334 335 CSSImageValue* imageValue = static_cast<CSSImageValue*>(cssValue.get());335 CSSImageValue* imageValue = toCSSImageValue(cssValue.get()); 336 336 StyleImage* styleImage = imageValue->cachedOrPendingImage(); 337 337 // Non cached-images are just place-holders and do not contain data. -
trunk/Source/WebCore/rendering/style/StylePendingImage.h
r141637 r156253 46 46 static PassRefPtr<StylePendingImage> create(CSSValue* value) { return adoptRef(new StylePendingImage(value)); } 47 47 48 virtual WrappedImagePtr data() const { return static_cast<CSSImageValue*>(m_value); }48 virtual WrappedImagePtr data() const { return toCSSImageValue(m_value); } 49 49 50 50 virtual PassRefPtr<CSSValue> cssValue() const { return m_value; } 51 CSSImageValue* cssImageValue() const { return m_value->isImageValue() ? static_cast<CSSImageValue*>(m_value) : 0; }52 CSSImageGeneratorValue* cssImageGeneratorValue() const { return m_value->isImageGeneratorValue() ? static_cast<CSSImageGeneratorValue*>(m_value) : 0; }53 CSSCursorImageValue* cssCursorImageValue() const { return m_value->isCursorImageValue() ? static_cast<CSSCursorImageValue*>(m_value) : 0; }51 CSSImageValue* cssImageValue() const { return m_value->isImageValue() ? toCSSImageValue(m_value) : 0; } 52 CSSImageGeneratorValue* cssImageGeneratorValue() const { return m_value->isImageGeneratorValue() ? toCSSImageGeneratorValue(m_value) : 0; } 53 CSSCursorImageValue* cssCursorImageValue() const { return m_value->isCursorImageValue() ? toCSSCursorImageValue(m_value) : 0; } 54 54 #if ENABLE(CSS_IMAGE_SET) 55 CSSImageSetValue* cssImageSetValue() const { return m_value->isImageSetValue() ? static_cast<CSSImageSetValue*>(m_value) : 0; }55 CSSImageSetValue* cssImageSetValue() const { return m_value->isImageSetValue() ? toCSSImageSetValue(m_value) : 0; } 56 56 #endif 57 57
Note:
See TracChangeset
for help on using the changeset viewer.