Unreviewed, rolling out r156253.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 23 Sep 2013 06:33:13 +0000 (06:33 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 23 Sep 2013 06:33:13 +0000 (06:33 +0000)
http://trac.webkit.org/changeset/156253
https://bugs.webkit.org/show_bug.cgi?id=121778

Caused >20 tests to crash with assertion failures (Requested
by ap on #webkit).

* css/CSSAspectRatioValue.h:
* css/CSSBorderImageSliceValue.h:
* css/CSSCalculationValue.cpp:
(WebCore::CSSCalcExpressionNodeParser::parseValue):
* css/CSSCalculationValue.h:
* css/CSSCrossfadeValue.cpp:
(WebCore::subimageKnownToBeOpaque):
* css/CSSCrossfadeValue.h:
(WebCore::toCSSCrossfadeValue):
* css/CSSCursorImageValue.cpp:
(WebCore::CSSCursorImageValue::~CSSCursorImageValue):
(WebCore::CSSCursorImageValue::updateIfSVGCursorIsUsed):
(WebCore::CSSCursorImageValue::cachedImage):
(WebCore::CSSCursorImageValue::cachedOrPendingImage):
(WebCore::CSSCursorImageValue::isSVGCursor):
* css/CSSCursorImageValue.h:
* css/CSSFilterImageValue.h:
(WebCore::toCSSFilterImageValue):
* css/CSSFontSelector.cpp:
(WebCore::CSSFontSelector::addFontFaceRule):
* css/CSSGradientValue.h:
* css/CSSImageGeneratorValue.cpp:
(WebCore::CSSImageGeneratorValue::image):
(WebCore::CSSImageGeneratorValue::fixedSize):
(WebCore::CSSImageGeneratorValue::loadSubimages):
(WebCore::CSSImageGeneratorValue::subimageIsPending):
(WebCore::CSSImageGeneratorValue::cachedImageForCSSValue):
* css/CSSImageGeneratorValue.h:
* css/CSSImageSetValue.cpp:
(WebCore::CSSImageSetValue::fillImageSet):
* css/CSSImageSetValue.h:
* css/CSSImageValue.h:
* css/CSSInheritedValue.h:
* css/CSSInitialValue.h:
* css/CSSLineBoxContainValue.h:
* css/CSSParser.cpp:
(WebCore::CSSParser::parseColor):
(WebCore::CSSParser::addProperty):
(WebCore::CSSParser::parse3ValuesFillPosition):
(WebCore::CSSParser::parseFillPosition):
(WebCore::CSSParser::parseFillRepeat):
(WebCore::CSSParser::parseDeprecatedRadialGradient):
(WebCore::CSSParser::parseRadialGradient):
* css/CSSPrimitiveValue.h:
* css/CSSReflectValue.h:
* css/CSSToStyleMap.cpp:
(WebCore::CSSToStyleMap::mapFillAttachment):
(WebCore::CSSToStyleMap::mapFillClip):
(WebCore::CSSToStyleMap::mapFillComposite):
(WebCore::CSSToStyleMap::mapFillBlendMode):
(WebCore::CSSToStyleMap::mapFillOrigin):
(WebCore::CSSToStyleMap::mapFillRepeatX):
(WebCore::CSSToStyleMap::mapFillRepeatY):
(WebCore::CSSToStyleMap::mapFillSize):
(WebCore::CSSToStyleMap::mapFillXPosition):
(WebCore::CSSToStyleMap::mapFillYPosition):
(WebCore::CSSToStyleMap::mapFillMaskSourceType):
(WebCore::CSSToStyleMap::mapAnimationDelay):
(WebCore::CSSToStyleMap::mapAnimationDirection):
(WebCore::CSSToStyleMap::mapAnimationDuration):
(WebCore::CSSToStyleMap::mapAnimationFillMode):
(WebCore::CSSToStyleMap::mapAnimationIterationCount):
(WebCore::CSSToStyleMap::mapAnimationName):
(WebCore::CSSToStyleMap::mapAnimationPlayState):
(WebCore::CSSToStyleMap::mapAnimationProperty):
(WebCore::CSSToStyleMap::mapAnimationTimingFunction):
(WebCore::CSSToStyleMap::mapNinePieceImageSlice):
(WebCore::CSSToStyleMap::mapNinePieceImageQuad):
(WebCore::CSSToStyleMap::mapNinePieceImageRepeat):
* css/CSSValue.cpp:
(WebCore::CSSValue::destroy):
* css/CSSValue.h:
(WebCore::CSSValue::isCSSLineBoxContainValue):
(WebCore::CSSValue::isCalculationValue):
* css/CSSValueList.h:
* css/CSSVariableValue.h:
* css/DeprecatedStyleBuilder.cpp:
(WebCore::ApplyPropertyDefault::applyValue):
(WebCore::ApplyPropertyNumber::applyValue):
(WebCore::ApplyPropertyAuto::applyValue):
(WebCore::ApplyPropertyClip::applyValue):
(WebCore::ApplyPropertyColor::applyValue):
(WebCore::ApplyPropertyLength::applyValue):
(WebCore::ApplyPropertyString::applyValue):
(WebCore::ApplyPropertyBorderRadius::applyValue):
(WebCore::ApplyPropertyComputeLength::applyValue):
(WebCore::ApplyPropertyFont::applyValue):
(WebCore::ApplyPropertyFontFamily::applyValue):
(WebCore::ApplyPropertyFontSize::applyValue):
(WebCore::ApplyPropertyFontWeight::applyValue):
(WebCore::ApplyPropertyFontVariantLigatures::applyValue):
(WebCore::ApplyPropertyCounter::applyValue):
(WebCore::ApplyPropertyCursor::applyValue):
(WebCore::ApplyPropertyTextAlign::applyValue):
(WebCore::ApplyPropertyTextDecoration::applyValue):
(WebCore::ApplyPropertyMarqueeIncrement::applyValue):
(WebCore::ApplyPropertyMarqueeRepetition::applyValue):
(WebCore::ApplyPropertyMarqueeSpeed::applyValue):
(WebCore::ApplyPropertyTextUnderlinePosition::applyValue):
(WebCore::ApplyPropertyLineHeight::applyValue):
(WebCore::ApplyPropertyLineHeightForIOSTextAutosizing::applyValue):
(WebCore::ApplyPropertyPageSize::applyValue):
(WebCore::ApplyPropertyTextEmphasisStyle::applyValue):
(WebCore::ApplyPropertyResize::applyValue):
(WebCore::ApplyPropertyVerticalAlign::applyValue):
(WebCore::ApplyPropertyAspectRatio::applyValue):
(WebCore::ApplyPropertyZoom::applyValue):
(WebCore::ApplyPropertyDisplay::applyValue):
(WebCore::ApplyPropertyClipPath::applyValue):
(WebCore::ApplyPropertyShape::applyValue):
(WebCore::ApplyPropertyImageResolution::applyValue):
(WebCore::ApplyPropertyTextIndent::applyValue):
* css/FontFeatureValue.h:
* css/FontValue.h:
* css/MediaList.cpp:
(WebCore::reportMediaQueryWarningIfNeeded):
* css/MediaQueryEvaluator.cpp:
(WebCore::compareAspectRatioValue):
(WebCore::numberValue):
(WebCore::orientationMediaFeatureEval):
(WebCore::evalResolution):
(WebCore::device_pixel_ratioMediaFeatureEval):
(WebCore::resolutionMediaFeatureEval):
(WebCore::computeLength):
(WebCore::view_modeMediaFeatureEval):
(WebCore::pointerMediaFeatureEval):
* css/SVGCSSStyleSelector.cpp:
(WebCore::StyleResolver::applySVGProperty):
* css/ShadowValue.h:
* css/StylePropertySet.cpp:
(WebCore::StylePropertySet::getLayeredShorthandValue):
* css/StyleResolver.cpp:
(WebCore::createGridTrackSize):
(WebCore::createGridTrackList):
(WebCore::createGridPosition):
(WebCore::hasVariableReference):
(WebCore::StyleResolver::applyProperty):
(WebCore::StyleResolver::styleImage):
(WebCore::StyleResolver::generatedOrPendingFromValue):
(WebCore::StyleResolver::styleShader):
(WebCore::StyleResolver::parseCustomFilterArrayParameter):
(WebCore::StyleResolver::parseCustomFilterColorParameter):
(WebCore::StyleResolver::parseCustomFilterNumberParameter):
(WebCore::StyleResolver::parseCustomFilterParameter):
(WebCore::StyleResolver::parseCustomFilterParameterList):
(WebCore::StyleResolver::createCustomFilterOperationWithInlineSyntax):
(WebCore::StyleResolver::createFilterOperations):
* css/TransformFunctions.cpp:
(WebCore::transformsForValue):
* css/ViewportStyleResolver.cpp:
(WebCore::ViewportStyleResolver::getViewportArgumentValue):
* css/WebKitCSSMatrix.cpp:
(WebCore::WebKitCSSMatrix::setMatrixValue):
* editing/ApplyStyleCommand.cpp:
(WebCore::ApplyStyleCommand::computedFontSize):
* editing/EditingStyle.cpp:
(WebCore::identifierForStyleProperty):
(WebCore::HTMLElementEquivalent::valueIsPresentInStyle):
(WebCore::cssValueToRGBA):
(WebCore::EditingStyle::extractFontSizeDelta):
(WebCore::EditingStyle::textDirection):
(WebCore::EditingStyle::prepareToApplyAt):
(WebCore::EditingStyle::mergeStyleFromRulesForSerialization):
(WebCore::EditingStyle::legacyFontSize):
(WebCore::EditingStyle::textDirectionForSelection):
(WebCore::StyleChange::extractTextStyles):
(WebCore::fontWeightIsBold):
(WebCore::isTransparentColorValue):
* editing/markup.cpp:
(WebCore::propertyMissingOrEqualToNone):
* page/PageSerializer.cpp:
(WebCore::PageSerializer::retrieveResourcesForProperties):
* rendering/style/StylePendingImage.h:
(WebCore::StylePendingImage::data):
(WebCore::StylePendingImage::cssImageValue):
(WebCore::StylePendingImage::cssImageGeneratorValue):
(WebCore::StylePendingImage::cssCursorImageValue):
(WebCore::StylePendingImage::cssImageSetValue):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@156260 268f45cc-cd09-0410-ab3c-d52691b4dbfc

45 files changed:
Source/WebCore/ChangeLog
Source/WebCore/css/CSSAspectRatioValue.h
Source/WebCore/css/CSSBorderImageSliceValue.h
Source/WebCore/css/CSSCalculationValue.cpp
Source/WebCore/css/CSSCalculationValue.h
Source/WebCore/css/CSSCrossfadeValue.cpp
Source/WebCore/css/CSSCrossfadeValue.h
Source/WebCore/css/CSSCursorImageValue.cpp
Source/WebCore/css/CSSCursorImageValue.h
Source/WebCore/css/CSSFilterImageValue.h
Source/WebCore/css/CSSFontSelector.cpp
Source/WebCore/css/CSSGradientValue.h
Source/WebCore/css/CSSImageGeneratorValue.cpp
Source/WebCore/css/CSSImageGeneratorValue.h
Source/WebCore/css/CSSImageSetValue.cpp
Source/WebCore/css/CSSImageSetValue.h
Source/WebCore/css/CSSImageValue.h
Source/WebCore/css/CSSInheritedValue.h
Source/WebCore/css/CSSInitialValue.h
Source/WebCore/css/CSSLineBoxContainValue.h
Source/WebCore/css/CSSParser.cpp
Source/WebCore/css/CSSPrimitiveValue.h
Source/WebCore/css/CSSReflectValue.h
Source/WebCore/css/CSSToStyleMap.cpp
Source/WebCore/css/CSSValue.cpp
Source/WebCore/css/CSSValue.h
Source/WebCore/css/CSSValueList.h
Source/WebCore/css/CSSVariableValue.h
Source/WebCore/css/DeprecatedStyleBuilder.cpp
Source/WebCore/css/FontFeatureValue.h
Source/WebCore/css/FontValue.h
Source/WebCore/css/MediaList.cpp
Source/WebCore/css/MediaQueryEvaluator.cpp
Source/WebCore/css/SVGCSSStyleSelector.cpp
Source/WebCore/css/ShadowValue.h
Source/WebCore/css/StylePropertySet.cpp
Source/WebCore/css/StyleResolver.cpp
Source/WebCore/css/TransformFunctions.cpp
Source/WebCore/css/ViewportStyleResolver.cpp
Source/WebCore/css/WebKitCSSMatrix.cpp
Source/WebCore/editing/ApplyStyleCommand.cpp
Source/WebCore/editing/EditingStyle.cpp
Source/WebCore/editing/markup.cpp
Source/WebCore/page/PageSerializer.cpp
Source/WebCore/rendering/style/StylePendingImage.h

index 3545938..b9ecd29 100644 (file)
@@ -1,5 +1,193 @@
 2013-09-22  Commit Queue  <commit-queue@webkit.org>
 
+        Unreviewed, rolling out r156253.
+        http://trac.webkit.org/changeset/156253
+        https://bugs.webkit.org/show_bug.cgi?id=121778
+
+        Caused >20 tests to crash with assertion failures (Requested
+        by ap on #webkit).
+
+        * css/CSSAspectRatioValue.h:
+        * css/CSSBorderImageSliceValue.h:
+        * css/CSSCalculationValue.cpp:
+        (WebCore::CSSCalcExpressionNodeParser::parseValue):
+        * css/CSSCalculationValue.h:
+        * css/CSSCrossfadeValue.cpp:
+        (WebCore::subimageKnownToBeOpaque):
+        * css/CSSCrossfadeValue.h:
+        (WebCore::toCSSCrossfadeValue):
+        * css/CSSCursorImageValue.cpp:
+        (WebCore::CSSCursorImageValue::~CSSCursorImageValue):
+        (WebCore::CSSCursorImageValue::updateIfSVGCursorIsUsed):
+        (WebCore::CSSCursorImageValue::cachedImage):
+        (WebCore::CSSCursorImageValue::cachedOrPendingImage):
+        (WebCore::CSSCursorImageValue::isSVGCursor):
+        * css/CSSCursorImageValue.h:
+        * css/CSSFilterImageValue.h:
+        (WebCore::toCSSFilterImageValue):
+        * css/CSSFontSelector.cpp:
+        (WebCore::CSSFontSelector::addFontFaceRule):
+        * css/CSSGradientValue.h:
+        * css/CSSImageGeneratorValue.cpp:
+        (WebCore::CSSImageGeneratorValue::image):
+        (WebCore::CSSImageGeneratorValue::fixedSize):
+        (WebCore::CSSImageGeneratorValue::loadSubimages):
+        (WebCore::CSSImageGeneratorValue::subimageIsPending):
+        (WebCore::CSSImageGeneratorValue::cachedImageForCSSValue):
+        * css/CSSImageGeneratorValue.h:
+        * css/CSSImageSetValue.cpp:
+        (WebCore::CSSImageSetValue::fillImageSet):
+        * css/CSSImageSetValue.h:
+        * css/CSSImageValue.h:
+        * css/CSSInheritedValue.h:
+        * css/CSSInitialValue.h:
+        * css/CSSLineBoxContainValue.h:
+        * css/CSSParser.cpp:
+        (WebCore::CSSParser::parseColor):
+        (WebCore::CSSParser::addProperty):
+        (WebCore::CSSParser::parse3ValuesFillPosition):
+        (WebCore::CSSParser::parseFillPosition):
+        (WebCore::CSSParser::parseFillRepeat):
+        (WebCore::CSSParser::parseDeprecatedRadialGradient):
+        (WebCore::CSSParser::parseRadialGradient):
+        * css/CSSPrimitiveValue.h:
+        * css/CSSReflectValue.h:
+        * css/CSSToStyleMap.cpp:
+        (WebCore::CSSToStyleMap::mapFillAttachment):
+        (WebCore::CSSToStyleMap::mapFillClip):
+        (WebCore::CSSToStyleMap::mapFillComposite):
+        (WebCore::CSSToStyleMap::mapFillBlendMode):
+        (WebCore::CSSToStyleMap::mapFillOrigin):
+        (WebCore::CSSToStyleMap::mapFillRepeatX):
+        (WebCore::CSSToStyleMap::mapFillRepeatY):
+        (WebCore::CSSToStyleMap::mapFillSize):
+        (WebCore::CSSToStyleMap::mapFillXPosition):
+        (WebCore::CSSToStyleMap::mapFillYPosition):
+        (WebCore::CSSToStyleMap::mapFillMaskSourceType):
+        (WebCore::CSSToStyleMap::mapAnimationDelay):
+        (WebCore::CSSToStyleMap::mapAnimationDirection):
+        (WebCore::CSSToStyleMap::mapAnimationDuration):
+        (WebCore::CSSToStyleMap::mapAnimationFillMode):
+        (WebCore::CSSToStyleMap::mapAnimationIterationCount):
+        (WebCore::CSSToStyleMap::mapAnimationName):
+        (WebCore::CSSToStyleMap::mapAnimationPlayState):
+        (WebCore::CSSToStyleMap::mapAnimationProperty):
+        (WebCore::CSSToStyleMap::mapAnimationTimingFunction):
+        (WebCore::CSSToStyleMap::mapNinePieceImageSlice):
+        (WebCore::CSSToStyleMap::mapNinePieceImageQuad):
+        (WebCore::CSSToStyleMap::mapNinePieceImageRepeat):
+        * css/CSSValue.cpp:
+        (WebCore::CSSValue::destroy):
+        * css/CSSValue.h:
+        (WebCore::CSSValue::isCSSLineBoxContainValue):
+        (WebCore::CSSValue::isCalculationValue):
+        * css/CSSValueList.h:
+        * css/CSSVariableValue.h:
+        * css/DeprecatedStyleBuilder.cpp:
+        (WebCore::ApplyPropertyDefault::applyValue):
+        (WebCore::ApplyPropertyNumber::applyValue):
+        (WebCore::ApplyPropertyAuto::applyValue):
+        (WebCore::ApplyPropertyClip::applyValue):
+        (WebCore::ApplyPropertyColor::applyValue):
+        (WebCore::ApplyPropertyLength::applyValue):
+        (WebCore::ApplyPropertyString::applyValue):
+        (WebCore::ApplyPropertyBorderRadius::applyValue):
+        (WebCore::ApplyPropertyComputeLength::applyValue):
+        (WebCore::ApplyPropertyFont::applyValue):
+        (WebCore::ApplyPropertyFontFamily::applyValue):
+        (WebCore::ApplyPropertyFontSize::applyValue):
+        (WebCore::ApplyPropertyFontWeight::applyValue):
+        (WebCore::ApplyPropertyFontVariantLigatures::applyValue):
+        (WebCore::ApplyPropertyCounter::applyValue):
+        (WebCore::ApplyPropertyCursor::applyValue):
+        (WebCore::ApplyPropertyTextAlign::applyValue):
+        (WebCore::ApplyPropertyTextDecoration::applyValue):
+        (WebCore::ApplyPropertyMarqueeIncrement::applyValue):
+        (WebCore::ApplyPropertyMarqueeRepetition::applyValue):
+        (WebCore::ApplyPropertyMarqueeSpeed::applyValue):
+        (WebCore::ApplyPropertyTextUnderlinePosition::applyValue):
+        (WebCore::ApplyPropertyLineHeight::applyValue):
+        (WebCore::ApplyPropertyLineHeightForIOSTextAutosizing::applyValue):
+        (WebCore::ApplyPropertyPageSize::applyValue):
+        (WebCore::ApplyPropertyTextEmphasisStyle::applyValue):
+        (WebCore::ApplyPropertyResize::applyValue):
+        (WebCore::ApplyPropertyVerticalAlign::applyValue):
+        (WebCore::ApplyPropertyAspectRatio::applyValue):
+        (WebCore::ApplyPropertyZoom::applyValue):
+        (WebCore::ApplyPropertyDisplay::applyValue):
+        (WebCore::ApplyPropertyClipPath::applyValue):
+        (WebCore::ApplyPropertyShape::applyValue):
+        (WebCore::ApplyPropertyImageResolution::applyValue):
+        (WebCore::ApplyPropertyTextIndent::applyValue):
+        * css/FontFeatureValue.h:
+        * css/FontValue.h:
+        * css/MediaList.cpp:
+        (WebCore::reportMediaQueryWarningIfNeeded):
+        * css/MediaQueryEvaluator.cpp:
+        (WebCore::compareAspectRatioValue):
+        (WebCore::numberValue):
+        (WebCore::orientationMediaFeatureEval):
+        (WebCore::evalResolution):
+        (WebCore::device_pixel_ratioMediaFeatureEval):
+        (WebCore::resolutionMediaFeatureEval):
+        (WebCore::computeLength):
+        (WebCore::view_modeMediaFeatureEval):
+        (WebCore::pointerMediaFeatureEval):
+        * css/SVGCSSStyleSelector.cpp:
+        (WebCore::StyleResolver::applySVGProperty):
+        * css/ShadowValue.h:
+        * css/StylePropertySet.cpp:
+        (WebCore::StylePropertySet::getLayeredShorthandValue):
+        * css/StyleResolver.cpp:
+        (WebCore::createGridTrackSize):
+        (WebCore::createGridTrackList):
+        (WebCore::createGridPosition):
+        (WebCore::hasVariableReference):
+        (WebCore::StyleResolver::applyProperty):
+        (WebCore::StyleResolver::styleImage):
+        (WebCore::StyleResolver::generatedOrPendingFromValue):
+        (WebCore::StyleResolver::styleShader):
+        (WebCore::StyleResolver::parseCustomFilterArrayParameter):
+        (WebCore::StyleResolver::parseCustomFilterColorParameter):
+        (WebCore::StyleResolver::parseCustomFilterNumberParameter):
+        (WebCore::StyleResolver::parseCustomFilterParameter):
+        (WebCore::StyleResolver::parseCustomFilterParameterList):
+        (WebCore::StyleResolver::createCustomFilterOperationWithInlineSyntax):
+        (WebCore::StyleResolver::createFilterOperations):
+        * css/TransformFunctions.cpp:
+        (WebCore::transformsForValue):
+        * css/ViewportStyleResolver.cpp:
+        (WebCore::ViewportStyleResolver::getViewportArgumentValue):
+        * css/WebKitCSSMatrix.cpp:
+        (WebCore::WebKitCSSMatrix::setMatrixValue):
+        * editing/ApplyStyleCommand.cpp:
+        (WebCore::ApplyStyleCommand::computedFontSize):
+        * editing/EditingStyle.cpp:
+        (WebCore::identifierForStyleProperty):
+        (WebCore::HTMLElementEquivalent::valueIsPresentInStyle):
+        (WebCore::cssValueToRGBA):
+        (WebCore::EditingStyle::extractFontSizeDelta):
+        (WebCore::EditingStyle::textDirection):
+        (WebCore::EditingStyle::prepareToApplyAt):
+        (WebCore::EditingStyle::mergeStyleFromRulesForSerialization):
+        (WebCore::EditingStyle::legacyFontSize):
+        (WebCore::EditingStyle::textDirectionForSelection):
+        (WebCore::StyleChange::extractTextStyles):
+        (WebCore::fontWeightIsBold):
+        (WebCore::isTransparentColorValue):
+        * editing/markup.cpp:
+        (WebCore::propertyMissingOrEqualToNone):
+        * page/PageSerializer.cpp:
+        (WebCore::PageSerializer::retrieveResourcesForProperties):
+        * rendering/style/StylePendingImage.h:
+        (WebCore::StylePendingImage::data):
+        (WebCore::StylePendingImage::cssImageValue):
+        (WebCore::StylePendingImage::cssImageGeneratorValue):
+        (WebCore::StylePendingImage::cssCursorImageValue):
+        (WebCore::StylePendingImage::cssImageSetValue):
+
+2013-09-22  Commit Queue  <commit-queue@webkit.org>
+
         Unreviewed, rolling out r156257.
         http://trac.webkit.org/changeset/156257
         https://bugs.webkit.org/show_bug.cgi?id=121777
index d8a39af..9fc78cb 100644 (file)
@@ -60,8 +60,6 @@ private:
     float m_denominatorValue;
 };
 
-CSS_VALUE_TYPE_CASTS(AspectRatioValue)
-
 }
 
 #endif
index 4b8a34b..4112bd9 100644 (file)
@@ -56,8 +56,6 @@ private:
     CSSBorderImageSliceValue(PassRefPtr<CSSPrimitiveValue> slices, bool fill);
 };
 
-CSS_VALUE_TYPE_CASTS(BorderImageSliceValue)
-
 } // namespace WebCore
 
 #endif // CSSBorderImageSliceValue_h
index 3fc89b4..2d1a3fe 100644 (file)
@@ -449,7 +449,8 @@ private:
         if (!value || !value->isPrimitiveValue())
             return false;
 
-        result->value = CSSCalcPrimitiveValue::create(toCSSPrimitiveValue(value.get()), parserValue->isInt);
+        CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value.get());
+        result->value = CSSCalcPrimitiveValue::create(primitiveValue, parserValue->isInt);
 
         ++*index;
         return true;
index 75d1517..befce16 100644 (file)
@@ -127,8 +127,6 @@ private:
     const RefPtr<CSSCalcExpressionNode> m_expression;
     const bool m_nonNegative;
 };
-
-CSS_VALUE_TYPE_CASTS(CalcValue)
     
 } // namespace WebCore
 
index a285e46..aef60a1 100644 (file)
@@ -47,10 +47,10 @@ static inline double blendFunc(double from, double to, double progress)
 static bool subimageKnownToBeOpaque(CSSValue* value, const RenderObject* renderer)
 {
     if (value->isImageValue())
-        return toCSSImageValue(value)->knownToBeOpaque(renderer);
+        return static_cast<CSSImageValue*>(value)->knownToBeOpaque(renderer);
 
     if (value->isImageGeneratorValue())
-        return toCSSImageGeneratorValue(value)->knownToBeOpaque(renderer);
+        return static_cast<CSSImageGeneratorValue*>(value)->knownToBeOpaque(renderer);
 
     ASSERT_NOT_REACHED();
 
index 5b793e9..f9dbbac 100644 (file)
@@ -110,7 +110,11 @@ private:
     CrossfadeSubimageObserverProxy m_crossfadeSubimageObserver;
 };
 
-CSS_VALUE_TYPE_CASTS(CrossfadeValue)
+inline CSSCrossfadeValue* toCSSCrossfadeValue(CSSImageGeneratorValue* value)
+{
+    ASSERT_WITH_SECURITY_IMPLICATION(!value || value->isCrossfadeValue());
+    return static_cast<CSSCrossfadeValue*>(value);
+}
 
 } // namespace WebCore
 
index 782ca4b..2040670 100644 (file)
@@ -75,7 +75,7 @@ CSSCursorImageValue::~CSSCursorImageValue()
 
     HashSet<SVGElement*>::const_iterator it = m_referencedElements.begin();
     HashSet<SVGElement*>::const_iterator end = m_referencedElements.end();
-    String url = toCSSImageValue(m_imageValue.get())->url();
+    String url = static_cast<CSSImageValue*>(m_imageValue.get())->url();
 
     for (; it != end; ++it) {
         SVGElement* referencedElement = *it;
@@ -110,7 +110,7 @@ bool CSSCursorImageValue::updateIfSVGCursorIsUsed(Element* element)
     if (!isSVGCursor())
         return false;
 
-    String url = toCSSImageValue(m_imageValue.get())->url();
+    String url = static_cast<CSSImageValue*>(m_imageValue.get())->url();
     if (SVGCursorElement* cursorElement = resourceReferencedByCursorElement(url, &element->document())) {
         // FIXME: This will override hot spot specified in CSS, which is probably incorrect.
         SVGLengthContext lengthContext(0);
@@ -139,7 +139,7 @@ StyleImage* CSSCursorImageValue::cachedImage(CachedResourceLoader* loader)
 {
 #if ENABLE(CSS_IMAGE_SET)
     if (m_imageValue->isImageSetValue())
-        return toCSSImageSetValue(m_imageValue.get())->cachedImageSet(loader);
+        return static_cast<CSSImageSetValue*>(m_imageValue.get())->cachedImageSet(loader);
 #endif
 
     if (!m_accessedImage) {
@@ -150,7 +150,7 @@ StyleImage* CSSCursorImageValue::cachedImage(CachedResourceLoader* loader)
         // to change the URL of the CSSImageValue (which would then change behavior like cssText),
         // we create an alternate CSSImageValue to use.
         if (isSVGCursor() && loader && loader->document()) {
-            RefPtr<CSSImageValue> imageValue = toCSSImageValue(m_imageValue.get());
+            RefPtr<CSSImageValue> imageValue = static_cast<CSSImageValue*>(m_imageValue.get());
             // FIXME: This will fail if the <cursor> element is in a shadow DOM (bug 59827)
             if (SVGCursorElement* cursorElement = resourceReferencedByCursorElement(imageValue->url(), loader->document())) {
                 RefPtr<CSSImageValue> svgImageValue = CSSImageValue::create(cursorElement->href());
@@ -162,7 +162,7 @@ StyleImage* CSSCursorImageValue::cachedImage(CachedResourceLoader* loader)
 #endif
 
         if (m_imageValue->isImageValue())
-            m_image = toCSSImageValue(m_imageValue.get())->cachedImage(loader);
+            m_image = static_cast<CSSImageValue*>(m_imageValue.get())->cachedImage(loader);
     }
 
     if (m_image && m_image->isCachedImage())
@@ -176,7 +176,7 @@ StyleImage* CSSCursorImageValue::cachedOrPendingImage(Document* document)
 #if ENABLE(CSS_IMAGE_SET)
     // Need to delegate completely so that changes in device scale factor can be handled appropriately.
     if (m_imageValue->isImageSetValue())
-        return toCSSImageSetValue(m_imageValue.get())->cachedOrPendingImageSet(document);
+        return static_cast<CSSImageSetValue*>(m_imageValue.get())->cachedOrPendingImageSet(document);
 #endif
 
     if (!m_image)
@@ -189,7 +189,7 @@ StyleImage* CSSCursorImageValue::cachedOrPendingImage(Document* document)
 bool CSSCursorImageValue::isSVGCursor() const
 {
     if (m_imageValue->isImageValue()) {
-        RefPtr<CSSImageValue> imageValue = toCSSImageValue(m_imageValue.get());
+        RefPtr<CSSImageValue> imageValue = static_cast<CSSImageValue*>(m_imageValue.get());
         KURL kurl(ParsedURLString, imageValue->url());
         return kurl.hasFragmentIdentifier();
     }
index ccbf614..4b6b0ec 100644 (file)
@@ -82,8 +82,6 @@ private:
 #endif
 };
 
-CSS_VALUE_TYPE_CASTS(CursorImageValue)
-
 } // namespace WebCore
 
 #endif // CSSCursorImageValue_h
index a549108..9a5bf0e 100644 (file)
@@ -119,7 +119,11 @@ private:
     FilterSubimageObserverProxy m_filterSubimageObserver;
 };
 
-CSS_VALUE_TYPE_CASTS(FilterImageValue)
+inline CSSFilterImageValue* toCSSFilterImageValue(CSSImageGeneratorValue* value)
+{
+    ASSERT_WITH_SECURITY_IMPLICATION(!value || value->isFilterImageValue());
+    return static_cast<CSSFilterImageValue*>(value);
+}
 
 } // namespace WebCore
 
index 3ae9bc6..f231ad8 100644 (file)
@@ -116,7 +116,7 @@ void CSSFontSelector::addFontFaceRule(const StyleRuleFontFace* fontFaceRule)
         if (!fontStyle->isPrimitiveValue())
             return;
 
-        switch (toCSSPrimitiveValue(fontStyle.get())->getValueID()) {
+        switch (static_cast<CSSPrimitiveValue*>(fontStyle.get())->getValueID()) {
         case CSSValueNormal:
             traitsMask |= FontStyleNormalMask;
             break;
@@ -134,7 +134,7 @@ void CSSFontSelector::addFontFaceRule(const StyleRuleFontFace* fontFaceRule)
         if (!fontWeight->isPrimitiveValue())
             return;
 
-        switch (toCSSPrimitiveValue(fontWeight.get())->getValueID()) {
+        switch (static_cast<CSSPrimitiveValue*>(fontWeight.get())->getValueID()) {
         case CSSValueBold:
         case CSSValue700:
             traitsMask |= FontWeight700Mask;
@@ -185,7 +185,7 @@ void CSSFontSelector::addFontFaceRule(const StyleRuleFontFace* fontFaceRule)
             return;
 
         for (unsigned i = 0; i < numVariants; ++i) {
-            switch (toCSSPrimitiveValue(variantList->itemWithoutBoundsCheck(i))->getValueID()) {
+            switch (static_cast<CSSPrimitiveValue*>(variantList->itemWithoutBoundsCheck(i))->getValueID()) {
                 case CSSValueNormal:
                     traitsMask |= FontVariantNormalMask;
                     break;
@@ -265,7 +265,7 @@ void CSSFontSelector::addFontFaceRule(const StyleRuleFontFace* fontFaceRule)
     // Hash under every single family name.
     int familyLength = familyList->length();
     for (int i = 0; i < familyLength; i++) {
-        CSSPrimitiveValue* item = toCSSPrimitiveValue(familyList->itemWithoutBoundsCheck(i));
+        CSSPrimitiveValue* item = static_cast<CSSPrimitiveValue*>(familyList->itemWithoutBoundsCheck(i));
         String familyName;
         if (item->isString()) {
             familyName = item->getStringValue();
index 8f1f38c..3f1ec04 100644 (file)
@@ -232,8 +232,6 @@ private:
     RefPtr<CSSPrimitiveValue> m_endVerticalSize;
 };
 
-CSS_VALUE_TYPE_CASTS(GradientValue)
-
 } // namespace WebCore
 
 #endif // CSSGradientValue_h
index 2aa3d36..e5a4f59 100644 (file)
@@ -110,10 +110,10 @@ PassRefPtr<Image> CSSImageGeneratorValue::image(RenderObject* renderer, const In
     case CanvasClass:
         return static_cast<CSSCanvasValue*>(this)->image(renderer, size);
     case CrossfadeClass:
-        return toCSSCrossfadeValue(this)->image(renderer, size);
+        return static_cast<CSSCrossfadeValue*>(this)->image(renderer, size);
 #if ENABLE(CSS_FILTERS)
     case FilterImageClass:
-        return toCSSFilterImageValue(this)->image(renderer, size);
+        return static_cast<CSSFilterImageValue*>(this)->image(renderer, size);
 #endif
     case LinearGradientClass:
         return static_cast<CSSLinearGradientValue*>(this)->image(renderer, size);
@@ -152,10 +152,10 @@ IntSize CSSImageGeneratorValue::fixedSize(const RenderObject* renderer)
     case CanvasClass:
         return static_cast<CSSCanvasValue*>(this)->fixedSize(renderer);
     case CrossfadeClass:
-        return toCSSCrossfadeValue(this)->fixedSize(renderer);
+        return static_cast<CSSCrossfadeValue*>(this)->fixedSize(renderer);
 #if ENABLE(CSS_FILTERS)
     case FilterImageClass:
-        return toCSSFilterImageValue(this)->fixedSize(renderer);
+        return static_cast<CSSFilterImageValue*>(this)->fixedSize(renderer);
 #endif
     case LinearGradientClass:
         return static_cast<CSSLinearGradientValue*>(this)->fixedSize(renderer);
@@ -213,14 +213,14 @@ void CSSImageGeneratorValue::loadSubimages(CachedResourceLoader* cachedResourceL
 {
     switch (classType()) {
     case CrossfadeClass:
-        toCSSCrossfadeValue(this)->loadSubimages(cachedResourceLoader);
+        static_cast<CSSCrossfadeValue*>(this)->loadSubimages(cachedResourceLoader);
         break;
     case CanvasClass:
         static_cast<CSSCanvasValue*>(this)->loadSubimages(cachedResourceLoader);
         break;
 #if ENABLE(CSS_FILTERS)
     case FilterImageClass:
-        toCSSFilterImageValue(this)->loadSubimages(cachedResourceLoader);
+        static_cast<CSSFilterImageValue*>(this)->loadSubimages(cachedResourceLoader);
         break;
 #endif
     case LinearGradientClass:
@@ -237,12 +237,12 @@ void CSSImageGeneratorValue::loadSubimages(CachedResourceLoader* cachedResourceL
 bool CSSImageGeneratorValue::subimageIsPending(CSSValue* value)
 {
     if (value->isImageValue())
-        return toCSSImageValue(value)->cachedOrPendingImage()->isPendingImage();
+        return static_cast<CSSImageValue*>(value)->cachedOrPendingImage()->isPendingImage();
     
     if (value->isImageGeneratorValue())
-        return toCSSImageGeneratorValue(value)->isPending();
+        return static_cast<CSSImageGeneratorValue*>(value)->isPending();
 
-    if (value->isPrimitiveValue() && toCSSPrimitiveValue(value)->getValueID() == CSSValueNone)
+    if (value->isPrimitiveValue() && static_cast<CSSPrimitiveValue*>(value)->getValueID() == CSSValueNone)
         return false;
 
     ASSERT_NOT_REACHED();
@@ -256,7 +256,7 @@ CachedImage* CSSImageGeneratorValue::cachedImageForCSSValue(CSSValue* value, Cac
         return 0;
 
     if (value->isImageValue()) {
-        StyleCachedImage* styleCachedImage = toCSSImageValue(value)->cachedImage(cachedResourceLoader);
+        StyleCachedImage* styleCachedImage = static_cast<CSSImageValue*>(value)->cachedImage(cachedResourceLoader);
         if (!styleCachedImage)
             return 0;
 
@@ -264,13 +264,12 @@ CachedImage* CSSImageGeneratorValue::cachedImageForCSSValue(CSSValue* value, Cac
     }
     
     if (value->isImageGeneratorValue()) {
-        toCSSImageGeneratorValue(value)->loadSubimages(cachedResourceLoader);
+        static_cast<CSSImageGeneratorValue*>(value)->loadSubimages(cachedResourceLoader);
         // FIXME: Handle CSSImageGeneratorValue (and thus cross-fades with gradients and canvas).
         return 0;
     }
 
-    if (value->isPrimitiveValue() && toCSSPrimitiveValue
-        (value)->getValueID() == CSSValueNone)
+    if (value->isPrimitiveValue() && static_cast<CSSPrimitiveValue*>(value)->getValueID() == CSSValueNone)
         return 0;
 
     ASSERT_NOT_REACHED();
index 8ecf744..68e8a82 100644 (file)
@@ -92,8 +92,6 @@ private:
     HashMap<IntSize, OwnPtr<CachedGeneratedImage> > m_images;
 };
 
-CSS_VALUE_TYPE_CASTS(ImageGeneratorValue)
-
 } // namespace WebCore
 
 #endif // CSSImageGeneratorValue_h
index aed3ee1..cd8854f 100644 (file)
@@ -62,16 +62,17 @@ void CSSImageSetValue::fillImageSet()
     while (i < length) {
         CSSValue* imageValue = item(i);
         ASSERT_WITH_SECURITY_IMPLICATION(imageValue->isImageValue());
-        String imageURL = toCSSImageValue(imageValue)->url();
+        String imageURL = static_cast<CSSImageValue*>(imageValue)->url();
 
         ++i;
         ASSERT_WITH_SECURITY_IMPLICATION(i < length);
         CSSValue* scaleFactorValue = item(i);
         ASSERT_WITH_SECURITY_IMPLICATION(scaleFactorValue->isPrimitiveValue());
+        float scaleFactor = static_cast<CSSPrimitiveValue*>(scaleFactorValue)->getFloatValue();
 
         ImageWithScale image;
         image.imageURL = imageURL;
-        image.scaleFactor = toCSSPrimitiveValue(scaleFactorValue)->getFloatValue();
+        image.scaleFactor = scaleFactor;
         m_imagesInSet.append(image);
         ++i;
     }
index 02ff26c..b140f3a 100644 (file)
@@ -84,8 +84,6 @@ private:
     Vector<ImageWithScale> m_imagesInSet;
 };
 
-CSS_VALUE_TYPE_CASTS(ImageSetValue)
-
 } // namespace WebCore
 
 #endif // ENABLE(CSS_IMAGE_SET)
index 99b0c6c..91187d8 100644 (file)
@@ -68,8 +68,6 @@ private:
     AtomicString m_initiatorName;
 };
 
-CSS_VALUE_TYPE_CASTS(ImageValue)
-
 } // namespace WebCore
 
 #endif // CSSImageValue_h
index aaf6151..886aa0c 100644 (file)
@@ -44,8 +44,6 @@ private:
     }
 };
 
-CSS_VALUE_TYPE_CASTS(InheritedValue)
-
 } // namespace WebCore
 
 #endif // CSSInheritedValue_h
index 035ea55..6e69588 100644 (file)
@@ -53,8 +53,6 @@ private:
     bool m_isImplicit;
 };
 
-CSS_VALUE_TYPE_CASTS(InitialValue)
-
 } // namespace WebCore
 
 #endif // CSSInitialValue_h
index 13e88d8..a3c9298 100644 (file)
@@ -57,8 +57,6 @@ private:
     CSSLineBoxContainValue(LineBoxContain);
 };
 
-CSS_VALUE_TYPE_CASTS(LineBoxContainValue)
-
 } // namespace
 
 #endif
index d756144..d17931e 100644 (file)
@@ -1389,7 +1389,7 @@ bool CSSParser::parseColor(RGBA32& color, const String& string, bool strict)
     if (!value->isPrimitiveValue())
         return false;
 
-    CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
+    CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
     if (!primitiveValue->isRGBColor())
         return false;
 
@@ -1587,7 +1587,7 @@ void CSSParser::addProperty(CSSPropertyID propId, PassRefPtr<CSSValue> value, bo
     // This property doesn't belong to a shorthand or is a CSS variable (which will be resolved later).
     if (!m_currentShorthand
 #if ENABLE(CSS_VARIABLES)
-        || (value->isPrimitiveValue() && toCSSPrimitiveValue(value.get())->isVariableName())
+        || (value->isPrimitiveValue() && static_cast<CSSPrimitiveValue*>(value.get())->isVariableName())
 #endif
         ) {
         m_parsedProperties.append(CSSProperty(propId, value, important, false, CSSPropertyInvalid, m_implicitShorthand || implicit));
@@ -4118,8 +4118,8 @@ void CSSParser::parse3ValuesFillPosition(CSSParserValueList* valueList, RefPtr<C
         value1.swap(value2);
 
 #ifndef NDEBUG
-    CSSPrimitiveValue* first = toCSSPrimitiveValue(value1.get());
-    CSSPrimitiveValue* second = toCSSPrimitiveValue(value2.get());
+    CSSPrimitiveValue* first = static_cast<CSSPrimitiveValue*>(value1.get());
+    CSSPrimitiveValue* second = static_cast<CSSPrimitiveValue*>(value2.get());
     ident1 = first->getPairValue()->first()->getValueID();
     ident2 = second->getPairValue()->first()->getValueID();
     ASSERT(ident1 == CSSValueLeft || ident1 == CSSValueRight);
@@ -4179,8 +4179,8 @@ void CSSParser::parseFillPosition(CSSParserValueList* valueList, RefPtr<CSSValue
         return;
     }
 
-    RefPtr<CSSPrimitiveValue> parsedValue1 = toCSSPrimitiveValue(value1.get());
-    RefPtr<CSSPrimitiveValue> parsedValue2 = toCSSPrimitiveValue(value2.get());
+    RefPtr<CSSPrimitiveValue> parsedValue1 = static_cast<CSSPrimitiveValue*>(value1.get());
+    RefPtr<CSSPrimitiveValue> parsedValue2 = static_cast<CSSPrimitiveValue*>(value2.get());
 
     value1.clear();
     value2.clear();
@@ -4277,7 +4277,7 @@ void CSSParser::parseFillRepeat(RefPtr<CSSValue>& value1, RefPtr<CSSValue>& valu
 
     // If only one value was specified, value2 is the same as value1.
     m_implicitShorthand = true;
-    value2 = cssValuePool().createIdentifierValue(toCSSPrimitiveValue(value1.get())->getValueID());
+    value2 = cssValuePool().createIdentifierValue(static_cast<CSSPrimitiveValue*>(value1.get())->getValueID());
 }
 
 PassRefPtr<CSSValue> CSSParser::parseFillSize(CSSPropertyID propId, bool& allowComma)
@@ -7702,11 +7702,11 @@ bool CSSParser::parseDeprecatedRadialGradient(CSSParserValueList* valueList, Ref
     ASSERT(!centerX || centerX->isPrimitiveValue());
     ASSERT(!centerY || centerY->isPrimitiveValue());
 
-    result->setFirstX(toCSSPrimitiveValue(centerX.get()));
-    result->setSecondX(toCSSPrimitiveValue(centerX.get()));
+    result->setFirstX(static_cast<CSSPrimitiveValue*>(centerX.get()));
+    result->setSecondX(static_cast<CSSPrimitiveValue*>(centerX.get()));
     // CSS3 radial gradients always share the same start and end point.
-    result->setFirstY(toCSSPrimitiveValue(centerY.get()));
-    result->setSecondY(toCSSPrimitiveValue(centerY.get()));
+    result->setFirstY(static_cast<CSSPrimitiveValue*>(centerY.get()));
+    result->setSecondY(static_cast<CSSPrimitiveValue*>(centerY.get()));
 
     RefPtr<CSSPrimitiveValue> shapeValue;
     RefPtr<CSSPrimitiveValue> sizeValue;
@@ -7966,11 +7966,11 @@ bool CSSParser::parseRadialGradient(CSSParserValueList* valueList, RefPtr<CSSVal
         a = args->current();
         if (!a)
             return false;
-        result->setFirstX(toCSSPrimitiveValue(centerX.get()));
-        result->setFirstY(toCSSPrimitiveValue(centerY.get()));
+        result->setFirstX(static_cast<CSSPrimitiveValue*>(centerX.get()));
+        result->setFirstY(static_cast<CSSPrimitiveValue*>(centerY.get()));
         // Right now, CSS radial gradients have the same start and end centers.
-        result->setSecondX(toCSSPrimitiveValue(centerX.get()));
-        result->setSecondY(toCSSPrimitiveValue(centerY.get()));
+        result->setSecondX(static_cast<CSSPrimitiveValue*>(centerX.get()));
+        result->setSecondY(static_cast<CSSPrimitiveValue*>(centerY.get()));
     }
 
     if (shapeValue || sizeValue || horizontalSize || centerX || centerY)
index 636c64b..64206f8 100644 (file)
@@ -396,8 +396,6 @@ private:
     } m_value;
 };
 
-CSS_VALUE_TYPE_CASTS(PrimitiveValue)
-
 } // namespace WebCore
 
 #endif // CSSPrimitiveValue_h
index 0ef11ce..82a1af3 100644 (file)
@@ -70,8 +70,6 @@ private:
     RefPtr<CSSValue> m_mask;
 };
 
-CSS_VALUE_TYPE_CASTS(ReflectValue)
-
 } // namespace WebCore
 
 #endif // CSSReflectValue_h
index 26e3e98..72fb984 100644 (file)
@@ -71,7 +71,8 @@ void CSSToStyleMap::mapFillAttachment(CSSPropertyID, FillLayer* layer, CSSValue*
     if (!value->isPrimitiveValue())
         return;
 
-    switch (toCSSPrimitiveValue(value)->getValueID()) {
+    CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
+    switch (primitiveValue->getValueID()) {
     case CSSValueFixed:
         layer->setAttachment(FixedBackgroundAttachment);
         break;
@@ -96,7 +97,8 @@ void CSSToStyleMap::mapFillClip(CSSPropertyID, FillLayer* layer, CSSValue* value
     if (!value->isPrimitiveValue())
         return;
 
-    layer->setClip(*toCSSPrimitiveValue(value));
+    CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
+    layer->setClip(*primitiveValue);
 }
 
 void CSSToStyleMap::mapFillComposite(CSSPropertyID, FillLayer* layer, CSSValue* value)
@@ -109,7 +111,8 @@ void CSSToStyleMap::mapFillComposite(CSSPropertyID, FillLayer* layer, CSSValue*
     if (!value->isPrimitiveValue())
         return;
 
-    layer->setComposite(*toCSSPrimitiveValue(value));
+    CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
+    layer->setComposite(*primitiveValue);
 }
 
 void CSSToStyleMap::mapFillBlendMode(CSSPropertyID, FillLayer* layer, CSSValue* value)
@@ -122,7 +125,7 @@ void CSSToStyleMap::mapFillBlendMode(CSSPropertyID, FillLayer* layer, CSSValue*
     if (!value->isPrimitiveValue())
         return;
 
-    CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
+    CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
     layer->setBlendMode(*primitiveValue);
 }
 
@@ -136,7 +139,8 @@ void CSSToStyleMap::mapFillOrigin(CSSPropertyID, FillLayer* layer, CSSValue* val
     if (!value->isPrimitiveValue())
         return;
 
-    layer->setOrigin(*toCSSPrimitiveValue(value));
+    CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
+    layer->setOrigin(*primitiveValue);
 }
 
 
@@ -160,7 +164,8 @@ void CSSToStyleMap::mapFillRepeatX(CSSPropertyID, FillLayer* layer, CSSValue* va
     if (!value->isPrimitiveValue())
         return;
 
-    layer->setRepeatX(*toCSSPrimitiveValue(value));
+    CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
+    layer->setRepeatX(*primitiveValue);
 }
 
 void CSSToStyleMap::mapFillRepeatY(CSSPropertyID, FillLayer* layer, CSSValue* value)
@@ -173,7 +178,8 @@ void CSSToStyleMap::mapFillRepeatY(CSSPropertyID, FillLayer* layer, CSSValue* va
     if (!value->isPrimitiveValue())
         return;
 
-    layer->setRepeatY(*toCSSPrimitiveValue(value));
+    CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
+    layer->setRepeatY(*primitiveValue);
 }
 
 void CSSToStyleMap::mapFillSize(CSSPropertyID, FillLayer* layer, CSSValue* value)
@@ -183,7 +189,7 @@ void CSSToStyleMap::mapFillSize(CSSPropertyID, FillLayer* layer, CSSValue* value
         return;
     }
 
-    CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
+    CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
     if (primitiveValue->getValueID() == CSSValueContain)
         layer->setSizeType(Contain);
     else if (primitiveValue->getValueID() == CSSValueCover)
@@ -233,7 +239,7 @@ void CSSToStyleMap::mapFillXPosition(CSSPropertyID propertyID, FillLayer* layer,
 
     float zoomFactor = style()->effectiveZoom();
 
-    CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
+    CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
     Pair* pair = primitiveValue->getPairValue();
     if (pair) {
         ASSERT_UNUSED(propertyID, propertyID == CSSPropertyBackgroundPositionX || propertyID == CSSPropertyWebkitMaskPositionX);
@@ -269,7 +275,7 @@ void CSSToStyleMap::mapFillYPosition(CSSPropertyID propertyID, FillLayer* layer,
 
     float zoomFactor = style()->effectiveZoom();
 
-    CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
+    CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
     Pair* pair = primitiveValue->getPairValue();
     if (pair) {
         ASSERT_UNUSED(propertyID, propertyID == CSSPropertyBackgroundPositionY || propertyID == CSSPropertyWebkitMaskPositionY);
@@ -304,7 +310,8 @@ void CSSToStyleMap::mapFillMaskSourceType(CSSPropertyID, FillLayer* layer, CSSVa
     if (!value->isPrimitiveValue())
         return;
 
-    switch (toCSSPrimitiveValue(value)->getValueID()) {
+    CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
+    switch (primitiveValue->getValueID()) {
     case CSSValueAlpha:
         type = EMaskSourceType::MaskAlpha;
         break;
@@ -330,7 +337,8 @@ void CSSToStyleMap::mapAnimationDelay(Animation* animation, CSSValue* value)
     if (!value->isPrimitiveValue())
         return;
 
-    animation->setDelay(toCSSPrimitiveValue(value)->computeTime<double, CSSPrimitiveValue::Seconds>());
+    CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
+    animation->setDelay(primitiveValue->computeTime<double, CSSPrimitiveValue::Seconds>());
 }
 
 void CSSToStyleMap::mapAnimationDirection(Animation* layer, CSSValue* value)
@@ -343,7 +351,8 @@ void CSSToStyleMap::mapAnimationDirection(Animation* layer, CSSValue* value)
     if (!value->isPrimitiveValue())
         return;
 
-    switch (toCSSPrimitiveValue(value)->getValueID()) {
+    CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
+    switch (primitiveValue->getValueID()) {
     case CSSValueNormal:
         layer->setDirection(Animation::AnimationDirectionNormal);
         break;
@@ -371,7 +380,8 @@ void CSSToStyleMap::mapAnimationDuration(Animation* animation, CSSValue* value)
     if (!value->isPrimitiveValue())
         return;
 
-    animation->setDuration(toCSSPrimitiveValue(value)->computeTime<double, CSSPrimitiveValue::Seconds>());
+    CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
+    animation->setDuration(primitiveValue->computeTime<double, CSSPrimitiveValue::Seconds>());
 }
 
 void CSSToStyleMap::mapAnimationFillMode(Animation* layer, CSSValue* value)
@@ -384,7 +394,8 @@ void CSSToStyleMap::mapAnimationFillMode(Animation* layer, CSSValue* value)
     if (!value->isPrimitiveValue())
         return;
 
-    switch (toCSSPrimitiveValue(value)->getValueID()) {
+    CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
+    switch (primitiveValue->getValueID()) {
     case CSSValueNone:
         layer->setFillMode(AnimationFillModeNone);
         break;
@@ -412,7 +423,7 @@ void CSSToStyleMap::mapAnimationIterationCount(Animation* animation, CSSValue* v
     if (!value->isPrimitiveValue())
         return;
 
-    CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
+    CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
     if (primitiveValue->getValueID() == CSSValueInfinite)
         animation->setIterationCount(Animation::IterationCountInfinite);
     else
@@ -429,7 +440,7 @@ void CSSToStyleMap::mapAnimationName(Animation* layer, CSSValue* value)
     if (!value->isPrimitiveValue())
         return;
 
-    CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
+    CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
     if (primitiveValue->getValueID() == CSSValueNone)
         layer->setIsNoneAnimation(true);
     else
@@ -446,7 +457,8 @@ void CSSToStyleMap::mapAnimationPlayState(Animation* layer, CSSValue* value)
     if (!value->isPrimitiveValue())
         return;
 
-    EAnimPlayState playState = (toCSSPrimitiveValue(value)->getValueID() == CSSValuePaused) ? AnimPlayStatePaused : AnimPlayStatePlaying;
+    CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
+    EAnimPlayState playState = (primitiveValue->getValueID() == CSSValuePaused) ? AnimPlayStatePaused : AnimPlayStatePlaying;
     layer->setPlayState(playState);
 }
 
@@ -461,7 +473,7 @@ void CSSToStyleMap::mapAnimationProperty(Animation* animation, CSSValue* value)
     if (!value->isPrimitiveValue())
         return;
 
-    CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
+    CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
     if (primitiveValue->getValueID() == CSSValueAll) {
         animation->setAnimationMode(Animation::AnimateAll);
         animation->setProperty(CSSPropertyInvalid);
@@ -482,7 +494,8 @@ void CSSToStyleMap::mapAnimationTimingFunction(Animation* animation, CSSValue* v
     }
 
     if (value->isPrimitiveValue()) {
-        switch (toCSSPrimitiveValue(value)->getValueID()) {
+        CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
+        switch (primitiveValue->getValueID()) {
         case CSSValueLinear:
             animation->setTimingFunction(LinearTimingFunction::create());
             break;
@@ -588,7 +601,7 @@ void CSSToStyleMap::mapNinePieceImageSlice(CSSValue* value, NinePieceImage& imag
         return;
 
     // Retrieve the border image value.
-    CSSBorderImageSliceValue* borderImageSlice = toCSSBorderImageSliceValue(value);
+    CSSBorderImageSliceValue* borderImageSlice = static_cast<CSSBorderImageSliceValue*>(value);
 
     // Set up a length box to represent our image slices.
     LengthBox box;
@@ -624,7 +637,7 @@ LengthBox CSSToStyleMap::mapNinePieceImageQuad(CSSValue* value)
     float zoom = useSVGZoomRules() ? 1.0f : style()->effectiveZoom();
 
     // Retrieve the primitive value.
-    CSSPrimitiveValue* borderWidths = toCSSPrimitiveValue(value);
+    CSSPrimitiveValue* borderWidths = static_cast<CSSPrimitiveValue*>(value);
 
     // Set up a length box to represent our image slices.
     LengthBox box; // Defaults to 'auto' so we don't have to handle that explicitly below.
@@ -665,7 +678,8 @@ void CSSToStyleMap::mapNinePieceImageRepeat(CSSValue* value, NinePieceImage& ima
     if (!value || !value->isPrimitiveValue())
         return;
 
-    Pair* pair = toCSSPrimitiveValue(value)->getPairValue();
+    CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
+    Pair* pair = primitiveValue->getPairValue();
     if (!pair || !pair->first() || !pair->second())
         return;
 
index 8f5a9fc..b428f91 100644 (file)
@@ -383,16 +383,16 @@ void CSSValue::destroy()
 
     switch (classType()) {
     case AspectRatioClass:
-        delete toCSSAspectRatioValue(this);
+        delete static_cast<CSSAspectRatioValue*>(this);
         return;
     case BorderImageSliceClass:
-        delete toCSSBorderImageSliceValue(this);
+        delete static_cast<CSSBorderImageSliceValue*>(this);
         return;
     case CanvasClass:
         delete static_cast<CSSCanvasValue*>(this);
         return;
     case CursorImageClass:
-        delete toCSSCursorImageValue(this);
+        delete static_cast<CSSCursorImageValue*>(this);
         return;
     case FontClass:
         delete static_cast<FontValue*>(this);
@@ -413,19 +413,19 @@ void CSSValue::destroy()
         delete static_cast<CSSRadialGradientValue*>(this);
         return;
     case CrossfadeClass:
-        delete toCSSCrossfadeValue(this);
+        delete static_cast<CSSCrossfadeValue*>(this);
         return;
     case ImageClass:
-        delete toCSSImageValue(this);
+        delete static_cast<CSSImageValue*>(this);
         return;
     case InheritedClass:
-        delete toCSSInheritedValue(this);
+        delete static_cast<CSSInheritedValue*>(this);
         return;
     case InitialClass:
-        delete toCSSInitialValue(this);
+        delete static_cast<CSSInitialValue*>(this);
         return;
     case PrimitiveClass:
-        delete toCSSPrimitiveValue(this);
+        delete static_cast<CSSPrimitiveValue*>(this);
         return;
     case ReflectClass:
         delete static_cast<CSSReflectValue*>(this);
@@ -449,19 +449,19 @@ void CSSValue::destroy()
         delete static_cast<WebKitCSSTransformValue*>(this);
         return;
     case LineBoxContainClass:
-        delete toCSSLineBoxContainValue(this);
+        delete static_cast<CSSLineBoxContainValue*>(this);
         return;
     case CalculationClass:
-        delete toCSSCalcValue(this);
+        delete static_cast<CSSCalcValue*>(this);
         return;
 #if ENABLE(CSS_IMAGE_SET)
     case ImageSetClass:
-        delete toCSSImageSetValue(this);
+        delete static_cast<CSSImageSetValue*>(this);
         return;
 #endif
 #if ENABLE(CSS_FILTERS)
     case FilterImageClass:
-        delete toCSSFilterImageValue(this);
+        delete static_cast<CSSFilterImageValue*>(this);
         return;
     case WebKitCSSFilterClass:
         delete static_cast<WebKitCSSFilterValue*>(this);
@@ -477,7 +477,7 @@ void CSSValue::destroy()
         delete static_cast<WebKitCSSMixFunctionValue*>(this);
         return;
     case WebKitCSSShaderClass:
-        delete toWebKitCSSShaderValue(this);
+        delete static_cast<WebKitCSSShaderValue*>(this);
         return;
 #endif
 #endif
index 0d988a3..81a2e0f 100644 (file)
@@ -89,8 +89,8 @@ public:
     bool isCubicBezierTimingFunctionValue() const { return m_classType == CubicBezierTimingFunctionClass; }
     bool isStepsTimingFunctionValue() const { return m_classType == StepsTimingFunctionClass; }
     bool isWebKitCSSTransformValue() const { return m_classType == WebKitCSSTransformClass; }
-    bool isLineBoxContainValue() const { return m_classType == LineBoxContainClass; }
-    bool isCalcValue() const {return m_classType == CalculationClass; }
+    bool isCSSLineBoxContainValue() const { return m_classType == LineBoxContainClass; }
+    bool isCalculationValue() const {return m_classType == CalculationClass; }
 #if ENABLE(CSS_FILTERS)
     bool isFilterImageValue() const { return m_classType == FilterImageClass; }
     bool isWebKitCSSFilterValue() const { return m_classType == WebKitCSSFilterClass; }
@@ -264,20 +264,6 @@ inline bool compareCSSValuePtr(const RefPtr<CSSValueType>& first, const RefPtr<C
     return first ? second && first->equals(*second) : !second;
 }
 
-#define CSS_VALUE_TYPE_CASTS(ValueTypeName) \
-inline const CSS##ValueTypeName* toCSS##ValueTypeName(const CSSValue* value) \
-{ \
-    ASSERT_WITH_SECURITY_IMPLICATION(!value || value->is##ValueTypeName()); \
-    return static_cast<const CSS##ValueTypeName*>(value); \
-} \
-inline CSS##ValueTypeName* toCSS##ValueTypeName(CSSValue* value) \
-{ \
-    ASSERT_WITH_SECURITY_IMPLICATION(!value || value->is##ValueTypeName()); \
-    return static_cast<CSS##ValueTypeName*>(value); \
-} \
-void toCSS##ValueTypeName(const CSS##ValueTypeName*); \
-void toCSS##ValueTypeName(const CSS##ValueTypeName&);
-
 } // namespace WebCore
 
 #endif // CSSValue_h
index 7e627a3..9ee1afa 100644 (file)
@@ -96,8 +96,6 @@ private:
     CSSValueList* m_list;
 };
 
-CSS_VALUE_TYPE_CASTS(ValueList)
-
 // Wrapper that can be used to iterate over any CSSValue. Non-list values and 0 behave as zero-length lists.
 // Objects of this class are intended to be stack-allocated and scoped to a single function.
 // Please take care not to pass these around as they do hold onto a raw pointer.
@@ -113,7 +111,6 @@ private:
     CSSValueListInspector m_inspector;
     size_t m_position;
 };
-
 } // namespace WebCore
 
 #endif // CSSValueList_h
index e94103a..c83c6ab 100644 (file)
@@ -61,8 +61,6 @@ private:
     const String m_value;
 };
 
-CSS_VALUE_TYPE_CASTS(VariableValue)
-
 }
 
 #endif /* ENABLE(CSS_VARIABLES) */
index 4a2927e..ff58520 100644 (file)
@@ -150,7 +150,7 @@ public:
     static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
     {
         if (value->isPrimitiveValue())
-            setValue(styleResolver->style(), *toCSSPrimitiveValue(value));
+            setValue(styleResolver->style(), *static_cast<CSSPrimitiveValue*>(value));
     }
     static PropertyHandler createHandler()
     {
@@ -168,7 +168,7 @@ public:
         if (!value->isPrimitiveValue())
             return;
 
-        CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
+        CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
         if (primitiveValue->getValueID() == idMapsToMinusOne)
             setValue(styleResolver->style(), -1);
         else
@@ -216,7 +216,7 @@ public:
         if (!value->isPrimitiveValue())
             return;
 
-        CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
+        CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
         if (primitiveValue->getValueID() == autoIdentity)
             setAuto(styleResolver->style());
         else if (valueType == Number)
@@ -255,7 +255,7 @@ public:
         if (!value->isPrimitiveValue())
             return;
 
-        CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
+        CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
 
         if (Rect* rect = primitiveValue->getRectValue()) {
             Length top = convertToLength(styleResolver, rect->top());
@@ -301,7 +301,7 @@ public:
         if (!value->isPrimitiveValue())
             return;
 
-        CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
+        CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
         if (inheritColorFromParent && primitiveValue->getValueID() == CSSValueCurrentcolor)
             applyInheritValue(propertyID, styleResolver);
         else {
@@ -362,7 +362,7 @@ public:
         if (!value->isPrimitiveValue())
             return;
 
-        CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
+        CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
         if (noneEnabled && primitiveValue->getValueID() == CSSValueNone) {
             if (noneUndefined)
                 setValue(styleResolver->style(), Length(Undefined));
@@ -416,7 +416,7 @@ public:
     {
         if (!value->isPrimitiveValue())
             return;
-        CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
+        CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
         if ((identBehavior == MapNoneToNull && primitiveValue->getValueID() == CSSValueNone)
             || (identBehavior == MapAutoToNull && primitiveValue->getValueID() == CSSValueAuto))
             setValue(styleResolver->style(), nullAtom);
@@ -439,7 +439,8 @@ public:
         if (!value->isPrimitiveValue())
             return;
 
-        Pair* pair = toCSSPrimitiveValue(value)->getPairValue();
+        CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
+        Pair* pair = primitiveValue->getPairValue();
         if (!pair || !pair->first() || !pair->second())
             return;
 
@@ -601,7 +602,7 @@ public:
         if (!value->isPrimitiveValue())
             return;
 
-        CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
+        CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
 
         CSSValueID ident = primitiveValue->getValueID();
         T length;
@@ -671,8 +672,9 @@ public:
     {
         if (!value->isPrimitiveValue())
             return;
+        CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
         FontDescription fontDescription = styleResolver->fontDescription();
-        (fontDescription.*setterFunction)(*toCSSPrimitiveValue(value));
+        (fontDescription.*setterFunction)(*primitiveValue);
         styleResolver->setFontDescription(fontDescription);
     }
 
@@ -724,7 +726,7 @@ public:
             CSSValue* item = i.value();
             if (!item->isPrimitiveValue())
                 continue;
-            CSSPrimitiveValue* contentValue = toCSSPrimitiveValue(item);
+            CSSPrimitiveValue* contentValue = static_cast<CSSPrimitiveValue*>(item);
             AtomicString face;
             if (contentValue->isString())
                 face = contentValue->getStringValue();
@@ -834,7 +836,7 @@ public:
         if (!value->isPrimitiveValue())
             return;
 
-        CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
+        CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
 
         FontDescription fontDescription = styleResolver->style()->fontDescription();
         fontDescription.setKeywordSize(0);
@@ -847,7 +849,7 @@ public:
             parentIsAbsoluteSize = styleResolver->parentStyle()->fontDescription().isAbsoluteSize();
         }
 
-        if (CSSValueID ident = toCSSPrimitiveValue(value)->getValueID()) {
+        if (CSSValueID ident = primitiveValue->getValueID()) {
             // Keywords are being used.
             switch (ident) {
             case CSSValueXxSmall:
@@ -908,7 +910,7 @@ public:
     {
         if (!value->isPrimitiveValue())
             return;
-        CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
+        CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
         FontDescription fontDescription = styleResolver->fontDescription();
         switch (primitiveValue->getValueID()) {
         case CSSValueInvalid:
@@ -969,7 +971,8 @@ public:
                 CSSValue* item = valueList->itemWithoutBoundsCheck(i);
                 ASSERT(item->isPrimitiveValue());
                 if (item->isPrimitiveValue()) {
-                    switch (toCSSPrimitiveValue(item)->getValueID()) {
+                    CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(item);
+                    switch (primitiveValue->getValueID()) {
                     case CSSValueNoCommonLigatures:
                         commonLigaturesState = FontDescription::DisabledLigaturesState;
                         break;
@@ -998,7 +1001,7 @@ public:
 #if !ASSERT_DISABLED
         else {
             ASSERT_WITH_SECURITY_IMPLICATION(value->isPrimitiveValue());
-            ASSERT(toCSSPrimitiveValue(value)->getValueID() == CSSValueNormal);
+            ASSERT(static_cast<CSSPrimitiveValue*>(value)->getValueID() == CSSValueNormal);
         }
 #endif
 
@@ -1146,7 +1149,7 @@ public:
     }
     static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
     {
-        bool setCounterIncrementToNone = counterBehavior == Increment && value->isPrimitiveValue() && toCSSPrimitiveValue(value)->getValueID() == CSSValueNone;
+        bool setCounterIncrementToNone = counterBehavior == Increment && value->isPrimitiveValue() && static_cast<CSSPrimitiveValue*>(value)->getValueID() == CSSValueNone;
 
         if (!value->isValueList() && !setCounterIncrementToNone)
             return;
@@ -1171,7 +1174,7 @@ public:
             if (!currValue->isPrimitiveValue())
                 continue;
 
-            Pair* pair = toCSSPrimitiveValue(currValue)->getPairValue();
+            Pair* pair = static_cast<CSSPrimitiveValue*>(currValue)->getPairValue();
             if (!pair || !pair->first() || !pair->second())
                 continue;
 
@@ -1213,18 +1216,18 @@ public:
             for (int i = 0; i < len; i++) {
                 CSSValue* item = list->itemWithoutBoundsCheck(i);
                 if (item->isCursorImageValue()) {
-                    CSSCursorImageValue* image = toCSSCursorImageValue(item);
+                    CSSCursorImageValue* image = static_cast<CSSCursorImageValue*>(item);
                     if (image->updateIfSVGCursorIsUsed(styleResolver->element())) // Elements with SVG cursors are not allowed to share style.
                         styleResolver->style()->setUnique();
                     styleResolver->style()->addCursor(styleResolver->styleImage(CSSPropertyCursor, image), image->hotSpot());
                 } else if (item->isPrimitiveValue()) {
-                    CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(item);
+                    CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(item);
                     if (primitiveValue->isValueID())
                         styleResolver->style()->setCursor(*primitiveValue);
                 }
             }
         } else if (value->isPrimitiveValue()) {
-            CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
+            CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
             if (primitiveValue->isValueID() && styleResolver->style()->cursor() != ECursor(*primitiveValue))
                 styleResolver->style()->setCursor(*primitiveValue);
         }
@@ -1240,7 +1243,7 @@ public:
         if (!value->isPrimitiveValue())
             return;
 
-        CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
+        CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
         ASSERT(primitiveValue->isValueID());
 
         if (primitiveValue->getValueID() != CSSValueWebkitMatchParent)
@@ -1267,7 +1270,7 @@ public:
         for (CSSValueListIterator i(value); i.hasMore(); i.advance()) {
             CSSValue* item = i.value();
             ASSERT_WITH_SECURITY_IMPLICATION(item->isPrimitiveValue());
-            t |= *toCSSPrimitiveValue(item);
+            t |= *static_cast<CSSPrimitiveValue*>(item);
         }
         styleResolver->style()->setTextDecoration(t);
     }
@@ -1285,7 +1288,7 @@ public:
         if (!value->isPrimitiveValue())
             return;
 
-        CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
+        CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
         if (primitiveValue->getValueID()) {
             switch (primitiveValue->getValueID()) {
             case CSSValueSmall:
@@ -1320,7 +1323,7 @@ public:
         if (!value->isPrimitiveValue())
             return;
 
-        CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
+        CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
         if (primitiveValue->getValueID() == CSSValueInfinite)
             styleResolver->style()->setMarqueeLoopCount(-1); // -1 means repeat forever.
         else if (primitiveValue->isNumber())
@@ -1340,7 +1343,7 @@ public:
         if (!value->isPrimitiveValue())
             return;
 
-        CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
+        CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
         if (CSSValueID ident = primitiveValue->getValueID()) {
             switch (ident) {
             case CSSValueSlow:
@@ -1374,7 +1377,7 @@ public:
     {
         // This is true if value is 'auto' or 'alphabetic'.
         if (value->isPrimitiveValue()) {
-            TextUnderlinePosition t = *toCSSPrimitiveValue(value);
+            TextUnderlinePosition t = *static_cast<CSSPrimitiveValue*>(value);
             styleResolver->style()->setTextUnderlinePosition(t);
             return;
         }
@@ -1403,7 +1406,7 @@ public:
         if (!value->isPrimitiveValue())
             return;
 
-        CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
+        CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
         Length lineHeight;
 
         if (primitiveValue->getValueID() == CSSValueNormal)
@@ -1441,7 +1444,7 @@ public:
         if (!value->isPrimitiveValue())
             return;
 
-        CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
+        CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
         Length lineHeight;
 
         if (primitiveValue->getIdent() == CSSValueNormal)
@@ -1583,8 +1586,8 @@ public:
             // <length>{2} | <page-size> <orientation>
             if (!inspector.first()->isPrimitiveValue() || !inspector.second()->isPrimitiveValue())
                 return;
-            CSSPrimitiveValue* first = toCSSPrimitiveValue(inspector.first());
-            CSSPrimitiveValue* second = toCSSPrimitiveValue(inspector.second());
+            CSSPrimitiveValue* first = static_cast<CSSPrimitiveValue*>(inspector.first());
+            CSSPrimitiveValue* second = static_cast<CSSPrimitiveValue*>(inspector.second());
             if (first->isLength()) {
                 // <length>{2}
                 if (!second->isLength())
@@ -1604,7 +1607,7 @@ public:
             // <length> | auto | <page-size> | [ portrait | landscape]
             if (!inspector.first()->isPrimitiveValue())
                 return;
-            CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(inspector.first());
+            CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(inspector.first());
             if (primitiveValue->isLength()) {
                 // <length>
                 pageSizeType = PAGE_SIZE_RESOLVED;
@@ -1668,7 +1671,7 @@ public:
                 if (!item->isPrimitiveValue())
                     continue;
 
-                CSSPrimitiveValue* value = toCSSPrimitiveValue(item);
+                CSSPrimitiveValue* value = static_cast<CSSPrimitiveValue*>(item);
                 if (value->getValueID() == CSSValueFilled || value->getValueID() == CSSValueOpen)
                     styleResolver->style()->setTextEmphasisFill(*value);
                 else
@@ -1680,7 +1683,7 @@ public:
 
         if (!value->isPrimitiveValue())
             return;
-        CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
+        CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
 
         if (primitiveValue->isString()) {
             styleResolver->style()->setTextEmphasisFill(TextEmphasisFillFilled);
@@ -1809,7 +1812,7 @@ public:
         if (!value->isPrimitiveValue())
             return;
 
-        CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
+        CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
 
         EResize r = RESIZE_NONE;
         switch (primitiveValue->getValueID()) {
@@ -1839,7 +1842,7 @@ public:
         if (!value->isPrimitiveValue())
             return;
 
-        CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
+        CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
 
         if (primitiveValue->getValueID())
             return styleResolver->style()->setVerticalAlign(*primitiveValue);
@@ -1878,7 +1881,7 @@ public:
             styleResolver->style()->setHasAspectRatio(false);
             return;
         }
-        CSSAspectRatioValue* aspectRatioValue = toCSSAspectRatioValue(value);
+        CSSAspectRatioValue* aspectRatioValue = static_cast<CSSAspectRatioValue*>(value);
         styleResolver->style()->setHasAspectRatio(true);
         styleResolver->style()->setAspectRatioDenominator(aspectRatioValue->denominatorValue());
         styleResolver->style()->setAspectRatioNumerator(aspectRatioValue->numeratorValue());
@@ -1914,7 +1917,7 @@ public:
     static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
     {
         ASSERT_WITH_SECURITY_IMPLICATION(value->isPrimitiveValue());
-        CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
+        CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
 
         if (primitiveValue->getValueID() == CSSValueNormal) {
             resetEffectiveZoom(styleResolver);
@@ -1975,7 +1978,7 @@ public:
         if (!value->isPrimitiveValue())
             return;
 
-        EDisplay display = *toCSSPrimitiveValue(value);
+        EDisplay display = *static_cast<CSSPrimitiveValue*>(value);
 
         if (!isValidDisplayValue(styleResolver, display))
             return;
@@ -1996,7 +1999,7 @@ public:
     static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
     {
         if (value->isPrimitiveValue()) {
-            CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
+            CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
             if (primitiveValue->getValueID() == CSSValueNone)
                 setValue(styleResolver->style(), 0);
             else if (primitiveValue->isShape()) {
@@ -2027,7 +2030,7 @@ public:
     static void applyValue(CSSPropertyID property, StyleResolver* styleResolver, CSSValue* value)
     {
         if (value->isPrimitiveValue()) {
-            CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
+            CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
             if (primitiveValue->getValueID() == CSSValueAuto)
                 setValue(styleResolver->style(), 0);
             // FIXME Bug 102571: Layout for the value 'outside-shape' is not yet implemented
@@ -2080,7 +2083,7 @@ public:
             CSSValue* item = valueList->itemWithoutBoundsCheck(i);
             if (!item->isPrimitiveValue())
                 continue;
-            CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(item);
+            CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(item);
             if (primitiveValue->getValueID() == CSSValueFromImage)
                 source = ImageResolutionFromImage;
             else if (primitiveValue->getValueID() == CSSValueSnap)
@@ -2136,7 +2139,7 @@ public:
             if (!item->isPrimitiveValue())
                 continue;
 
-            CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(item);
+            CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(item);
             if (!primitiveValue->getValueID())
                 lengthOrPercentageValue = primitiveValue->convertToLength<FixedIntegerConversion | PercentConversion | CalculatedConversion | ViewportPercentageConversion>(styleResolver->style(), styleResolver->rootElementStyle(), styleResolver->style()->effectiveZoom());
 #if ENABLE(CSS3_TEXT)
index 637f500..dd3c35c 100644 (file)
@@ -51,12 +51,6 @@ private:
     const int m_value;
 };
 
-inline FontFeatureValue* toFontFeatureValue(CSSValue* value)
-{
-    ASSERT_WITH_SECURITY_IMPLICATION(!value || value->isFontFeatureValue());
-    return static_cast<FontFeatureValue*>(value);
-}
-
 } // namespace
 
 #endif
index f921969..7c75339 100644 (file)
@@ -55,12 +55,6 @@ private:
     }
 };
 
-inline FontValue* toFontValue(CSSValue* value)
-{
-    ASSERT_WITH_SECURITY_IMPLICATION(!value || value->isFontValue());
-    return static_cast<FontValue*>(value);
-}
-
 } // namespace
 
 #endif
index 9e4e012..e775099 100644 (file)
@@ -334,7 +334,7 @@ void reportMediaQueryWarningIfNeeded(Document* document, const MediaQuerySet* me
                 if (exp->mediaFeature() == MediaFeatureNames::resolutionMediaFeature || exp->mediaFeature() == MediaFeatureNames::max_resolutionMediaFeature || exp->mediaFeature() == MediaFeatureNames::min_resolutionMediaFeature) {
                     CSSValue* cssValue =  exp->value();
                     if (cssValue && cssValue->isPrimitiveValue()) {
-                        CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(cssValue);
+                        CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(cssValue);
                         if (primitiveValue->isDotsPerInch() || primitiveValue->isDotsPerCentimeter())
                             addResolutionWarningMessageToConsole(document, mediaQuerySet->mediaText(), primitiveValue);
                     }
index 0c308b1..7c766c4 100644 (file)
@@ -182,7 +182,7 @@ bool compareValue(T a, T b, MediaFeaturePrefix op)
 static bool compareAspectRatioValue(CSSValue* value, int width, int height, MediaFeaturePrefix op)
 {
     if (value->isAspectRatioValue()) {
-        CSSAspectRatioValue* aspectRatio = toCSSAspectRatioValue(value);
+        CSSAspectRatioValue* aspectRatio = static_cast<CSSAspectRatioValue*>(value);
         return compareValue(width * static_cast<int>(aspectRatio->denominatorValue()), height * static_cast<int>(aspectRatio->numeratorValue()), op);
     }
 
@@ -192,8 +192,8 @@ static bool compareAspectRatioValue(CSSValue* value, int width, int height, Medi
 static bool numberValue(CSSValue* value, float& result)
 {
     if (value->isPrimitiveValue()
-        && toCSSPrimitiveValue(value)->isNumber()) {
-        result = toCSSPrimitiveValue(value)->getFloatValue(CSSPrimitiveValue::CSS_NUMBER);
+        && static_cast<CSSPrimitiveValue*>(value)->isNumber()) {
+        result = static_cast<CSSPrimitiveValue*>(value)->getFloatValue(CSSPrimitiveValue::CSS_NUMBER);
         return true;
     }
     return false;
@@ -242,7 +242,7 @@ static bool orientationMediaFeatureEval(CSSValue* value, RenderStyle*, Frame* fr
     int width = view->layoutWidth();
     int height = view->layoutHeight();
     if (value && value->isPrimitiveValue()) {
-        const CSSValueID id = toCSSPrimitiveValue(value)->getValueID();
+        const CSSValueID id = static_cast<CSSPrimitiveValue*>(value)->getValueID();
         if (width > height) // Square viewport is portrait.
             return CSSValueLandscape == id;
         return CSSValuePortrait == id;
@@ -306,19 +306,19 @@ static bool evalResolution(CSSValue* value, Frame* frame, MediaFeaturePrefix op)
     if (!value->isPrimitiveValue())
         return false;
 
-    CSSPrimitiveValue* resolution = toCSSPrimitiveValue(value);
+    CSSPrimitiveValue* resolution = static_cast<CSSPrimitiveValue*>(value);
     return compareValue(deviceScaleFactor, resolution->isNumber() ? resolution->getFloatValue() : resolution->getFloatValue(CSSPrimitiveValue::CSS_DPPX), op);
 }
 
 static bool device_pixel_ratioMediaFeatureEval(CSSValue *value, RenderStyle*, Frame* frame, MediaFeaturePrefix op)
 {
-    return (!value || toCSSPrimitiveValue(value)->isNumber()) && evalResolution(value, frame, op);
+    return (!value || static_cast<CSSPrimitiveValue*>(value)->isNumber()) && evalResolution(value, frame, op);
 }
 
 static bool resolutionMediaFeatureEval(CSSValue* value, RenderStyle*, Frame* frame, MediaFeaturePrefix op)
 {
 #if ENABLE(RESOLUTION_MEDIA_QUERY)
-    return (!value || toCSSPrimitiveValue(value)->isResolution()) && evalResolution(value, frame, op);
+    return (!value || static_cast<CSSPrimitiveValue*>(value)->isResolution()) && evalResolution(value, frame, op);
 #else
     UNUSED_PARAM(value);
     UNUSED_PARAM(frame);
@@ -342,7 +342,7 @@ static bool computeLength(CSSValue* value, bool strict, RenderStyle* style, Rend
     if (!value->isPrimitiveValue())
         return false;
 
-    CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
+    CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
 
     if (primitiveValue->isNumber()) {
         result = primitiveValue->getIntValue();
@@ -596,7 +596,7 @@ static bool view_modeMediaFeatureEval(CSSValue* value, RenderStyle*, Frame* fram
     if (!value)
         return true;
 
-    const int viewModeCSSKeywordID = toCSSPrimitiveValue(value)->getValueID();
+    const int viewModeCSSKeywordID = static_cast<CSSPrimitiveValue*>(value)->getValueID();
     const Page::ViewMode viewMode = frame->page()->viewMode();
     bool result = false;
     switch (viewMode) {
@@ -678,7 +678,7 @@ static bool pointerMediaFeatureEval(CSSValue* value, RenderStyle*, Frame* frame,
     if (!value->isPrimitiveValue())
         return false;
 
-    const CSSValueID id = toCSSPrimitiveValue(value)->getValueID();
+    const CSSValueID id = static_cast<CSSPrimitiveValue*>(value)->getValueID();
     return (pointer == NoPointer && id == CSSValueNone)
         || (pointer == TouchPointer && id == CSSValueCoarse)
         || (pointer == MousePointer && id == CSSValueFine);
index 9a9c2b2..bd340c8 100644 (file)
@@ -107,7 +107,7 @@ void StyleResolver::applySVGProperty(CSSPropertyID id, CSSValue* value)
     ASSERT(value);
     CSSPrimitiveValue* primitiveValue = 0;
     if (value->isPrimitiveValue())
-        primitiveValue = toCSSPrimitiveValue(value);
+        primitiveValue = static_cast<CSSPrimitiveValue*>(value);
 
     const State& state = m_state;
     SVGRenderStyle* svgstyle = state.style()->accessSVGStyle();
@@ -285,7 +285,7 @@ void StyleResolver::applySVGProperty(CSSPropertyID id, CSSValue* value)
                 if (!currValue->isPrimitiveValue())
                     continue;
 
-                CSSPrimitiveValue* dash = toCSSPrimitiveValue(dashes->itemWithoutBoundsCheck(i));
+                CSSPrimitiveValue* dash = static_cast<CSSPrimitiveValue*>(dashes->itemWithoutBoundsCheck(i));
                 array.append(SVGLength::fromCSSPrimitiveValue(dash));
             }
 
index 7b70a13..d4d59f0 100644 (file)
@@ -62,12 +62,6 @@ private:
         PassRefPtr<CSSPrimitiveValue> color);
 };
 
-inline ShadowValue* toShadowValue(CSSValue* value)
-{
-    ASSERT_WITH_SECURITY_IMPLICATION(!value || value->isShadowValue());
-    return static_cast<ShadowValue*>(value);
-}
-
 } // namespace
 
 #endif
index bcf09b7..5f71032 100644 (file)
@@ -416,8 +416,8 @@ String StylePropertySet::getLayeredShorthandValue(const StylePropertyShorthand&
                     else
                         yValue = nextValue;
 
-                    CSSValueID xId = toCSSPrimitiveValue(value.get())->getValueID();
-                    CSSValueID yId = toCSSPrimitiveValue(yValue.get())->getValueID();
+                    CSSValueID xId = static_cast<CSSPrimitiveValue*>(value.get())->getValueID();
+                    CSSValueID yId = static_cast<CSSPrimitiveValue*>(yValue.get())->getValueID();
                     if (xId != yId) {
                         if (xId == CSSValueRepeat && yId == CSSValueNoRepeat) {
                             useRepeatXShorthand = true;
index f9e01c1..30ef1c6 100644 (file)
@@ -1925,7 +1925,7 @@ static bool createGridTrackSize(CSSValue* value, GridTrackSize& trackSize, const
     if (!value->isPrimitiveValue())
         return false;
 
-    CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
+    CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
     Pair* minMaxTrackBreadth = primitiveValue->getPairValue();
     if (!minMaxTrackBreadth) {
         Length workingLength;
@@ -1949,7 +1949,7 @@ static bool createGridTrackList(CSSValue* value, Vector<GridTrackSize>& trackSiz
 {
     // Handle 'none'.
     if (value->isPrimitiveValue()) {
-        CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
+        CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
         return primitiveValue->getValueID() == CSSValueNone;
     }
 
@@ -1960,7 +1960,7 @@ static bool createGridTrackList(CSSValue* value, Vector<GridTrackSize>& trackSiz
     for (CSSValueListIterator i = value; i.hasMore(); i.advance()) {
         CSSValue* currValue = i.value();
         if (currValue->isPrimitiveValue()) {
-            CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(currValue);
+            CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(currValue);
             if (primitiveValue->isString()) {
                 NamedGridLinesMap::AddResult result = namedGridLines.add(primitiveValue->getStringValue(), Vector<size_t>());
                 result.iterator->value.append(currentNamedGridLine);
@@ -1988,7 +1988,8 @@ static bool createGridPosition(CSSValue* value, GridPosition& position)
     // For now, we only accept: 'auto' | [ <integer> || <string> ] | span && <integer>?
     if (value->isPrimitiveValue()) {
 #if !ASSERT_DISABLED
-        ASSERT(toCSSPrimitiveValue(value)->getValueID() == CSSValueAuto);
+        CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
+        ASSERT(primitiveValue->getValueID() == CSSValueAuto);
 #endif
         return true;
     }
@@ -2003,17 +2004,17 @@ static bool createGridPosition(CSSValue* value, GridPosition& position)
     String gridLineName;
 
     CSSValueListIterator it = values;
-    CSSPrimitiveValue* currentValue = toCSSPrimitiveValue(it.value());
+    CSSPrimitiveValue* currentValue = static_cast<CSSPrimitiveValue*>(it.value());
     if (currentValue->getValueID() == CSSValueSpan) {
         isSpanPosition = true;
         it.advance();
-        currentValue = it.hasMore() ? toCSSPrimitiveValue(it.value()) : 0;
+        currentValue = it.hasMore() ? static_cast<CSSPrimitiveValue*>(it.value()) : 0;
     }
 
     if (currentValue && currentValue->isNumber()) {
         gridLineNumber = currentValue->getIntValue();
         it.advance();
-        currentValue = it.hasMore() ? toCSSPrimitiveValue(it.value()) : 0;
+        currentValue = it.hasMore() ? static_cast<CSSPrimitiveValue*>(it.value()) : 0;
     }
 
     if (currentValue && currentValue->isString()) {
@@ -2033,11 +2034,13 @@ static bool createGridPosition(CSSValue* value, GridPosition& position)
 #if ENABLE(CSS_VARIABLES)
 static bool hasVariableReference(CSSValue* value)
 {
-    if (value->isPrimitiveValue())
-        return toCSSPrimitiveValue(value)->hasVariableReference();
+    if (value->isPrimitiveValue()) {
+        CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
+        return primitiveValue->hasVariableReference();
+    }
 
-    if (value->isCalcValue())
-        return toCSSCalcValue(value)->hasVariableReference();
+    if (value->isCalculationValue())
+        return static_cast<CSSCalcValue*>(value)->hasVariableReference();
 
     if (value->isReflectValue()) {
         CSSReflectValue* reflectValue = static_cast<CSSReflectValue*>(value);
@@ -2130,7 +2133,7 @@ void StyleResolver::applyProperty(CSSPropertyID id, CSSValue* value)
         return;
     }
 
-    CSSPrimitiveValue* primitiveValue = value->isPrimitiveValue() ? toCSSPrimitiveValue(value) : 0;
+    CSSPrimitiveValue* primitiveValue = value->isPrimitiveValue() ? static_cast<CSSPrimitiveValue*>(value) : 0;
 
     float zoomFactor = state.style()->effectiveZoom();
 
@@ -2157,19 +2160,19 @@ void StyleResolver::applyProperty(CSSPropertyID id, CSSValue* value)
                 CSSValue* item = i.value();
                 if (item->isImageGeneratorValue()) {
                     if (item->isGradientValue())
-                        state.style()->setContent(StyleGeneratedImage::create(toCSSGradientValue(item)->gradientWithStylesResolved(this).get()), didSet);
+                        state.style()->setContent(StyleGeneratedImage::create(static_cast<CSSGradientValue*>(item)->gradientWithStylesResolved(this).get()), didSet);
                     else
-                        state.style()->setContent(StyleGeneratedImage::create(toCSSImageGeneratorValue(item)), didSet);
+                        state.style()->setContent(StyleGeneratedImage::create(static_cast<CSSImageGeneratorValue*>(item)), didSet);
                     didSet = true;
 #if ENABLE(CSS_IMAGE_SET)
                 } else if (item->isImageSetValue()) {
-                    state.style()->setContent(setOrPendingFromValue(CSSPropertyContent, toCSSImageSetValue(item)), didSet);
+                    state.style()->setContent(setOrPendingFromValue(CSSPropertyContent, static_cast<CSSImageSetValue*>(item)), didSet);
                     didSet = true;
 #endif
                 }
 
                 if (item->isImageValue()) {
-                    state.style()->setContent(cachedOrPendingFromValue(CSSPropertyContent, toCSSImageValue(item)), didSet);
+                    state.style()->setContent(cachedOrPendingFromValue(CSSPropertyContent, static_cast<CSSImageValue*>(item)), didSet);
                     didSet = true;
                     continue;
                 }
@@ -2177,7 +2180,7 @@ void StyleResolver::applyProperty(CSSPropertyID id, CSSValue* value)
                 if (!item->isPrimitiveValue())
                     continue;
 
-                CSSPrimitiveValue* contentValue = toCSSPrimitiveValue(item);
+                CSSPrimitiveValue* contentValue = static_cast<CSSPrimitiveValue*>(item);
 
                 if (contentValue->isString()) {
                     state.style()->setContent(contentValue->getStringValue().impl(), didSet);
@@ -2251,8 +2254,8 @@ void StyleResolver::applyProperty(CSSPropertyID id, CSSValue* value)
                     continue;
                 ASSERT_WITH_SECURITY_IMPLICATION(first->isPrimitiveValue());
                 ASSERT_WITH_SECURITY_IMPLICATION(second->isPrimitiveValue());
-                String startQuote = toCSSPrimitiveValue(first)->getStringValue();
-                String endQuote = toCSSPrimitiveValue(second)->getStringValue();
+                String startQuote = static_cast<CSSPrimitiveValue*>(first)->getStringValue();
+                String endQuote = static_cast<CSSPrimitiveValue*>(second)->getStringValue();
                 quotes.append(std::make_pair(startQuote, endQuote));
             }
             state.style()->setQuotes(QuotesData::create(quotes));
@@ -2673,10 +2676,10 @@ void StyleResolver::applyProperty(CSSPropertyID id, CSSValue* value)
             return;
         }
 
-        if (!value->isLineBoxContainValue())
+        if (!value->isCSSLineBoxContainValue())
             return;
 
-        CSSLineBoxContainValue* lineBoxContainValue = toCSSLineBoxContainValue(value);
+        CSSLineBoxContainValue* lineBoxContainValue = static_cast<CSSLineBoxContainValue*>(value);
         state.style()->setLineBoxContain(lineBoxContainValue->value());
         return;
     }
@@ -3072,21 +3075,21 @@ void StyleResolver::applyProperty(CSSPropertyID id, CSSValue* value)
 PassRefPtr<StyleImage> StyleResolver::styleImage(CSSPropertyID property, CSSValue* value)
 {
     if (value->isImageValue())
-        return cachedOrPendingFromValue(property, toCSSImageValue(value));
+        return cachedOrPendingFromValue(property, static_cast<CSSImageValue*>(value));
 
     if (value->isImageGeneratorValue()) {
         if (value->isGradientValue())
-            return generatedOrPendingFromValue(property, toCSSGradientValue(value)->gradientWithStylesResolved(this).get());
-        return generatedOrPendingFromValue(property, toCSSImageGeneratorValue(value));
+            return generatedOrPendingFromValue(property, static_cast<CSSGradientValue*>(value)->gradientWithStylesResolved(this).get());
+        return generatedOrPendingFromValue(property, static_cast<CSSImageGeneratorValue*>(value));
     }
 
 #if ENABLE(CSS_IMAGE_SET)
     if (value->isImageSetValue())
-        return setOrPendingFromValue(property, toCSSImageSetValue(value));
+        return setOrPendingFromValue(property, static_cast<CSSImageSetValue*>(value));
 #endif
 
     if (value->isCursorImageValue())
-        return cursorOrPendingFromValue(property, toCSSCursorImageValue(value));
+        return cursorOrPendingFromValue(property, static_cast<CSSCursorImageValue*>(value));
 
     return 0;
 }
@@ -3104,7 +3107,7 @@ PassRefPtr<StyleImage> StyleResolver::generatedOrPendingFromValue(CSSPropertyID
 #if ENABLE(CSS_FILTERS)
     if (value->isFilterImageValue()) {
         // FilterImage needs to calculate FilterOperations.
-        toCSSFilterImageValue(value)->createFilterOperations(this);
+        static_cast<CSSFilterImageValue*>(value)->createFilterOperations(this);
     }
 #endif
     if (value->isPending()) {
@@ -3383,7 +3386,7 @@ void StyleResolver::loadPendingSVGDocuments()
 StyleShader* StyleResolver::styleShader(CSSValue* value)
 {
     if (value->isWebKitCSSShaderValue())
-        return cachedOrPendingStyleShaderFromValue(toWebKitCSSShaderValue(value));
+        return cachedOrPendingStyleShaderFromValue(static_cast<WebKitCSSShaderValue*>(value));
     return 0;
 }
 
@@ -3466,7 +3469,7 @@ PassRefPtr<CustomFilterParameter> StyleResolver::parseCustomFilterArrayParameter
         CSSValue* value = values->itemWithoutBoundsCheck(i);
         if (!value->isPrimitiveValue())
             return 0;
-        CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
+        CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
         if (primitiveValue->primitiveType() != CSSPrimitiveValue::CSS_NUMBER)
             return 0;
         arrayParameter->addValue(primitiveValue->getDoubleValue());
@@ -3477,7 +3480,7 @@ PassRefPtr<CustomFilterParameter> StyleResolver::parseCustomFilterArrayParameter
 PassRefPtr<CustomFilterParameter> StyleResolver::parseCustomFilterColorParameter(const String& name, CSSValueList* values)
 {
     ASSERT(values->length());
-    CSSPrimitiveValue* firstPrimitiveValue = toCSSPrimitiveValue(values->itemWithoutBoundsCheck(0));
+    CSSPrimitiveValue* firstPrimitiveValue = static_cast<CSSPrimitiveValue*>(values->itemWithoutBoundsCheck(0));
     RefPtr<CustomFilterColorParameter> colorParameter = CustomFilterColorParameter::create(name);
     colorParameter->setColor(Color(firstPrimitiveValue->getRGBA32Value()));
     return colorParameter.release();
@@ -3490,7 +3493,7 @@ PassRefPtr<CustomFilterParameter> StyleResolver::parseCustomFilterNumberParamete
         CSSValue* value = values->itemWithoutBoundsCheck(i);
         if (!value->isPrimitiveValue())
             return 0;
-        CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
+        CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
         if (primitiveValue->primitiveType() != CSSPrimitiveValue::CSS_NUMBER)
             return 0;
         numberParameter->addValue(primitiveValue->getDoubleValue());
@@ -3539,7 +3542,7 @@ PassRefPtr<CustomFilterParameter> StyleResolver::parseCustomFilterParameter(cons
     if (!values->itemWithoutBoundsCheck(0)->isPrimitiveValue() || values->length() > 4)
         return 0;
     
-    CSSPrimitiveValue* firstPrimitiveValue = toCSSPrimitiveValue(values->itemWithoutBoundsCheck(0));
+    CSSPrimitiveValue* firstPrimitiveValue = static_cast<CSSPrimitiveValue*>(values->itemWithoutBoundsCheck(0));
     if (firstPrimitiveValue->primitiveType() == CSSPrimitiveValue::CSS_NUMBER)
         return parseCustomFilterNumberParameter(name, values);
 
@@ -3559,7 +3562,7 @@ bool StyleResolver::parseCustomFilterParameterList(CSSValue* parametersValue, Cu
         CSSValueListIterator iterator(parameterIterator.value());
         if (!iterator.isPrimitiveValue())
             return false;
-        CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(iterator.value());
+        CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(iterator.value());
         if (primitiveValue->primitiveType() != CSSPrimitiveValue::CSS_STRING)
             return false;
         
@@ -3619,7 +3622,7 @@ PassRefPtr<CustomFilterOperation> StyleResolver::createCustomFilterOperationWith
 
             ASSERT(mixFunction->length() <= 3);
             while (iterator.hasMore()) {
-                CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(iterator.value());
+                CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(iterator.value());
                 if (CSSParser::isBlendMode(primitiveValue->getValueID()))
                     mixSettings.blendMode = *primitiveValue;
                 else if (CSSParser::isCompositeOperator(primitiveValue->getValueID()))
@@ -3651,7 +3654,7 @@ PassRefPtr<CustomFilterOperation> StyleResolver::createCustomFilterOperationWith
         // the mesh-box list, if not it means it is the parameters list.
 
         if (iterator.hasMore() && iterator.isPrimitiveValue()) {
-            CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(iterator.value());
+            CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(iterator.value());
             if (primitiveValue->isNumber()) {
                 // If only one integer value is specified, it will set both
                 // the rows and the columns.
@@ -3660,7 +3663,7 @@ PassRefPtr<CustomFilterOperation> StyleResolver::createCustomFilterOperationWith
                 
                 // Try to match another number for the rows.
                 if (iterator.hasMore() && iterator.isPrimitiveValue()) {
-                    CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(iterator.value());
+                    CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(iterator.value());
                     if (primitiveValue->isNumber()) {
                         meshRows = primitiveValue->getIntValue();
                         iterator.advance();
@@ -3670,7 +3673,8 @@ PassRefPtr<CustomFilterOperation> StyleResolver::createCustomFilterOperationWith
         }
         
         if (iterator.hasMore() && iterator.isPrimitiveValue()) {
-            if (toCSSPrimitiveValue(iterator.value())->getValueID() == CSSValueDetached) {
+            CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(iterator.value());
+            if (primitiveValue->getValueID() == CSSValueDetached) {
                 meshType = MeshTypeDetached;
                 iterator.advance();
             }
@@ -3715,7 +3719,8 @@ bool StyleResolver::createFilterOperations(CSSValue* inValue, FilterOperations&
         return false;
     
     if (inValue->isPrimitiveValue()) {
-        if (toCSSPrimitiveValue(inValue)->getValueID() == CSSValueNone)
+        CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(inValue);
+        if (primitiveValue->getValueID() == CSSValueNone)
             return true;
     }
     
@@ -3785,7 +3790,7 @@ bool StyleResolver::createFilterOperations(CSSValue* inValue, FilterOperations&
                 continue;
         }
 
-        CSSPrimitiveValue* firstValue = filterValue->length() ? toCSSPrimitiveValue(filterValue->itemWithoutBoundsCheck(0)) : 0;
+        CSSPrimitiveValue* firstValue = filterValue->length() ? static_cast<CSSPrimitiveValue*>(filterValue->itemWithoutBoundsCheck(0)) : 0;
         switch (filterValue->operationType()) {
         case WebKitCSSFilterValue::GrayscaleFilterOperation:
         case WebKitCSSFilterValue::SepiaFilterOperation:
index d9dc75f..4725f86 100644 (file)
@@ -110,7 +110,7 @@ bool transformsForValue(const RenderStyle* style, const RenderStyle* rootStyle,
         if (haveNonPrimitiveValue)
             continue;
 
-        CSSPrimitiveValue* firstValue = toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(0));
+        CSSPrimitiveValue* firstValue = static_cast<CSSPrimitiveValue*>(transformValue->itemWithoutBoundsCheck(0));
 
         switch (transformValue->operationType()) {
         case WebKitCSSTransformValue::ScaleTransformOperation:
@@ -124,7 +124,7 @@ bool transformsForValue(const RenderStyle* style, const RenderStyle* rootStyle,
                 sx = firstValue->getDoubleValue();
                 if (transformValue->operationType() != WebKitCSSTransformValue::ScaleXTransformOperation) {
                     if (transformValue->length() > 1) {
-                        CSSPrimitiveValue* secondValue = toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(1));
+                        CSSPrimitiveValue* secondValue = static_cast<CSSPrimitiveValue*>(transformValue->itemWithoutBoundsCheck(1));
                         sy = secondValue->getDoubleValue();
                     } else
                         sy = sx;
@@ -146,11 +146,11 @@ bool transformsForValue(const RenderStyle* style, const RenderStyle* rootStyle,
                 sx = firstValue->getDoubleValue();
                 if (transformValue->operationType() != WebKitCSSTransformValue::ScaleXTransformOperation) {
                     if (transformValue->length() > 2) {
-                        CSSPrimitiveValue* thirdValue = toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(2));
+                        CSSPrimitiveValue* thirdValue = static_cast<CSSPrimitiveValue*>(transformValue->itemWithoutBoundsCheck(2));
                         sz = thirdValue->getDoubleValue();
                     }
                     if (transformValue->length() > 1) {
-                        CSSPrimitiveValue* secondValue = toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(1));
+                        CSSPrimitiveValue* secondValue = static_cast<CSSPrimitiveValue*>(transformValue->itemWithoutBoundsCheck(1));
                         sy = secondValue->getDoubleValue();
                     } else
                         sy = sx;
@@ -170,7 +170,7 @@ bool transformsForValue(const RenderStyle* style, const RenderStyle* rootStyle,
                 tx = convertToFloatLength(firstValue, style, rootStyle, zoomFactor);
                 if (transformValue->operationType() != WebKitCSSTransformValue::TranslateXTransformOperation) {
                     if (transformValue->length() > 1) {
-                        CSSPrimitiveValue* secondValue = toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(1));
+                        CSSPrimitiveValue* secondValue = static_cast<CSSPrimitiveValue*>(transformValue->itemWithoutBoundsCheck(1));
                         ty = convertToFloatLength(secondValue, style, rootStyle, zoomFactor);
                     }
                 }
@@ -195,11 +195,11 @@ bool transformsForValue(const RenderStyle* style, const RenderStyle* rootStyle,
                 tx = convertToFloatLength(firstValue, style, rootStyle, zoomFactor);
                 if (transformValue->operationType() != WebKitCSSTransformValue::TranslateXTransformOperation) {
                     if (transformValue->length() > 2) {
-                        CSSPrimitiveValue* thirdValue = toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(2));
+                        CSSPrimitiveValue* thirdValue = static_cast<CSSPrimitiveValue*>(transformValue->itemWithoutBoundsCheck(2));
                         tz = convertToFloatLength(thirdValue, style, rootStyle, zoomFactor);
                     }
                     if (transformValue->length() > 1) {
-                        CSSPrimitiveValue* secondValue = toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(1));
+                        CSSPrimitiveValue* secondValue = static_cast<CSSPrimitiveValue*>(transformValue->itemWithoutBoundsCheck(1));
                         ty = convertToFloatLength(secondValue, style, rootStyle, zoomFactor);
                     }
                 }
@@ -236,9 +236,9 @@ bool transformsForValue(const RenderStyle* style, const RenderStyle* rootStyle,
         case WebKitCSSTransformValue::Rotate3DTransformOperation: {
             if (transformValue->length() < 4)
                 break;
-            CSSPrimitiveValue* secondValue = toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(1));
-            CSSPrimitiveValue* thirdValue = toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(2));
-            CSSPrimitiveValue* fourthValue = toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(3));
+            CSSPrimitiveValue* secondValue = static_cast<CSSPrimitiveValue*>(transformValue->itemWithoutBoundsCheck(1));
+            CSSPrimitiveValue* thirdValue = static_cast<CSSPrimitiveValue*>(transformValue->itemWithoutBoundsCheck(2));
+            CSSPrimitiveValue* fourthValue = static_cast<CSSPrimitiveValue*>(transformValue->itemWithoutBoundsCheck(3));
             double x = firstValue->getDoubleValue();
             double y = secondValue->getDoubleValue();
             double z = thirdValue->getDoubleValue();
@@ -258,7 +258,7 @@ bool transformsForValue(const RenderStyle* style, const RenderStyle* rootStyle,
                 angleX = angle;
                 if (transformValue->operationType() == WebKitCSSTransformValue::SkewTransformOperation) {
                     if (transformValue->length() > 1) {
-                        CSSPrimitiveValue* secondValue = toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(1));
+                        CSSPrimitiveValue* secondValue = static_cast<CSSPrimitiveValue*>(transformValue->itemWithoutBoundsCheck(1));
                         angleY = secondValue->computeDegrees();
                     }
                 }
@@ -270,33 +270,33 @@ bool transformsForValue(const RenderStyle* style, const RenderStyle* rootStyle,
             if (transformValue->length() < 6)
                 break;
             double a = firstValue->getDoubleValue();
-            double b = toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(1))->getDoubleValue();
-            double c = toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(2))->getDoubleValue();
-            double d = toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(3))->getDoubleValue();
-            double e = zoomFactor * toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(4))->getDoubleValue();
-            double f = zoomFactor * toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(5))->getDoubleValue();
+            double b = static_cast<CSSPrimitiveValue*>(transformValue->itemWithoutBoundsCheck(1))->getDoubleValue();
+            double c = static_cast<CSSPrimitiveValue*>(transformValue->itemWithoutBoundsCheck(2))->getDoubleValue();
+            double d = static_cast<CSSPrimitiveValue*>(transformValue->itemWithoutBoundsCheck(3))->getDoubleValue();
+            double e = zoomFactor * static_cast<CSSPrimitiveValue*>(transformValue->itemWithoutBoundsCheck(4))->getDoubleValue();
+            double f = zoomFactor * static_cast<CSSPrimitiveValue*>(transformValue->itemWithoutBoundsCheck(5))->getDoubleValue();
             operations.operations().append(MatrixTransformOperation::create(a, b, c, d, e, f));
             break;
         }
         case WebKitCSSTransformValue::Matrix3DTransformOperation: {
             if (transformValue->length() < 16)
                 break;
-            TransformationMatrix matrix(toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(0))->getDoubleValue(),
-                toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(1))->getDoubleValue(),
-                toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(2))->getDoubleValue(),
-                toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(3))->getDoubleValue(),
-                toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(4))->getDoubleValue(),
-                toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(5))->getDoubleValue(),
-                toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(6))->getDoubleValue(),
-                toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(7))->getDoubleValue(),
-                toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(8))->getDoubleValue(),
-                toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(9))->getDoubleValue(),
-                toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(10))->getDoubleValue(),
-                toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(11))->getDoubleValue(),
-                zoomFactor * toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(12))->getDoubleValue(),
-                zoomFactor * toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(13))->getDoubleValue(),
-                toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(14))->getDoubleValue(),
-                toCSSPrimitiveValue(transformValue->itemWithoutBoundsCheck(15))->getDoubleValue());
+            TransformationMatrix matrix(static_cast<CSSPrimitiveValue*>(transformValue->itemWithoutBoundsCheck(0))->getDoubleValue(),
+                                static_cast<CSSPrimitiveValue*>(transformValue->itemWithoutBoundsCheck(1))->getDoubleValue(),
+                                static_cast<CSSPrimitiveValue*>(transformValue->itemWithoutBoundsCheck(2))->getDoubleValue(),
+                                static_cast<CSSPrimitiveValue*>(transformValue->itemWithoutBoundsCheck(3))->getDoubleValue(),
+                                static_cast<CSSPrimitiveValue*>(transformValue->itemWithoutBoundsCheck(4))->getDoubleValue(),
+                                static_cast<CSSPrimitiveValue*>(transformValue->itemWithoutBoundsCheck(5))->getDoubleValue(),
+                                static_cast<CSSPrimitiveValue*>(transformValue->itemWithoutBoundsCheck(6))->getDoubleValue(),
+                                static_cast<CSSPrimitiveValue*>(transformValue->itemWithoutBoundsCheck(7))->getDoubleValue(),
+                                static_cast<CSSPrimitiveValue*>(transformValue->itemWithoutBoundsCheck(8))->getDoubleValue(),
+                                static_cast<CSSPrimitiveValue*>(transformValue->itemWithoutBoundsCheck(9))->getDoubleValue(),
+                                static_cast<CSSPrimitiveValue*>(transformValue->itemWithoutBoundsCheck(10))->getDoubleValue(),
+                                static_cast<CSSPrimitiveValue*>(transformValue->itemWithoutBoundsCheck(11))->getDoubleValue(),
+                                zoomFactor * static_cast<CSSPrimitiveValue*>(transformValue->itemWithoutBoundsCheck(12))->getDoubleValue(),
+                                zoomFactor * static_cast<CSSPrimitiveValue*>(transformValue->itemWithoutBoundsCheck(13))->getDoubleValue(),
+                                static_cast<CSSPrimitiveValue*>(transformValue->itemWithoutBoundsCheck(14))->getDoubleValue(),
+                                static_cast<CSSPrimitiveValue*>(transformValue->itemWithoutBoundsCheck(15))->getDoubleValue());
             operations.operations().append(Matrix3DTransformOperation::create(matrix));
             break;
         }
index 4e1e53a..ea6470a 100644 (file)
@@ -110,7 +110,7 @@ float ViewportStyleResolver::getViewportArgumentValue(CSSPropertyID id) const
     if (!value || !value->isPrimitiveValue())
         return defaultValue;
 
-    CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value.get());
+    CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value.get());
 
     if (primitiveValue->isNumber() || primitiveValue->isPx())
         return primitiveValue->getFloatValue();
index b4dd50d..a33b895 100644 (file)
@@ -62,7 +62,7 @@ void WebKitCSSMatrix::setMatrixValue(const String& string, ExceptionCode& ec)
         RefPtr<CSSValue> value = styleDeclaration->getPropertyCSSValue(CSSPropertyWebkitTransform);
 
         // Check for a "none" or empty transform. In these cases we can use the default identity matrix.
-        if (!value || (value->isPrimitiveValue() && (toCSSPrimitiveValue(value.get()))->getValueID() == CSSValueNone))
+        if (!value || (value->isPrimitiveValue() && (static_cast<CSSPrimitiveValue*>(value.get()))->getValueID() == CSSValueNone))
             return;
 
         TransformOperations operations;
index 5a2a924..6323f45 100644 (file)
@@ -1516,7 +1516,7 @@ float ApplyStyleCommand::computedFontSize(Node* node)
 
     RefPtr<CSSValue> value = ComputedStyleExtractor(node).propertyValue(CSSPropertyFontSize);
     ASSERT(value && value->isPrimitiveValue());
-    return toCSSPrimitiveValue(value.get())->getFloatValue(CSSPrimitiveValue::CSS_PX);
+    return static_cast<CSSPrimitiveValue*>(value.get())->getFloatValue(CSSPrimitiveValue::CSS_PX);
 }
 
 void ApplyStyleCommand::joinChildTextNodes(Node* node, const Position& start, const Position& end)
index 2fb2f2d..2e0487a 100644 (file)
@@ -144,7 +144,7 @@ int identifierForStyleProperty(T* style, CSSPropertyID propertyID)
     RefPtr<CSSValue> value = extractPropertyValue(style, propertyID);
     if (!value || !value->isPrimitiveValue())
         return 0;
-    return toCSSPrimitiveValue(value.get())->getValueID();
+    return static_cast<CSSPrimitiveValue*>(value.get())->getValueID();
 }
 
 template<typename T> PassRefPtr<MutableStylePropertySet> getPropertiesNotIn(StylePropertySet* styleWithRedundantProperties, T* baseStyle);
@@ -201,7 +201,7 @@ HTMLElementEquivalent::HTMLElementEquivalent(CSSPropertyID id, CSSValueID primit
 bool HTMLElementEquivalent::valueIsPresentInStyle(Element* element, StylePropertySet* style) const
 {
     RefPtr<CSSValue> value = style->getPropertyCSSValue(m_propertyID);
-    return matches(element) && value && value->isPrimitiveValue() && toCSSPrimitiveValue(value.get())->getValueID() == m_primitiveValue->getValueID();
+    return matches(element) && value && value->isPrimitiveValue() && static_cast<CSSPrimitiveValue*>(value.get())->getValueID() == m_primitiveValue->getValueID();
 }
 
 void HTMLElementEquivalent::addToStyle(Element*, EditingStyle* style) const
@@ -378,7 +378,7 @@ static RGBA32 cssValueToRGBA(CSSValue* colorValue)
     if (!colorValue || !colorValue->isPrimitiveValue())
         return Color::transparent;
     
-    CSSPrimitiveValue* primitiveColor = toCSSPrimitiveValue(colorValue);
+    CSSPrimitiveValue* primitiveColor = static_cast<CSSPrimitiveValue*>(colorValue);
     if (primitiveColor->isRGBColor())
         return primitiveColor->getRGBA32Value();
     
@@ -498,7 +498,7 @@ void EditingStyle::extractFontSizeDelta()
     if (!value || !value->isPrimitiveValue())
         return;
 
-    CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value.get());
+    CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value.get());
 
     // Only PX handled now. If we handle more types in the future, perhaps
     // a switch statement here would be more appropriate.
@@ -523,13 +523,13 @@ bool EditingStyle::textDirection(WritingDirection& writingDirection) const
     if (!unicodeBidi || !unicodeBidi->isPrimitiveValue())
         return false;
 
-    CSSValueID unicodeBidiValue = toCSSPrimitiveValue(unicodeBidi.get())->getValueID();
+    CSSValueID unicodeBidiValue = static_cast<CSSPrimitiveValue*>(unicodeBidi.get())->getValueID();
     if (unicodeBidiValue == CSSValueEmbed) {
         RefPtr<CSSValue> direction = m_mutableStyle->getPropertyCSSValue(CSSPropertyDirection);
         if (!direction || !direction->isPrimitiveValue())
             return false;
 
-        writingDirection = toCSSPrimitiveValue(direction.get())->getValueID() == CSSValueLtr ? LeftToRightWritingDirection : RightToLeftWritingDirection;
+        writingDirection = static_cast<CSSPrimitiveValue*>(direction.get())->getValueID() == CSSValueLtr ? LeftToRightWritingDirection : RightToLeftWritingDirection;
 
         return true;
     }
@@ -949,9 +949,9 @@ void EditingStyle::prepareToApplyAt(const Position& position, ShouldPreserveWrit
         m_mutableStyle->removeProperty(CSSPropertyBackgroundColor);
 
     if (unicodeBidi && unicodeBidi->isPrimitiveValue()) {
-        m_mutableStyle->setProperty(CSSPropertyUnicodeBidi, static_cast<CSSValueID>(toCSSPrimitiveValue(unicodeBidi.get())->getValueID()));
+        m_mutableStyle->setProperty(CSSPropertyUnicodeBidi, static_cast<CSSValueID>(static_cast<CSSPrimitiveValue*>(unicodeBidi.get())->getValueID()));
         if (direction && direction->isPrimitiveValue())
-            m_mutableStyle->setProperty(CSSPropertyDirection, static_cast<CSSValueID>(toCSSPrimitiveValue(direction.get())->getValueID()));
+            m_mutableStyle->setProperty(CSSPropertyDirection, static_cast<CSSValueID>(static_cast<CSSPrimitiveValue*>(direction.get())->getValueID()));
     }
 }
 
@@ -1149,7 +1149,7 @@ void EditingStyle::mergeStyleFromRulesForSerialization(StyledElement* element)
             CSSValue* value = property.value();
             if (!value->isPrimitiveValue())
                 continue;
-            if (toCSSPrimitiveValue(value)->isPercentage()) {
+            if (static_cast<CSSPrimitiveValue*>(value)->isPercentage()) {
                 if (RefPtr<CSSValue> computedPropertyValue = computedStyle.propertyValue(property.id()))
                     fromComputedStyle->addParsedProperty(CSSProperty(property.id(), computedPropertyValue.release()));
             }
@@ -1222,7 +1222,7 @@ int EditingStyle::legacyFontSize(Document* document) const
     RefPtr<CSSValue> cssValue = m_mutableStyle->getPropertyCSSValue(CSSPropertyFontSize);
     if (!cssValue || !cssValue->isPrimitiveValue())
         return 0;
-    return legacyFontSizeFromCSSValue(document, toCSSPrimitiveValue(cssValue.get()),
+    return legacyFontSizeFromCSSValue(document, static_cast<CSSPrimitiveValue*>(cssValue.get()),
         m_shouldUseFixedDefaultFontSize, AlwaysUseLegacyFontSize);
 }
 
@@ -1286,7 +1286,7 @@ WritingDirection EditingStyle::textDirectionForSelection(const VisibleSelection&
             if (!unicodeBidi || !unicodeBidi->isPrimitiveValue())
                 continue;
 
-            CSSValueID unicodeBidiValue = toCSSPrimitiveValue(unicodeBidi.get())->getValueID();
+            CSSValueID unicodeBidiValue = static_cast<CSSPrimitiveValue*>(unicodeBidi.get())->getValueID();
             if (unicodeBidiValue == CSSValueEmbed || unicodeBidiValue == CSSValueBidiOverride)
                 return NaturalWritingDirection;
         }
@@ -1315,7 +1315,7 @@ WritingDirection EditingStyle::textDirectionForSelection(const VisibleSelection&
         if (!unicodeBidi || !unicodeBidi->isPrimitiveValue())
             continue;
 
-        CSSValueID unicodeBidiValue = toCSSPrimitiveValue(unicodeBidi.get())->getValueID();
+        CSSValueID unicodeBidiValue = static_cast<CSSPrimitiveValue*>(unicodeBidi.get())->getValueID();
         if (unicodeBidiValue == CSSValueNormal)
             continue;
 
@@ -1327,7 +1327,7 @@ WritingDirection EditingStyle::textDirectionForSelection(const VisibleSelection&
         if (!direction || !direction->isPrimitiveValue())
             continue;
 
-        CSSValueID directionValue = toCSSPrimitiveValue(direction.get())->getValueID();
+        CSSValueID directionValue = static_cast<CSSPrimitiveValue*>(direction.get())->getValueID();
         if (directionValue != CSSValueLtr && directionValue != CSSValueRtl)
             continue;
 
@@ -1467,7 +1467,7 @@ void StyleChange::extractTextStyles(Document* document, MutableStylePropertySet*
     if (RefPtr<CSSValue> fontSize = style->getPropertyCSSValue(CSSPropertyFontSize)) {
         if (!fontSize->isPrimitiveValue())
             style->removeProperty(CSSPropertyFontSize); // Can't make sense of the number. Put no font size.
-        else if (int legacyFontSize = legacyFontSizeFromCSSValue(document, toCSSPrimitiveValue(fontSize.get()),
+        else if (int legacyFontSize = legacyFontSizeFromCSSValue(document, static_cast<CSSPrimitiveValue*>(fontSize.get()),
                 shouldUseFixedFontDefaultSize, UseLegacyFontSizeOnlyIfPixelValuesMatch)) {
             m_applyFontSize = String::number(legacyFontSize);
             style->removeProperty(CSSPropertyFontSize);
@@ -1499,7 +1499,7 @@ static bool fontWeightIsBold(CSSValue* fontWeight)
 
     // Because b tag can only bold text, there are only two states in plain html: bold and not bold.
     // Collapse all other values to either one of these two states for editing purposes.
-    switch (toCSSPrimitiveValue(fontWeight)->getValueID()) {
+    switch (static_cast<CSSPrimitiveValue*>(fontWeight)->getValueID()) {
         case CSSValue100:
         case CSSValue200:
         case CSSValue300:
@@ -1593,7 +1593,7 @@ bool isTransparentColorValue(CSSValue* cssValue)
         return true;
     if (!cssValue->isPrimitiveValue())
         return false;
-    CSSPrimitiveValue* value = toCSSPrimitiveValue(cssValue);    
+    CSSPrimitiveValue* value = static_cast<CSSPrimitiveValue*>(cssValue);    
     if (value->isRGBColor())
         return !alphaChannel(value->getRGBA32Value());    
     return value->getValueID() == CSSValueTransparent;
index 9f479cd..5a81424 100644 (file)
@@ -467,7 +467,7 @@ static bool propertyMissingOrEqualToNone(StylePropertySet* style, CSSPropertyID
         return true;
     if (!value->isPrimitiveValue())
         return false;
-    return toCSSPrimitiveValue(value.get())->getValueID() == CSSValueNone;
+    return static_cast<CSSPrimitiveValue*>(value.get())->getValueID() == CSSValueNone;
 }
 
 static bool needInterchangeNewlineAfter(const VisiblePosition& v)
index cdb7c3c..9b90fcb 100644 (file)
@@ -332,7 +332,7 @@ void PageSerializer::retrieveResourcesForProperties(const StylePropertySet* styl
         if (!cssValue->isImageValue())
             continue;
 
-        CSSImageValue* imageValue = toCSSImageValue(cssValue.get());
+        CSSImageValue* imageValue = static_cast<CSSImageValue*>(cssValue.get());
         StyleImage* styleImage = imageValue->cachedOrPendingImage();
         // Non cached-images are just place-holders and do not contain data.
         if (!styleImage || !styleImage->isCachedImage())
index c9511c0..b689ee7 100644 (file)
@@ -45,14 +45,14 @@ class StylePendingImage : public StyleImage {
 public:
     static PassRefPtr<StylePendingImage> create(CSSValue* value) { return adoptRef(new StylePendingImage(value)); }
 
-    virtual WrappedImagePtr data() const { return toCSSImageValue(m_value); }
+    virtual WrappedImagePtr data() const { return static_cast<CSSImageValue*>(m_value); }
 
     virtual PassRefPtr<CSSValue> cssValue() const { return m_value; }
-    CSSImageValue* cssImageValue() const { return m_value->isImageValue() ? toCSSImageValue(m_value) : 0; }
-    CSSImageGeneratorValue* cssImageGeneratorValue() const { return m_value->isImageGeneratorValue() ? toCSSImageGeneratorValue(m_value) : 0; }
-    CSSCursorImageValue* cssCursorImageValue() const { return m_value->isCursorImageValue() ? toCSSCursorImageValue(m_value) : 0; }
+    CSSImageValue* cssImageValue() const { return m_value->isImageValue() ? static_cast<CSSImageValue*>(m_value) : 0; }
+    CSSImageGeneratorValue* cssImageGeneratorValue() const { return m_value->isImageGeneratorValue() ? static_cast<CSSImageGeneratorValue*>(m_value) : 0; }
+    CSSCursorImageValue* cssCursorImageValue() const { return m_value->isCursorImageValue() ? static_cast<CSSCursorImageValue*>(m_value) : 0; }
 #if ENABLE(CSS_IMAGE_SET)
-    CSSImageSetValue* cssImageSetValue() const { return m_value->isImageSetValue() ? toCSSImageSetValue(m_value) : 0; }
+    CSSImageSetValue* cssImageSetValue() const { return m_value->isImageSetValue() ? static_cast<CSSImageSetValue*>(m_value) : 0; }
 #endif
     
     virtual LayoutSize imageSize(const RenderObject*, float /*multiplier*/) const OVERRIDE { return LayoutSize(); }