<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[174300] trunk/Source/WebCore</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/174300">174300</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2014-10-03 16:17:00 -0700 (Fri, 03 Oct 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Use is&lt;&gt;() / downcast&lt;&gt;() for CSSValue subclasses
https://bugs.webkit.org/show_bug.cgi?id=137381

Reviewed by Benjamin Poulain.

Use is&lt;&gt;() / downcast&lt;&gt;() for CSSValue subclasses.

No new tests, no behavior change.

* css/CSSAspectRatioValue.h:
* css/CSSBorderImageSliceValue.h:
* css/CSSCalculationValue.cpp:
(WebCore::CSSCalcExpressionNodeParser::parseValue):
* css/CSSCalculationValue.h:
* css/CSSCanvasValue.h:
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::getBorderRadiusShorthandValue):
(WebCore::ComputedStyleExtractor::propertyMatches):
* css/CSSCrossfadeValue.cpp:
(WebCore::subimageKnownToBeOpaque):
* css/CSSCrossfadeValue.h:
* css/CSSCursorImageValue.cpp:
(WebCore::CSSCursorImageValue::~CSSCursorImageValue):
(WebCore::CSSCursorImageValue::updateIfSVGCursorIsUsed):
(WebCore::CSSCursorImageValue::cachedImage):
(WebCore::CSSCursorImageValue::cachedOrPendingImage):
(WebCore::CSSCursorImageValue::isSVGCursor):
* css/CSSCursorImageValue.h:
* css/CSSFilterImageValue.h:
* css/CSSFontFaceSrcValue.h:
* css/CSSFontFeatureValue.h:
* css/CSSFontSelector.cpp:
(WebCore::CSSFontSelector::addFontFaceRule):
* css/CSSFontValue.h:
* css/CSSFunctionValue.h:
* css/CSSGradientValue.cpp:
(WebCore::CSSGradientValue::image):
(WebCore::CSSGradientValue::gradientWithStylesResolved):
* css/CSSGradientValue.h:
* css/CSSGridLineNamesValue.h:
* css/CSSGridTemplateAreasValue.h:
* css/CSSImageGeneratorValue.cpp:
(WebCore::CSSImageGeneratorValue::image):
(WebCore::CSSImageGeneratorValue::isFixedSize):
(WebCore::CSSImageGeneratorValue::fixedSize):
(WebCore::CSSImageGeneratorValue::isPending):
(WebCore::CSSImageGeneratorValue::knownToBeOpaque):
(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::addFillValue):
(WebCore::CSSParser::addAnimationValue):
(WebCore::CSSParser::parse3ValuesFillPosition):
(WebCore::CSSParser::parseFillPosition):
(WebCore::CSSParser::parseFillRepeat):
(WebCore::gridMissingGridPositionValue):
(WebCore::CSSParser::parseGridTemplateRowsAndAreas):
(WebCore::CSSParser::parseBasicShapeCircle):
(WebCore::CSSParser::parseBasicShapeEllipse):
(WebCore::CSSParser::parseDeprecatedGradient):
(WebCore::CSSParser::parseDeprecatedRadialGradient):
(WebCore::CSSParser::parseRadialGradient):
(WebCore::CSSParser::createFontFaceRule):
* css/CSSPrimitiveValue.h:
* css/CSSReflectValue.h:
* css/CSSShadowValue.h:
* css/CSSTimingFunctionValue.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::mapNinePieceImage):
(WebCore::CSSToStyleMap::mapNinePieceImageSlice):
(WebCore::CSSToStyleMap::mapNinePieceImageQuad):
(WebCore::CSSToStyleMap::mapNinePieceImageRepeat):
* css/CSSUnicodeRangeValue.h:
* css/CSSValue.cpp:
(WebCore::CSSValue::isImplicitInitialValue):
(WebCore::CSSValue::addSubresourceStyleURLs):
(WebCore::CSSValue::hasFailedOrCanceledSubresources):
(WebCore::CSSValue::equals):
(WebCore::CSSValue::cssText):
(WebCore::CSSValue::destroy):
(WebCore::CSSValue::cloneForCSSOM):
* css/CSSValue.h:
* css/CSSValueList.h:
(WebCore::CSSValueListInspector::CSSValueListInspector):
* 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::ApplyPropertyFillLayer::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::ApplyPropertyTextDecorationSkip::applyValue):
(WebCore::ApplyPropertyMarqueeIncrement::applyValue):
(WebCore::ApplyPropertyMarqueeRepetition::applyValue):
(WebCore::ApplyPropertyMarqueeSpeed::applyValue):
(WebCore::ApplyPropertyTextUnderlinePosition::applyValue):
(WebCore::ApplyPropertyLineHeight::applyValue):
(WebCore::ApplyPropertyLineHeightForIOSTextAutosizing::applyValue):
(WebCore::ApplyPropertyWordSpacing::applyValue):
(WebCore::ApplyPropertyPageSize::applyValue):
(WebCore::ApplyPropertyTextEmphasisStyle::applyValue):
(WebCore::ApplyPropertyTextEmphasisPosition::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/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/SVGCSSComputedStyleDeclaration.cpp:
(WebCore::strokeDashArrayToCSSValueList):
(WebCore::ComputedStyleExtractor::svgPropertyValue):
* css/SVGCSSStyleSelector.cpp:
(WebCore::StyleResolver::applySVGProperty):
* css/SourceSizeList.cpp:
(WebCore::computeLength):
* css/StyleProperties.cpp:
(WebCore::StyleProperties::getLayeredShorthandValue):
* css/StyleResolver.cpp:
(WebCore::extractDirectionAndWritingMode):
(WebCore::createGridTrackSize):
(WebCore::createGridTrackList):
(WebCore::createGridPosition):
(WebCore::StyleResolver::parseSnapCoordinate):
(WebCore::StyleResolver::parseSnapPoints):
(WebCore::StyleResolver::applyProperty):
(WebCore::StyleResolver::styleImage):
(WebCore::StyleResolver::generatedOrPendingFromValue):
(WebCore::StyleResolver::createFilterOperations):
* css/TransformFunctions.cpp:
(WebCore::transformsForValue):
* css/ViewportStyleResolver.cpp:
(WebCore::ViewportStyleResolver::getViewportArgumentValue):
* css/WebKitCSSFilterValue.h:
* css/WebKitCSSMatrix.cpp:
(WebCore::WebKitCSSMatrix::setMatrixValue):
* css/WebKitCSSTransformValue.h:
(WebCore::toWebKitCSSTransformValue): Deleted.
* editing/ApplyStyleCommand.cpp:
(WebCore::ApplyStyleCommand::computedFontSize):
* editing/EditingStyle.cpp:
(WebCore::identifierForStyleProperty):
(WebCore::HTMLElementEquivalent::valueIsPresentInStyle):
(WebCore::HTMLTextDecorationEquivalent::valueIsPresentInStyle):
(WebCore::cssValueToRGBA):
(WebCore::EditingStyle::extractFontSizeDelta):
(WebCore::EditingStyle::textDirection):
(WebCore::EditingStyle::prepareToApplyAt):
(WebCore::EditingStyle::mergeStyle):
(WebCore::EditingStyle::mergeStyleFromRulesForSerialization):
(WebCore::EditingStyle::legacyFontSize):
(WebCore::EditingStyle::textDirectionForSelection):
(WebCore::StyleChange::extractTextStyles):
(WebCore::diffTextDecorations):
(WebCore::fontWeightIsBold):
(WebCore::isTransparentColorValue):
* editing/EditorCommand.cpp:
(WebCore::executeToggleStyleInList):
* editing/cocoa/HTMLConverter.mm:
(stringFromCSSValue):
(HTMLConverterCaches::floatPropertyValueForNode):
(HTMLConverterCaches::colorPropertyValueForNode):
* editing/markup.cpp:
(WebCore::propertyMissingOrEqualToNone):
* page/PageSerializer.cpp:
(WebCore::PageSerializer::retrieveResourcesForProperties):
* page/animation/CSSPropertyAnimation.cpp:
(WebCore::blendFunc):
* rendering/RenderTextControl.cpp:
(WebCore::RenderTextControl::adjustInnerTextStyle):
* rendering/style/StylePendingImage.h:
(WebCore::StylePendingImage::cssImageValue):
(WebCore::StylePendingImage::cssCursorImageValue):
(WebCore::StylePendingImage::cssImageSetValue):
* svg/SVGColor.h:
* svg/SVGFontFaceElement.cpp:
(WebCore::SVGFontFaceElement::rebuildFontFace):
* svg/SVGPaint.h:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorecssCSSAspectRatioValueh">trunk/Source/WebCore/css/CSSAspectRatioValue.h</a></li>
<li><a href="#trunkSourceWebCorecssCSSBorderImageSliceValueh">trunk/Source/WebCore/css/CSSBorderImageSliceValue.h</a></li>
<li><a href="#trunkSourceWebCorecssCSSCalculationValuecpp">trunk/Source/WebCore/css/CSSCalculationValue.cpp</a></li>
<li><a href="#trunkSourceWebCorecssCSSCalculationValueh">trunk/Source/WebCore/css/CSSCalculationValue.h</a></li>
<li><a href="#trunkSourceWebCorecssCSSCanvasValueh">trunk/Source/WebCore/css/CSSCanvasValue.h</a></li>
<li><a href="#trunkSourceWebCorecssCSSComputedStyleDeclarationcpp">trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp</a></li>
<li><a href="#trunkSourceWebCorecssCSSCrossfadeValuecpp">trunk/Source/WebCore/css/CSSCrossfadeValue.cpp</a></li>
<li><a href="#trunkSourceWebCorecssCSSCrossfadeValueh">trunk/Source/WebCore/css/CSSCrossfadeValue.h</a></li>
<li><a href="#trunkSourceWebCorecssCSSCursorImageValuecpp">trunk/Source/WebCore/css/CSSCursorImageValue.cpp</a></li>
<li><a href="#trunkSourceWebCorecssCSSCursorImageValueh">trunk/Source/WebCore/css/CSSCursorImageValue.h</a></li>
<li><a href="#trunkSourceWebCorecssCSSFilterImageValueh">trunk/Source/WebCore/css/CSSFilterImageValue.h</a></li>
<li><a href="#trunkSourceWebCorecssCSSFontFaceSrcValueh">trunk/Source/WebCore/css/CSSFontFaceSrcValue.h</a></li>
<li><a href="#trunkSourceWebCorecssCSSFontFeatureValueh">trunk/Source/WebCore/css/CSSFontFeatureValue.h</a></li>
<li><a href="#trunkSourceWebCorecssCSSFontSelectorcpp">trunk/Source/WebCore/css/CSSFontSelector.cpp</a></li>
<li><a href="#trunkSourceWebCorecssCSSFontValueh">trunk/Source/WebCore/css/CSSFontValue.h</a></li>
<li><a href="#trunkSourceWebCorecssCSSFunctionValueh">trunk/Source/WebCore/css/CSSFunctionValue.h</a></li>
<li><a href="#trunkSourceWebCorecssCSSGradientValuecpp">trunk/Source/WebCore/css/CSSGradientValue.cpp</a></li>
<li><a href="#trunkSourceWebCorecssCSSGradientValueh">trunk/Source/WebCore/css/CSSGradientValue.h</a></li>
<li><a href="#trunkSourceWebCorecssCSSGridLineNamesValueh">trunk/Source/WebCore/css/CSSGridLineNamesValue.h</a></li>
<li><a href="#trunkSourceWebCorecssCSSGridTemplateAreasValueh">trunk/Source/WebCore/css/CSSGridTemplateAreasValue.h</a></li>
<li><a href="#trunkSourceWebCorecssCSSImageGeneratorValuecpp">trunk/Source/WebCore/css/CSSImageGeneratorValue.cpp</a></li>
<li><a href="#trunkSourceWebCorecssCSSImageGeneratorValueh">trunk/Source/WebCore/css/CSSImageGeneratorValue.h</a></li>
<li><a href="#trunkSourceWebCorecssCSSImageSetValuecpp">trunk/Source/WebCore/css/CSSImageSetValue.cpp</a></li>
<li><a href="#trunkSourceWebCorecssCSSImageSetValueh">trunk/Source/WebCore/css/CSSImageSetValue.h</a></li>
<li><a href="#trunkSourceWebCorecssCSSImageValueh">trunk/Source/WebCore/css/CSSImageValue.h</a></li>
<li><a href="#trunkSourceWebCorecssCSSInheritedValueh">trunk/Source/WebCore/css/CSSInheritedValue.h</a></li>
<li><a href="#trunkSourceWebCorecssCSSInitialValueh">trunk/Source/WebCore/css/CSSInitialValue.h</a></li>
<li><a href="#trunkSourceWebCorecssCSSLineBoxContainValueh">trunk/Source/WebCore/css/CSSLineBoxContainValue.h</a></li>
<li><a href="#trunkSourceWebCorecssCSSParsercpp">trunk/Source/WebCore/css/CSSParser.cpp</a></li>
<li><a href="#trunkSourceWebCorecssCSSPrimitiveValueh">trunk/Source/WebCore/css/CSSPrimitiveValue.h</a></li>
<li><a href="#trunkSourceWebCorecssCSSReflectValueh">trunk/Source/WebCore/css/CSSReflectValue.h</a></li>
<li><a href="#trunkSourceWebCorecssCSSShadowValueh">trunk/Source/WebCore/css/CSSShadowValue.h</a></li>
<li><a href="#trunkSourceWebCorecssCSSTimingFunctionValueh">trunk/Source/WebCore/css/CSSTimingFunctionValue.h</a></li>
<li><a href="#trunkSourceWebCorecssCSSToStyleMapcpp">trunk/Source/WebCore/css/CSSToStyleMap.cpp</a></li>
<li><a href="#trunkSourceWebCorecssCSSUnicodeRangeValueh">trunk/Source/WebCore/css/CSSUnicodeRangeValue.h</a></li>
<li><a href="#trunkSourceWebCorecssCSSValuecpp">trunk/Source/WebCore/css/CSSValue.cpp</a></li>
<li><a href="#trunkSourceWebCorecssCSSValueh">trunk/Source/WebCore/css/CSSValue.h</a></li>
<li><a href="#trunkSourceWebCorecssCSSValueListh">trunk/Source/WebCore/css/CSSValueList.h</a></li>
<li><a href="#trunkSourceWebCorecssDeprecatedStyleBuildercpp">trunk/Source/WebCore/css/DeprecatedStyleBuilder.cpp</a></li>
<li><a href="#trunkSourceWebCorecssMediaListcpp">trunk/Source/WebCore/css/MediaList.cpp</a></li>
<li><a href="#trunkSourceWebCorecssMediaQueryEvaluatorcpp">trunk/Source/WebCore/css/MediaQueryEvaluator.cpp</a></li>
<li><a href="#trunkSourceWebCorecssSVGCSSStyleSelectorcpp">trunk/Source/WebCore/css/SVGCSSStyleSelector.cpp</a></li>
<li><a href="#trunkSourceWebCorecssSourceSizeListcpp">trunk/Source/WebCore/css/SourceSizeList.cpp</a></li>
<li><a href="#trunkSourceWebCorecssStylePropertiescpp">trunk/Source/WebCore/css/StyleProperties.cpp</a></li>
<li><a href="#trunkSourceWebCorecssStyleResolvercpp">trunk/Source/WebCore/css/StyleResolver.cpp</a></li>
<li><a href="#trunkSourceWebCorecssTransformFunctionscpp">trunk/Source/WebCore/css/TransformFunctions.cpp</a></li>
<li><a href="#trunkSourceWebCorecssViewportStyleResolvercpp">trunk/Source/WebCore/css/ViewportStyleResolver.cpp</a></li>
<li><a href="#trunkSourceWebCorecssWebKitCSSFilterValueh">trunk/Source/WebCore/css/WebKitCSSFilterValue.h</a></li>
<li><a href="#trunkSourceWebCorecssWebKitCSSMatrixcpp">trunk/Source/WebCore/css/WebKitCSSMatrix.cpp</a></li>
<li><a href="#trunkSourceWebCorecssWebKitCSSTransformValueh">trunk/Source/WebCore/css/WebKitCSSTransformValue.h</a></li>
<li><a href="#trunkSourceWebCoreeditingApplyStyleCommandcpp">trunk/Source/WebCore/editing/ApplyStyleCommand.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingEditingStylecpp">trunk/Source/WebCore/editing/EditingStyle.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingEditorCommandcpp">trunk/Source/WebCore/editing/EditorCommand.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingcocoaHTMLConvertermm">trunk/Source/WebCore/editing/cocoa/HTMLConverter.mm</a></li>
<li><a href="#trunkSourceWebCoreeditingmarkupcpp">trunk/Source/WebCore/editing/markup.cpp</a></li>
<li><a href="#trunkSourceWebCorepagePageSerializercpp">trunk/Source/WebCore/page/PageSerializer.cpp</a></li>
<li><a href="#trunkSourceWebCorepageanimationCSSPropertyAnimationcpp">trunk/Source/WebCore/page/animation/CSSPropertyAnimation.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderTextControlcpp">trunk/Source/WebCore/rendering/RenderTextControl.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingstyleStylePendingImageh">trunk/Source/WebCore/rendering/style/StylePendingImage.h</a></li>
<li><a href="#trunkSourceWebCoresvgSVGColorh">trunk/Source/WebCore/svg/SVGColor.h</a></li>
<li><a href="#trunkSourceWebCoresvgSVGFontFaceElementcpp">trunk/Source/WebCore/svg/SVGFontFaceElement.cpp</a></li>
<li><a href="#trunkSourceWebCoresvgSVGPainth">trunk/Source/WebCore/svg/SVGPaint.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (174299 => 174300)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-10-03 23:05:07 UTC (rev 174299)
+++ trunk/Source/WebCore/ChangeLog        2014-10-03 23:17:00 UTC (rev 174300)
</span><span class="lines">@@ -1,3 +1,241 @@
</span><ins>+2014-10-03  Christophe Dumez  &lt;cdumez@apple.com&gt;
+
+        Use is&lt;&gt;() / downcast&lt;&gt;() for CSSValue subclasses
+        https://bugs.webkit.org/show_bug.cgi?id=137381
+
+        Reviewed by Benjamin Poulain.
+
+        Use is&lt;&gt;() / downcast&lt;&gt;() for CSSValue subclasses.
+
+        No new tests, no behavior change.
+
+        * css/CSSAspectRatioValue.h:
+        * css/CSSBorderImageSliceValue.h:
+        * css/CSSCalculationValue.cpp:
+        (WebCore::CSSCalcExpressionNodeParser::parseValue):
+        * css/CSSCalculationValue.h:
+        * css/CSSCanvasValue.h:
+        * css/CSSComputedStyleDeclaration.cpp:
+        (WebCore::getBorderRadiusShorthandValue):
+        (WebCore::ComputedStyleExtractor::propertyMatches):
+        * css/CSSCrossfadeValue.cpp:
+        (WebCore::subimageKnownToBeOpaque):
+        * css/CSSCrossfadeValue.h:
+        * css/CSSCursorImageValue.cpp:
+        (WebCore::CSSCursorImageValue::~CSSCursorImageValue):
+        (WebCore::CSSCursorImageValue::updateIfSVGCursorIsUsed):
+        (WebCore::CSSCursorImageValue::cachedImage):
+        (WebCore::CSSCursorImageValue::cachedOrPendingImage):
+        (WebCore::CSSCursorImageValue::isSVGCursor):
+        * css/CSSCursorImageValue.h:
+        * css/CSSFilterImageValue.h:
+        * css/CSSFontFaceSrcValue.h:
+        * css/CSSFontFeatureValue.h:
+        * css/CSSFontSelector.cpp:
+        (WebCore::CSSFontSelector::addFontFaceRule):
+        * css/CSSFontValue.h:
+        * css/CSSFunctionValue.h:
+        * css/CSSGradientValue.cpp:
+        (WebCore::CSSGradientValue::image):
+        (WebCore::CSSGradientValue::gradientWithStylesResolved):
+        * css/CSSGradientValue.h:
+        * css/CSSGridLineNamesValue.h:
+        * css/CSSGridTemplateAreasValue.h:
+        * css/CSSImageGeneratorValue.cpp:
+        (WebCore::CSSImageGeneratorValue::image):
+        (WebCore::CSSImageGeneratorValue::isFixedSize):
+        (WebCore::CSSImageGeneratorValue::fixedSize):
+        (WebCore::CSSImageGeneratorValue::isPending):
+        (WebCore::CSSImageGeneratorValue::knownToBeOpaque):
+        (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::addFillValue):
+        (WebCore::CSSParser::addAnimationValue):
+        (WebCore::CSSParser::parse3ValuesFillPosition):
+        (WebCore::CSSParser::parseFillPosition):
+        (WebCore::CSSParser::parseFillRepeat):
+        (WebCore::gridMissingGridPositionValue):
+        (WebCore::CSSParser::parseGridTemplateRowsAndAreas):
+        (WebCore::CSSParser::parseBasicShapeCircle):
+        (WebCore::CSSParser::parseBasicShapeEllipse):
+        (WebCore::CSSParser::parseDeprecatedGradient):
+        (WebCore::CSSParser::parseDeprecatedRadialGradient):
+        (WebCore::CSSParser::parseRadialGradient):
+        (WebCore::CSSParser::createFontFaceRule):
+        * css/CSSPrimitiveValue.h:
+        * css/CSSReflectValue.h:
+        * css/CSSShadowValue.h:
+        * css/CSSTimingFunctionValue.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::mapNinePieceImage):
+        (WebCore::CSSToStyleMap::mapNinePieceImageSlice):
+        (WebCore::CSSToStyleMap::mapNinePieceImageQuad):
+        (WebCore::CSSToStyleMap::mapNinePieceImageRepeat):
+        * css/CSSUnicodeRangeValue.h:
+        * css/CSSValue.cpp:
+        (WebCore::CSSValue::isImplicitInitialValue):
+        (WebCore::CSSValue::addSubresourceStyleURLs):
+        (WebCore::CSSValue::hasFailedOrCanceledSubresources):
+        (WebCore::CSSValue::equals):
+        (WebCore::CSSValue::cssText):
+        (WebCore::CSSValue::destroy):
+        (WebCore::CSSValue::cloneForCSSOM):
+        * css/CSSValue.h:
+        * css/CSSValueList.h:
+        (WebCore::CSSValueListInspector::CSSValueListInspector):
+        * 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::ApplyPropertyFillLayer::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::ApplyPropertyTextDecorationSkip::applyValue):
+        (WebCore::ApplyPropertyMarqueeIncrement::applyValue):
+        (WebCore::ApplyPropertyMarqueeRepetition::applyValue):
+        (WebCore::ApplyPropertyMarqueeSpeed::applyValue):
+        (WebCore::ApplyPropertyTextUnderlinePosition::applyValue):
+        (WebCore::ApplyPropertyLineHeight::applyValue):
+        (WebCore::ApplyPropertyLineHeightForIOSTextAutosizing::applyValue):
+        (WebCore::ApplyPropertyWordSpacing::applyValue):
+        (WebCore::ApplyPropertyPageSize::applyValue):
+        (WebCore::ApplyPropertyTextEmphasisStyle::applyValue):
+        (WebCore::ApplyPropertyTextEmphasisPosition::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/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/SVGCSSComputedStyleDeclaration.cpp:
+        (WebCore::strokeDashArrayToCSSValueList):
+        (WebCore::ComputedStyleExtractor::svgPropertyValue):
+        * css/SVGCSSStyleSelector.cpp:
+        (WebCore::StyleResolver::applySVGProperty):
+        * css/SourceSizeList.cpp:
+        (WebCore::computeLength):
+        * css/StyleProperties.cpp:
+        (WebCore::StyleProperties::getLayeredShorthandValue):
+        * css/StyleResolver.cpp:
+        (WebCore::extractDirectionAndWritingMode):
+        (WebCore::createGridTrackSize):
+        (WebCore::createGridTrackList):
+        (WebCore::createGridPosition):
+        (WebCore::StyleResolver::parseSnapCoordinate):
+        (WebCore::StyleResolver::parseSnapPoints):
+        (WebCore::StyleResolver::applyProperty):
+        (WebCore::StyleResolver::styleImage):
+        (WebCore::StyleResolver::generatedOrPendingFromValue):
+        (WebCore::StyleResolver::createFilterOperations):
+        * css/TransformFunctions.cpp:
+        (WebCore::transformsForValue):
+        * css/ViewportStyleResolver.cpp:
+        (WebCore::ViewportStyleResolver::getViewportArgumentValue):
+        * css/WebKitCSSFilterValue.h:
+        * css/WebKitCSSMatrix.cpp:
+        (WebCore::WebKitCSSMatrix::setMatrixValue):
+        * css/WebKitCSSTransformValue.h:
+        (WebCore::toWebKitCSSTransformValue): Deleted.
+        * editing/ApplyStyleCommand.cpp:
+        (WebCore::ApplyStyleCommand::computedFontSize):
+        * editing/EditingStyle.cpp:
+        (WebCore::identifierForStyleProperty):
+        (WebCore::HTMLElementEquivalent::valueIsPresentInStyle):
+        (WebCore::HTMLTextDecorationEquivalent::valueIsPresentInStyle):
+        (WebCore::cssValueToRGBA):
+        (WebCore::EditingStyle::extractFontSizeDelta):
+        (WebCore::EditingStyle::textDirection):
+        (WebCore::EditingStyle::prepareToApplyAt):
+        (WebCore::EditingStyle::mergeStyle):
+        (WebCore::EditingStyle::mergeStyleFromRulesForSerialization):
+        (WebCore::EditingStyle::legacyFontSize):
+        (WebCore::EditingStyle::textDirectionForSelection):
+        (WebCore::StyleChange::extractTextStyles):
+        (WebCore::diffTextDecorations):
+        (WebCore::fontWeightIsBold):
+        (WebCore::isTransparentColorValue):
+        * editing/EditorCommand.cpp:
+        (WebCore::executeToggleStyleInList):
+        * editing/cocoa/HTMLConverter.mm:
+        (stringFromCSSValue):
+        (HTMLConverterCaches::floatPropertyValueForNode):
+        (HTMLConverterCaches::colorPropertyValueForNode):
+        * editing/markup.cpp:
+        (WebCore::propertyMissingOrEqualToNone):
+        * page/PageSerializer.cpp:
+        (WebCore::PageSerializer::retrieveResourcesForProperties):
+        * page/animation/CSSPropertyAnimation.cpp:
+        (WebCore::blendFunc):
+        * rendering/RenderTextControl.cpp:
+        (WebCore::RenderTextControl::adjustInnerTextStyle):
+        * rendering/style/StylePendingImage.h:
+        (WebCore::StylePendingImage::cssImageValue):
+        (WebCore::StylePendingImage::cssCursorImageValue):
+        (WebCore::StylePendingImage::cssImageSetValue):
+        * svg/SVGColor.h:
+        * svg/SVGFontFaceElement.cpp:
+        (WebCore::SVGFontFaceElement::rebuildFontFace):
+        * svg/SVGPaint.h:
+
</ins><span class="cx"> 2014-10-03  Myles C. Maxfield  &lt;mmaxfield@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Clean up interface to Font::expansionOpportunityCount()
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSAspectRatioValueh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSAspectRatioValue.h (174299 => 174300)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSAspectRatioValue.h        2014-10-03 23:05:07 UTC (rev 174299)
+++ trunk/Source/WebCore/css/CSSAspectRatioValue.h        2014-10-03 23:17:00 UTC (rev 174300)
</span><span class="lines">@@ -60,8 +60,8 @@
</span><span class="cx">     float m_denominatorValue;
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-CSS_VALUE_TYPE_CASTS(CSSAspectRatioValue, isAspectRatioValue())
</del><ins>+} // namespace WebCore
</ins><span class="cx"> 
</span><del>-}
</del><ins>+SPECIALIZE_TYPE_TRAITS_CSS_VALUE(CSSAspectRatioValue, isAspectRatioValue())
</ins><span class="cx"> 
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSBorderImageSliceValueh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSBorderImageSliceValue.h (174299 => 174300)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSBorderImageSliceValue.h        2014-10-03 23:05:07 UTC (rev 174299)
+++ trunk/Source/WebCore/css/CSSBorderImageSliceValue.h        2014-10-03 23:17:00 UTC (rev 174300)
</span><span class="lines">@@ -56,8 +56,8 @@
</span><span class="cx">     CSSBorderImageSliceValue(PassRefPtr&lt;CSSPrimitiveValue&gt; slices, bool fill);
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-CSS_VALUE_TYPE_CASTS(CSSBorderImageSliceValue, isBorderImageSliceValue())
-
</del><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><ins>+SPECIALIZE_TYPE_TRAITS_CSS_VALUE(CSSBorderImageSliceValue, isBorderImageSliceValue())
+
</ins><span class="cx"> #endif // CSSBorderImageSliceValue_h
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSCalculationValuecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSCalculationValue.cpp (174299 => 174300)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSCalculationValue.cpp        2014-10-03 23:05:07 UTC (rev 174299)
+++ trunk/Source/WebCore/css/CSSCalculationValue.cpp        2014-10-03 23:17:00 UTC (rev 174300)
</span><span class="lines">@@ -602,11 +602,11 @@
</span><span class="cx">             return false;
</span><span class="cx"> 
</span><span class="cx">         RefPtr&lt;CSSValue&gt; value = parserValue-&gt;createCSSValue();
</span><del>-        if (!value || !value-&gt;isPrimitiveValue())
</del><ins>+        if (!is&lt;CSSPrimitiveValue&gt;(value.get()))
</ins><span class="cx">             return false;
</span><span class="cx"> 
</span><del>-        CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value.get());
-        result-&gt;value = CSSCalcPrimitiveValue::create(primitiveValue, parserValue-&gt;isInt);
</del><ins>+        CSSPrimitiveValue&amp; primitiveValue = downcast&lt;CSSPrimitiveValue&gt;(*value);
+        result-&gt;value = CSSCalcPrimitiveValue::create(&amp;primitiveValue, parserValue-&gt;isInt);
</ins><span class="cx"> 
</span><span class="cx">         ++*index;
</span><span class="cx">         return true;
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSCalculationValueh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSCalculationValue.h (174299 => 174300)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSCalculationValue.h        2014-10-03 23:05:07 UTC (rev 174299)
+++ trunk/Source/WebCore/css/CSSCalculationValue.h        2014-10-03 23:17:00 UTC (rev 174300)
</span><span class="lines">@@ -122,8 +122,8 @@
</span><span class="cx">         m_shouldClampToNonNegative ? CalculationRangeNonNegative : CalculationRangeAll);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-CSS_VALUE_TYPE_CASTS(CSSCalcValue, isCalcValue())
-
</del><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><ins>+SPECIALIZE_TYPE_TRAITS_CSS_VALUE(CSSCalcValue, isCalcValue())
+
</ins><span class="cx"> #endif // CSSCalculationValue_h
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSCanvasValueh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSCanvasValue.h (174299 => 174300)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSCanvasValue.h        2014-10-03 23:05:07 UTC (rev 174299)
+++ trunk/Source/WebCore/css/CSSCanvasValue.h        2014-10-03 23:17:00 UTC (rev 174300)
</span><span class="lines">@@ -102,8 +102,8 @@
</span><span class="cx">     HTMLCanvasElement* m_element;
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-CSS_VALUE_TYPE_CASTS(CSSCanvasValue, isCanvasValue())
-
</del><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><ins>+SPECIALIZE_TYPE_TRAITS_CSS_VALUE(CSSCanvasValue, isCanvasValue())
+
</ins><span class="cx"> #endif // CSSCanvasValue_h
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSComputedStyleDeclarationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp (174299 => 174300)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp        2014-10-03 23:05:07 UTC (rev 174299)
+++ trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp        2014-10-03 23:17:00 UTC (rev 174300)
</span><span class="lines">@@ -773,7 +773,7 @@
</span><span class="cx">     if (showVerticalBottomLeft)
</span><span class="cx">         verticalRadiiList-&gt;append(*bottomLeftRadius-&gt;item(1));
</span><span class="cx"> 
</span><del>-    if (!verticalRadiiList-&gt;equals(*toCSSValueList(list.get().item(0))))
</del><ins>+    if (!verticalRadiiList-&gt;equals(downcast&lt;CSSValueList&gt;(*list.get().item(0))))
</ins><span class="cx">         list.get().append(verticalRadiiList.releaseNonNull());
</span><span class="cx"> 
</span><span class="cx">     return list;
</span><span class="lines">@@ -3149,13 +3149,13 @@
</span><span class="cx"> 
</span><span class="cx"> bool ComputedStyleExtractor::propertyMatches(CSSPropertyID propertyID, const CSSValue* value) const
</span><span class="cx"> {
</span><del>-    if (propertyID == CSSPropertyFontSize &amp;&amp; value-&gt;isPrimitiveValue() &amp;&amp; m_node) {
</del><ins>+    if (propertyID == CSSPropertyFontSize &amp;&amp; is&lt;CSSPrimitiveValue&gt;(*value) &amp;&amp; m_node) {
</ins><span class="cx">         m_node-&gt;document().updateLayoutIgnorePendingStylesheets();
</span><span class="cx">         RenderStyle* style = m_node-&gt;computedStyle(m_pseudoElementSpecifier);
</span><span class="cx">         if (style &amp;&amp; style-&gt;fontDescription().keywordSize()) {
</span><span class="cx">             CSSValueID sizeValue = cssIdentifierForFontSizeKeyword(style-&gt;fontDescription().keywordSize());
</span><del>-            const CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
-            if (primitiveValue-&gt;isValueID() &amp;&amp; primitiveValue-&gt;getValueID() == sizeValue)
</del><ins>+            const CSSPrimitiveValue&amp; primitiveValue = downcast&lt;CSSPrimitiveValue&gt;(*value);
+            if (primitiveValue.isValueID() &amp;&amp; primitiveValue.getValueID() == sizeValue)
</ins><span class="cx">                 return true;
</span><span class="cx">         }
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSCrossfadeValuecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSCrossfadeValue.cpp (174299 => 174300)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSCrossfadeValue.cpp        2014-10-03 23:05:07 UTC (rev 174299)
+++ trunk/Source/WebCore/css/CSSCrossfadeValue.cpp        2014-10-03 23:17:00 UTC (rev 174300)
</span><span class="lines">@@ -47,11 +47,11 @@
</span><span class="cx"> 
</span><span class="cx"> static bool subimageKnownToBeOpaque(CSSValue&amp; value, const RenderElement* renderer)
</span><span class="cx"> {
</span><del>-    if (value.isImageValue())
-        return toCSSImageValue(value).knownToBeOpaque(renderer);
</del><ins>+    if (is&lt;CSSImageValue&gt;(value))
+        return downcast&lt;CSSImageValue&gt;(value).knownToBeOpaque(renderer);
</ins><span class="cx"> 
</span><del>-    if (value.isImageGeneratorValue())
-        return toCSSImageGeneratorValue(value).knownToBeOpaque(renderer);
</del><ins>+    if (is&lt;CSSImageGeneratorValue&gt;(value))
+        return downcast&lt;CSSImageGeneratorValue&gt;(value).knownToBeOpaque(renderer);
</ins><span class="cx"> 
</span><span class="cx">     ASSERT_NOT_REACHED();
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSCrossfadeValueh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSCrossfadeValue.h (174299 => 174300)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSCrossfadeValue.h        2014-10-03 23:05:07 UTC (rev 174299)
+++ trunk/Source/WebCore/css/CSSCrossfadeValue.h        2014-10-03 23:17:00 UTC (rev 174300)
</span><span class="lines">@@ -110,8 +110,8 @@
</span><span class="cx">     CrossfadeSubimageObserverProxy m_crossfadeSubimageObserver;
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-CSS_VALUE_TYPE_CASTS(CSSCrossfadeValue, isCrossfadeValue())
-
</del><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><ins>+SPECIALIZE_TYPE_TRAITS_CSS_VALUE(CSSCrossfadeValue, isCrossfadeValue())
+
</ins><span class="cx"> #endif // CSSCrossfadeValue_h
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSCursorImageValuecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSCursorImageValue.cpp (174299 => 174300)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSCursorImageValue.cpp        2014-10-03 23:05:07 UTC (rev 174299)
+++ trunk/Source/WebCore/css/CSSCursorImageValue.cpp        2014-10-03 23:17:00 UTC (rev 174300)
</span><span class="lines">@@ -81,7 +81,7 @@
</span><span class="cx">     for (; it != end; ++it) {
</span><span class="cx">         SVGElement* referencedElement = *it;
</span><span class="cx">         referencedElement-&gt;cursorImageValueRemoved();
</span><del>-        if (SVGCursorElement* cursorElement = resourceReferencedByCursorElement(toCSSImageValue(m_imageValue.get()).url(), referencedElement-&gt;document()))
</del><ins>+        if (SVGCursorElement* cursorElement = resourceReferencedByCursorElement(downcast&lt;CSSImageValue&gt;(m_imageValue.get()).url(), referencedElement-&gt;document()))
</ins><span class="cx">             cursorElement-&gt;removeClient(referencedElement);
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="lines">@@ -107,7 +107,7 @@
</span><span class="cx">     if (!isSVGCursor())
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    if (SVGCursorElement* cursorElement = resourceReferencedByCursorElement(toCSSImageValue(m_imageValue.get()).url(), element-&gt;document())) {
</del><ins>+    if (SVGCursorElement* cursorElement = resourceReferencedByCursorElement(downcast&lt;CSSImageValue&gt;(m_imageValue.get()).url(), element-&gt;document())) {
</ins><span class="cx">         // FIXME: This will override hot spot specified in CSS, which is probably incorrect.
</span><span class="cx">         SVGLengthContext lengthContext(0);
</span><span class="cx">         m_hasHotSpot = true;
</span><span class="lines">@@ -133,8 +133,8 @@
</span><span class="cx"> StyleImage* CSSCursorImageValue::cachedImage(CachedResourceLoader* loader)
</span><span class="cx"> {
</span><span class="cx"> #if ENABLE(CSS_IMAGE_SET)
</span><del>-    if (m_imageValue.get().isImageSetValue())
-        return toCSSImageSetValue(m_imageValue.get()).cachedImageSet(loader);
</del><ins>+    if (is&lt;CSSImageSetValue&gt;(m_imageValue.get()))
+        return downcast&lt;CSSImageSetValue&gt;(m_imageValue.get()).cachedImageSet(loader);
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     if (!m_accessedImage) {
</span><span class="lines">@@ -145,7 +145,7 @@
</span><span class="cx">         // we create an alternate CSSImageValue to use.
</span><span class="cx">         if (isSVGCursor() &amp;&amp; loader &amp;&amp; loader-&gt;document()) {
</span><span class="cx">             // FIXME: This will fail if the &lt;cursor&gt; element is in a shadow DOM (bug 59827)
</span><del>-            if (SVGCursorElement* cursorElement = resourceReferencedByCursorElement(toCSSImageValue(m_imageValue.get()).url(), *loader-&gt;document())) {
</del><ins>+            if (SVGCursorElement* cursorElement = resourceReferencedByCursorElement(downcast&lt;CSSImageValue&gt;(m_imageValue.get()).url(), *loader-&gt;document())) {
</ins><span class="cx">                 detachPendingImage();
</span><span class="cx">                 Ref&lt;CSSImageValue&gt; svgImageValue(CSSImageValue::create(cursorElement-&gt;href()));
</span><span class="cx">                 StyleCachedImage* cachedImage = svgImageValue-&gt;cachedImage(loader);
</span><span class="lines">@@ -154,9 +154,9 @@
</span><span class="cx">             }
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        if (m_imageValue.get().isImageValue()) {
</del><ins>+        if (is&lt;CSSImageValue&gt;(m_imageValue.get())) {
</ins><span class="cx">             detachPendingImage();
</span><del>-            m_image = toCSSImageValue(m_imageValue.get()).cachedImage(loader);
</del><ins>+            m_image = downcast&lt;CSSImageValue&gt;(m_imageValue.get()).cachedImage(loader);
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -170,8 +170,8 @@
</span><span class="cx"> {
</span><span class="cx"> #if ENABLE(CSS_IMAGE_SET)
</span><span class="cx">     // Need to delegate completely so that changes in device scale factor can be handled appropriately.
</span><del>-    if (m_imageValue.get().isImageSetValue())
-        return toCSSImageSetValue(m_imageValue.get()).cachedOrPendingImageSet(document);
</del><ins>+    if (is&lt;CSSImageSetValue&gt;(m_imageValue.get()))
+        return downcast&lt;CSSImageSetValue&gt;(m_imageValue.get()).cachedOrPendingImageSet(document);
</ins><span class="cx"> #else
</span><span class="cx">     UNUSED_PARAM(document);
</span><span class="cx"> #endif
</span><span class="lines">@@ -184,8 +184,8 @@
</span><span class="cx"> 
</span><span class="cx"> bool CSSCursorImageValue::isSVGCursor() const
</span><span class="cx"> {
</span><del>-    if (m_imageValue.get().isImageValue()) {
-        URL kurl(ParsedURLString, toCSSImageValue(m_imageValue.get()).url());
</del><ins>+    if (is&lt;CSSImageValue&gt;(m_imageValue.get())) {
+        URL kurl(ParsedURLString, downcast&lt;CSSImageValue&gt;(m_imageValue.get()).url());
</ins><span class="cx">         return kurl.hasFragmentIdentifier();
</span><span class="cx">     }
</span><span class="cx">     return false;
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSCursorImageValueh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSCursorImageValue.h (174299 => 174300)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSCursorImageValue.h        2014-10-03 23:05:07 UTC (rev 174299)
+++ trunk/Source/WebCore/css/CSSCursorImageValue.h        2014-10-03 23:17:00 UTC (rev 174300)
</span><span class="lines">@@ -78,8 +78,8 @@
</span><span class="cx">     HashSet&lt;SVGElement*&gt; m_referencedElements;
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-CSS_VALUE_TYPE_CASTS(CSSCursorImageValue, isCursorImageValue())
-
</del><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><ins>+SPECIALIZE_TYPE_TRAITS_CSS_VALUE(CSSCursorImageValue, isCursorImageValue())
+
</ins><span class="cx"> #endif // CSSCursorImageValue_h
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSFilterImageValueh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSFilterImageValue.h (174299 => 174300)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSFilterImageValue.h        2014-10-03 23:05:07 UTC (rev 174299)
+++ trunk/Source/WebCore/css/CSSFilterImageValue.h        2014-10-03 23:17:00 UTC (rev 174300)
</span><span class="lines">@@ -117,8 +117,8 @@
</span><span class="cx">     FilterSubimageObserverProxy m_filterSubimageObserver;
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-CSS_VALUE_TYPE_CASTS(CSSFilterImageValue, isFilterImageValue())
-
</del><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><ins>+SPECIALIZE_TYPE_TRAITS_CSS_VALUE(CSSFilterImageValue, isFilterImageValue())
+
</ins><span class="cx"> #endif // CSSFilterImageValue_h
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSFontFaceSrcValueh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSFontFaceSrcValue.h (174299 => 174300)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSFontFaceSrcValue.h        2014-10-03 23:05:07 UTC (rev 174299)
+++ trunk/Source/WebCore/css/CSSFontFaceSrcValue.h        2014-10-03 23:17:00 UTC (rev 174300)
</span><span class="lines">@@ -95,8 +95,8 @@
</span><span class="cx"> #endif
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-CSS_VALUE_TYPE_CASTS(CSSFontFaceSrcValue, isFontFaceSrcValue())
</del><ins>+} // namespace WebCore
</ins><span class="cx"> 
</span><del>-}
</del><ins>+SPECIALIZE_TYPE_TRAITS_CSS_VALUE(CSSFontFaceSrcValue, isFontFaceSrcValue())
</ins><span class="cx"> 
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSFontFeatureValueh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSFontFeatureValue.h (174299 => 174300)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSFontFeatureValue.h        2014-10-03 23:05:07 UTC (rev 174299)
+++ trunk/Source/WebCore/css/CSSFontFeatureValue.h        2014-10-03 23:17:00 UTC (rev 174300)
</span><span class="lines">@@ -51,8 +51,8 @@
</span><span class="cx">     const int m_value;
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-CSS_VALUE_TYPE_CASTS(CSSFontFeatureValue, isFontFeatureValue())
</del><ins>+} // namespace WebCore
</ins><span class="cx"> 
</span><del>-} // namespace
</del><ins>+SPECIALIZE_TYPE_TRAITS_CSS_VALUE(CSSFontFeatureValue, isFontFeatureValue())
</ins><span class="cx"> 
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSFontSelectorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSFontSelector.cpp (174299 => 174300)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSFontSelector.cpp        2014-10-03 23:05:07 UTC (rev 174299)
+++ trunk/Source/WebCore/css/CSSFontSelector.cpp        2014-10-03 23:17:00 UTC (rev 174300)
</span><span class="lines">@@ -91,26 +91,26 @@
</span><span class="cx">     RefPtr&lt;CSSValue&gt; fontFamily = style.getPropertyCSSValue(CSSPropertyFontFamily);
</span><span class="cx">     RefPtr&lt;CSSValue&gt; src = style.getPropertyCSSValue(CSSPropertySrc);
</span><span class="cx">     RefPtr&lt;CSSValue&gt; unicodeRange = style.getPropertyCSSValue(CSSPropertyUnicodeRange);
</span><del>-    if (!fontFamily || !src || !fontFamily-&gt;isValueList() || !src-&gt;isValueList() || (unicodeRange &amp;&amp; !unicodeRange-&gt;isValueList()))
</del><ins>+    if (!is&lt;CSSValueList&gt;(fontFamily.get()) || !is&lt;CSSValueList&gt;(src.get()) || (unicodeRange &amp;&amp; !is&lt;CSSValueList&gt;(*unicodeRange)))
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    CSSValueList* familyList = toCSSValueList(fontFamily.get());
-    if (!familyList-&gt;length())
</del><ins>+    CSSValueList&amp; familyList = downcast&lt;CSSValueList&gt;(*fontFamily);
+    if (!familyList.length())
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    CSSValueList* srcList = toCSSValueList(src.get());
-    if (!srcList-&gt;length())
</del><ins>+    CSSValueList&amp; srcList = downcast&lt;CSSValueList&gt;(*src);
+    if (!srcList.length())
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    CSSValueList* rangeList = toCSSValueList(unicodeRange.get());
</del><ins>+    CSSValueList* rangeList = downcast&lt;CSSValueList&gt;(unicodeRange.get());
</ins><span class="cx"> 
</span><span class="cx">     unsigned traitsMask = 0;
</span><span class="cx"> 
</span><span class="cx">     if (RefPtr&lt;CSSValue&gt; fontStyle = style.getPropertyCSSValue(CSSPropertyFontStyle)) {
</span><del>-        if (!fontStyle-&gt;isPrimitiveValue())
</del><ins>+        if (!is&lt;CSSPrimitiveValue&gt;(*fontStyle))
</ins><span class="cx">             return;
</span><span class="cx"> 
</span><del>-        switch (toCSSPrimitiveValue(fontStyle.get())-&gt;getValueID()) {
</del><ins>+        switch (downcast&lt;CSSPrimitiveValue&gt;(*fontStyle).getValueID()) {
</ins><span class="cx">         case CSSValueNormal:
</span><span class="cx">             traitsMask |= FontStyleNormalMask;
</span><span class="cx">             break;
</span><span class="lines">@@ -125,10 +125,10 @@
</span><span class="cx">         traitsMask |= FontStyleNormalMask;
</span><span class="cx"> 
</span><span class="cx">     if (RefPtr&lt;CSSValue&gt; fontWeight = style.getPropertyCSSValue(CSSPropertyFontWeight)) {
</span><del>-        if (!fontWeight-&gt;isPrimitiveValue())
</del><ins>+        if (!is&lt;CSSPrimitiveValue&gt;(*fontWeight))
</ins><span class="cx">             return;
</span><span class="cx"> 
</span><del>-        switch (toCSSPrimitiveValue(fontWeight.get())-&gt;getValueID()) {
</del><ins>+        switch (downcast&lt;CSSPrimitiveValue&gt;(*fontWeight).getValueID()) {
</ins><span class="cx">         case CSSValueBold:
</span><span class="cx">         case CSSValue700:
</span><span class="cx">             traitsMask |= FontWeight700Mask;
</span><span class="lines">@@ -170,16 +170,16 @@
</span><span class="cx">             RefPtr&lt;CSSValueList&gt; list = CSSValueList::createCommaSeparated();
</span><span class="cx">             list-&gt;append(fontVariant.releaseNonNull());
</span><span class="cx">             fontVariant = list.releaseNonNull();
</span><del>-        } else if (!fontVariant-&gt;isValueList())
</del><ins>+        } else if (!is&lt;CSSValueList&gt;(*fontVariant))
</ins><span class="cx">             return;
</span><span class="cx"> 
</span><del>-        CSSValueList* variantList = toCSSValueList(fontVariant.get());
-        unsigned numVariants = variantList-&gt;length();
</del><ins>+        CSSValueList&amp; variantList = downcast&lt;CSSValueList&gt;(*fontVariant);
+        unsigned numVariants = variantList.length();
</ins><span class="cx">         if (!numVariants)
</span><span class="cx">             return;
</span><span class="cx"> 
</span><span class="cx">         for (unsigned i = 0; i &lt; numVariants; ++i) {
</span><del>-            switch (toCSSPrimitiveValue(variantList-&gt;itemWithoutBoundsCheck(i))-&gt;getValueID()) {
</del><ins>+            switch (downcast&lt;CSSPrimitiveValue&gt;(variantList.itemWithoutBoundsCheck(i))-&gt;getValueID()) {
</ins><span class="cx">                 case CSSValueNormal:
</span><span class="cx">                     traitsMask |= FontVariantNormalMask;
</span><span class="cx">                     break;
</span><span class="lines">@@ -196,25 +196,25 @@
</span><span class="cx">     // Each item in the src property's list is a single CSSFontFaceSource. Put them all into a CSSFontFace.
</span><span class="cx">     RefPtr&lt;CSSFontFace&gt; fontFace;
</span><span class="cx"> 
</span><del>-    int srcLength = srcList-&gt;length();
</del><ins>+    int srcLength = srcList.length();
</ins><span class="cx"> 
</span><span class="cx">     bool foundSVGFont = false;
</span><span class="cx"> 
</span><span class="cx">     for (int i = 0; i &lt; srcLength; i++) {
</span><span class="cx">         // An item in the list either specifies a string (local font name) or a URL (remote font to download).
</span><del>-        CSSFontFaceSrcValue* item = toCSSFontFaceSrcValue(srcList-&gt;itemWithoutBoundsCheck(i));
</del><ins>+        CSSFontFaceSrcValue&amp; item = downcast&lt;CSSFontFaceSrcValue&gt;(*srcList.itemWithoutBoundsCheck(i));
</ins><span class="cx">         std::unique_ptr&lt;CSSFontFaceSource&gt; source;
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(SVG_FONTS)
</span><del>-        foundSVGFont = item-&gt;isSVGFontFaceSrc() || item-&gt;svgFontFaceElement();
</del><ins>+        foundSVGFont = item.isSVGFontFaceSrc() || item.svgFontFaceElement();
</ins><span class="cx"> #endif
</span><del>-        if (!item-&gt;isLocal()) {
</del><ins>+        if (!item.isLocal()) {
</ins><span class="cx">             Settings* settings = m_document ? m_document-&gt;frame() ? &amp;m_document-&gt;frame()-&gt;settings() : 0 : 0;
</span><span class="cx">             bool allowDownloading = foundSVGFont || (settings &amp;&amp; settings-&gt;downloadableBinaryFontsEnabled());
</span><del>-            if (allowDownloading &amp;&amp; item-&gt;isSupportedFormat() &amp;&amp; m_document) {
-                CachedFont* cachedFont = item-&gt;cachedFont(m_document);
</del><ins>+            if (allowDownloading &amp;&amp; item.isSupportedFormat() &amp;&amp; m_document) {
+                CachedFont* cachedFont = item.cachedFont(m_document);
</ins><span class="cx">                 if (cachedFont) {
</span><del>-                    source = std::make_unique&lt;CSSFontFaceSource&gt;(item-&gt;resource(), cachedFont);
</del><ins>+                    source = std::make_unique&lt;CSSFontFaceSource&gt;(item.resource(), cachedFont);
</ins><span class="cx"> #if ENABLE(SVG_FONTS)
</span><span class="cx">                     if (foundSVGFont)
</span><span class="cx">                         source-&gt;setHasExternalSVGFont(true);
</span><span class="lines">@@ -222,7 +222,7 @@
</span><span class="cx">                 }
</span><span class="cx">             }
</span><span class="cx">         } else {
</span><del>-            source = std::make_unique&lt;CSSFontFaceSource&gt;(item-&gt;resource());
</del><ins>+            source = std::make_unique&lt;CSSFontFaceSource&gt;(item.resource());
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         if (!fontFace) {
</span><span class="lines">@@ -237,7 +237,7 @@
</span><span class="cx"> 
</span><span class="cx">         if (source) {
</span><span class="cx"> #if ENABLE(SVG_FONTS)
</span><del>-            source-&gt;setSVGFontFaceElement(item-&gt;svgFontFaceElement());
</del><ins>+            source-&gt;setSVGFontFaceElement(item.svgFontFaceElement());
</ins><span class="cx"> #endif
</span><span class="cx">             fontFace-&gt;addSource(WTF::move(source));
</span><span class="cx">         }
</span><span class="lines">@@ -251,15 +251,15 @@
</span><span class="cx">     if (rangeList) {
</span><span class="cx">         unsigned numRanges = rangeList-&gt;length();
</span><span class="cx">         for (unsigned i = 0; i &lt; numRanges; i++) {
</span><del>-            CSSUnicodeRangeValue* range = toCSSUnicodeRangeValue(rangeList-&gt;itemWithoutBoundsCheck(i));
-            fontFace-&gt;addRange(range-&gt;from(), range-&gt;to());
</del><ins>+            CSSUnicodeRangeValue&amp; range = downcast&lt;CSSUnicodeRangeValue&gt;(*rangeList-&gt;itemWithoutBoundsCheck(i));
+            fontFace-&gt;addRange(range.from(), range.to());
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     // Hash under every single family name.
</span><del>-    int familyLength = familyList-&gt;length();
</del><ins>+    int familyLength = familyList.length();
</ins><span class="cx">     for (int i = 0; i &lt; familyLength; i++) {
</span><del>-        CSSPrimitiveValue* item = toCSSPrimitiveValue(familyList-&gt;itemWithoutBoundsCheck(i));
</del><ins>+        CSSPrimitiveValue* item = downcast&lt;CSSPrimitiveValue&gt;(familyList.itemWithoutBoundsCheck(i));
</ins><span class="cx">         String familyName;
</span><span class="cx">         if (item-&gt;isString()) {
</span><span class="cx">             familyName = item-&gt;getStringValue();
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSFontValueh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSFontValue.h (174299 => 174300)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSFontValue.h        2014-10-03 23:05:07 UTC (rev 174299)
+++ trunk/Source/WebCore/css/CSSFontValue.h        2014-10-03 23:17:00 UTC (rev 174300)
</span><span class="lines">@@ -55,8 +55,8 @@
</span><span class="cx">     }
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-CSS_VALUE_TYPE_CASTS(CSSFontValue, isFontValue())
</del><ins>+} // namespace WebCore
</ins><span class="cx"> 
</span><del>-} // namespace
</del><ins>+SPECIALIZE_TYPE_TRAITS_CSS_VALUE(CSSFontValue, isFontValue())
</ins><span class="cx"> 
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSFunctionValueh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSFunctionValue.h (174299 => 174300)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSFunctionValue.h        2014-10-03 23:05:07 UTC (rev 174299)
+++ trunk/Source/WebCore/css/CSSFunctionValue.h        2014-10-03 23:17:00 UTC (rev 174300)
</span><span class="lines">@@ -59,8 +59,9 @@
</span><span class="cx">     RefPtr&lt;CSSValueList&gt; m_args;
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-CSS_VALUE_TYPE_CASTS(CSSFunctionValue, isFunctionValue())
</del><ins>+} // namespace WebCore
</ins><span class="cx"> 
</span><del>-}
</del><ins>+SPECIALIZE_TYPE_TRAITS_CSS_VALUE(CSSFunctionValue, isFunctionValue())
+
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSGradientValuecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSGradientValue.cpp (174299 => 174300)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSGradientValue.cpp        2014-10-03 23:05:07 UTC (rev 174299)
+++ trunk/Source/WebCore/css/CSSGradientValue.cpp        2014-10-03 23:17:00 UTC (rev 174300)
</span><span class="lines">@@ -46,12 +46,12 @@
</span><span class="cx"> PassRefPtr&lt;Image&gt; CSSGradientValue::image(RenderElement* renderer, const FloatSize&amp; size)
</span><span class="cx"> {
</span><span class="cx">     if (size.isEmpty())
</span><del>-        return 0;
</del><ins>+        return nullptr;
</ins><span class="cx"> 
</span><span class="cx">     bool cacheable = isCacheable();
</span><span class="cx">     if (cacheable) {
</span><span class="cx">         if (!clients().contains(renderer))
</span><del>-            return 0;
</del><ins>+            return nullptr;
</ins><span class="cx"> 
</span><span class="cx">         Image* result = cachedImageForSize(size);
</span><span class="cx">         if (result)
</span><span class="lines">@@ -60,10 +60,10 @@
</span><span class="cx"> 
</span><span class="cx">     RefPtr&lt;Gradient&gt; gradient;
</span><span class="cx"> 
</span><del>-    if (isLinearGradientValue())
-        gradient = toCSSLinearGradientValue(this)-&gt;createGradient(*renderer, size);
</del><ins>+    if (is&lt;CSSLinearGradientValue&gt;(*this))
+        gradient = downcast&lt;CSSLinearGradientValue&gt;(*this).createGradient(*renderer, size);
</ins><span class="cx">     else
</span><del>-        gradient = toCSSRadialGradientValue(this)-&gt;createGradient(*renderer, size);
</del><ins>+        gradient = downcast&lt;CSSRadialGradientValue&gt;(*this).createGradient(*renderer, size);
</ins><span class="cx"> 
</span><span class="cx">     RefPtr&lt;GradientImage&gt; newImage = GradientImage::create(gradient, size);
</span><span class="cx">     if (cacheable)
</span><span class="lines">@@ -118,13 +118,13 @@
</span><span class="cx">     RefPtr&lt;CSSGradientValue&gt; result;
</span><span class="cx">     if (!derived)
</span><span class="cx">         result = this;
</span><del>-    else if (isLinearGradientValue())
-        result = toCSSLinearGradientValue(this)-&gt;clone();
-    else if (isRadialGradientValue())
-        result = toCSSRadialGradientValue(this)-&gt;clone();
</del><ins>+    else if (is&lt;CSSLinearGradientValue&gt;(*this))
+        result = downcast&lt;CSSLinearGradientValue&gt;(*this).clone();
+    else if (is&lt;CSSRadialGradientValue&gt;(*this))
+        result = downcast&lt;CSSRadialGradientValue&gt;(*this).clone();
</ins><span class="cx">     else {
</span><span class="cx">         ASSERT_NOT_REACHED();
</span><del>-        return 0;
</del><ins>+        return nullptr;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     for (auto&amp; stop : result-&gt;m_stops) {
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSGradientValueh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSGradientValue.h (174299 => 174300)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSGradientValue.h        2014-10-03 23:05:07 UTC (rev 174299)
+++ trunk/Source/WebCore/css/CSSGradientValue.h        2014-10-03 23:17:00 UTC (rev 174300)
</span><span class="lines">@@ -131,8 +131,6 @@
</span><span class="cx">     bool m_repeating;
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-CSS_VALUE_TYPE_CASTS(CSSGradientValue, isGradientValue())
-
</del><span class="cx"> class CSSLinearGradientValue : public CSSGradientValue {
</span><span class="cx"> public:
</span><span class="cx"> 
</span><span class="lines">@@ -170,8 +168,6 @@
</span><span class="cx">     RefPtr&lt;CSSPrimitiveValue&gt; m_angle; // may be null.
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-CSS_VALUE_TYPE_CASTS(CSSLinearGradientValue, isLinearGradientValue())
-
</del><span class="cx"> class CSSRadialGradientValue : public CSSGradientValue {
</span><span class="cx"> public:
</span><span class="cx">     static PassRef&lt;CSSRadialGradientValue&gt; create(CSSGradientRepeat repeat, CSSGradientType gradientType = CSSRadialGradient)
</span><span class="lines">@@ -233,8 +229,10 @@
</span><span class="cx">     RefPtr&lt;CSSPrimitiveValue&gt; m_endVerticalSize;
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-CSS_VALUE_TYPE_CASTS(CSSRadialGradientValue, isRadialGradientValue())
-
</del><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><ins>+SPECIALIZE_TYPE_TRAITS_CSS_VALUE(CSSGradientValue, isGradientValue())
+SPECIALIZE_TYPE_TRAITS_CSS_VALUE(CSSLinearGradientValue, isLinearGradientValue())
+SPECIALIZE_TYPE_TRAITS_CSS_VALUE(CSSRadialGradientValue, isRadialGradientValue())
+
</ins><span class="cx"> #endif // CSSGradientValue_h
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSGridLineNamesValueh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSGridLineNamesValue.h (174299 => 174300)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSGridLineNamesValue.h        2014-10-03 23:05:07 UTC (rev 174299)
+++ trunk/Source/WebCore/css/CSSGridLineNamesValue.h        2014-10-03 23:17:00 UTC (rev 174300)
</span><span class="lines">@@ -52,9 +52,9 @@
</span><span class="cx">     CSSGridLineNamesValue();
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-CSS_VALUE_TYPE_CASTS(CSSGridLineNamesValue, isGridLineNamesValue());
</del><ins>+} // namespace WebCore
</ins><span class="cx"> 
</span><del>-}
</del><ins>+SPECIALIZE_TYPE_TRAITS_CSS_VALUE(CSSGridLineNamesValue, isGridLineNamesValue());
</ins><span class="cx"> 
</span><del>-#endif
-#endif
</del><ins>+#endif // ENABLE(CSS_GRID_LAYOUT)
+#endif // CSSGridLineNamesValue_h
</ins></span></pre></div>
<a id="trunkSourceWebCorecssCSSGridTemplateAreasValueh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSGridTemplateAreasValue.h (174299 => 174300)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSGridTemplateAreasValue.h        2014-10-03 23:05:07 UTC (rev 174299)
+++ trunk/Source/WebCore/css/CSSGridTemplateAreasValue.h        2014-10-03 23:17:00 UTC (rev 174300)
</span><span class="lines">@@ -62,10 +62,10 @@
</span><span class="cx">     size_t m_columnCount;
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-CSS_VALUE_TYPE_CASTS(CSSGridTemplateAreasValue, isGridTemplateAreasValue())
-
</del><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><ins>+SPECIALIZE_TYPE_TRAITS_CSS_VALUE(CSSGridTemplateAreasValue, isGridTemplateAreasValue())
+
</ins><span class="cx"> #endif /* ENABLE(CSS_GRID_LAYOUT) */
</span><span class="cx"> 
</span><span class="cx"> #endif // CSSGridTemplateAreasValue_h
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSImageGeneratorValuecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSImageGeneratorValue.cpp (174299 => 174300)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSImageGeneratorValue.cpp        2014-10-03 23:05:07 UTC (rev 174299)
+++ trunk/Source/WebCore/css/CSSImageGeneratorValue.cpp        2014-10-03 23:17:00 UTC (rev 174300)
</span><span class="lines">@@ -109,15 +109,15 @@
</span><span class="cx"> {
</span><span class="cx">     switch (classType()) {
</span><span class="cx">     case CanvasClass:
</span><del>-        return toCSSCanvasValue(this)-&gt;image(renderer, size);
</del><ins>+        return downcast&lt;CSSCanvasValue&gt;(*this).image(renderer, size);
</ins><span class="cx">     case CrossfadeClass:
</span><del>-        return toCSSCrossfadeValue(this)-&gt;image(renderer, size);
</del><ins>+        return downcast&lt;CSSCrossfadeValue&gt;(*this).image(renderer, size);
</ins><span class="cx">     case FilterImageClass:
</span><del>-        return toCSSFilterImageValue(this)-&gt;image(renderer, size);
</del><ins>+        return downcast&lt;CSSFilterImageValue&gt;(*this).image(renderer, size);
</ins><span class="cx">     case LinearGradientClass:
</span><del>-        return toCSSLinearGradientValue(this)-&gt;image(renderer, size);
</del><ins>+        return downcast&lt;CSSLinearGradientValue&gt;(*this).image(renderer, size);
</ins><span class="cx">     case RadialGradientClass:
</span><del>-        return toCSSRadialGradientValue(this)-&gt;image(renderer, size);
</del><ins>+        return downcast&lt;CSSRadialGradientValue&gt;(*this).image(renderer, size);
</ins><span class="cx">     default:
</span><span class="cx">         ASSERT_NOT_REACHED();
</span><span class="cx">     }
</span><span class="lines">@@ -128,15 +128,15 @@
</span><span class="cx"> {
</span><span class="cx">     switch (classType()) {
</span><span class="cx">     case CanvasClass:
</span><del>-        return toCSSCanvasValue(this)-&gt;isFixedSize();
</del><ins>+        return downcast&lt;CSSCanvasValue&gt;(*this).isFixedSize();
</ins><span class="cx">     case CrossfadeClass:
</span><del>-        return toCSSCrossfadeValue(this)-&gt;isFixedSize();
</del><ins>+        return downcast&lt;CSSCrossfadeValue&gt;(*this).isFixedSize();
</ins><span class="cx">     case FilterImageClass:
</span><del>-        return toCSSFilterImageValue(this)-&gt;isFixedSize();
</del><ins>+        return downcast&lt;CSSFilterImageValue&gt;(*this).isFixedSize();
</ins><span class="cx">     case LinearGradientClass:
</span><del>-        return toCSSLinearGradientValue(this)-&gt;isFixedSize();
</del><ins>+        return downcast&lt;CSSLinearGradientValue&gt;(*this).isFixedSize();
</ins><span class="cx">     case RadialGradientClass:
</span><del>-        return toCSSRadialGradientValue(this)-&gt;isFixedSize();
</del><ins>+        return downcast&lt;CSSRadialGradientValue&gt;(*this).isFixedSize();
</ins><span class="cx">     default:
</span><span class="cx">         ASSERT_NOT_REACHED();
</span><span class="cx">     }
</span><span class="lines">@@ -147,15 +147,15 @@
</span><span class="cx"> {
</span><span class="cx">     switch (classType()) {
</span><span class="cx">     case CanvasClass:
</span><del>-        return toCSSCanvasValue(this)-&gt;fixedSize(renderer);
</del><ins>+        return downcast&lt;CSSCanvasValue&gt;(*this).fixedSize(renderer);
</ins><span class="cx">     case CrossfadeClass:
</span><del>-        return toCSSCrossfadeValue(this)-&gt;fixedSize(renderer);
</del><ins>+        return downcast&lt;CSSCrossfadeValue&gt;(*this).fixedSize(renderer);
</ins><span class="cx">     case FilterImageClass:
</span><del>-        return toCSSFilterImageValue(this)-&gt;fixedSize(renderer);
</del><ins>+        return downcast&lt;CSSFilterImageValue&gt;(*this).fixedSize(renderer);
</ins><span class="cx">     case LinearGradientClass:
</span><del>-        return toCSSLinearGradientValue(this)-&gt;fixedSize(renderer);
</del><ins>+        return downcast&lt;CSSLinearGradientValue&gt;(*this).fixedSize(renderer);
</ins><span class="cx">     case RadialGradientClass:
</span><del>-        return toCSSRadialGradientValue(this)-&gt;fixedSize(renderer);
</del><ins>+        return downcast&lt;CSSRadialGradientValue&gt;(*this).fixedSize(renderer);
</ins><span class="cx">     default:
</span><span class="cx">         ASSERT_NOT_REACHED();
</span><span class="cx">     }
</span><span class="lines">@@ -166,15 +166,15 @@
</span><span class="cx"> {
</span><span class="cx">     switch (classType()) {
</span><span class="cx">     case CrossfadeClass:
</span><del>-        return toCSSCrossfadeValue(this)-&gt;isPending();
</del><ins>+        return downcast&lt;CSSCrossfadeValue&gt;(*this).isPending();
</ins><span class="cx">     case CanvasClass:
</span><del>-        return toCSSCanvasValue(this)-&gt;isPending();
</del><ins>+        return downcast&lt;CSSCanvasValue&gt;(*this).isPending();
</ins><span class="cx">     case FilterImageClass:
</span><del>-        return toCSSFilterImageValue(this)-&gt;isPending();
</del><ins>+        return downcast&lt;CSSFilterImageValue&gt;(*this).isPending();
</ins><span class="cx">     case LinearGradientClass:
</span><del>-        return toCSSLinearGradientValue(this)-&gt;isPending();
</del><ins>+        return downcast&lt;CSSLinearGradientValue&gt;(*this).isPending();
</ins><span class="cx">     case RadialGradientClass:
</span><del>-        return toCSSRadialGradientValue(this)-&gt;isPending();
</del><ins>+        return downcast&lt;CSSRadialGradientValue&gt;(*this).isPending();
</ins><span class="cx">     default:
</span><span class="cx">         ASSERT_NOT_REACHED();
</span><span class="cx">     }
</span><span class="lines">@@ -185,15 +185,15 @@
</span><span class="cx"> {
</span><span class="cx">     switch (classType()) {
</span><span class="cx">     case CrossfadeClass:
</span><del>-        return toCSSCrossfadeValue(this)-&gt;knownToBeOpaque(renderer);
</del><ins>+        return downcast&lt;CSSCrossfadeValue&gt;(*this).knownToBeOpaque(renderer);
</ins><span class="cx">     case CanvasClass:
</span><span class="cx">         return false;
</span><span class="cx">     case FilterImageClass:
</span><del>-        return toCSSFilterImageValue(this)-&gt;knownToBeOpaque(renderer);
</del><ins>+        return downcast&lt;CSSFilterImageValue&gt;(*this).knownToBeOpaque(renderer);
</ins><span class="cx">     case LinearGradientClass:
</span><del>-        return toCSSLinearGradientValue(this)-&gt;knownToBeOpaque(renderer);
</del><ins>+        return downcast&lt;CSSLinearGradientValue&gt;(*this).knownToBeOpaque(renderer);
</ins><span class="cx">     case RadialGradientClass:
</span><del>-        return toCSSRadialGradientValue(this)-&gt;knownToBeOpaque(renderer);
</del><ins>+        return downcast&lt;CSSRadialGradientValue&gt;(*this).knownToBeOpaque(renderer);
</ins><span class="cx">     default:
</span><span class="cx">         ASSERT_NOT_REACHED();
</span><span class="cx">     }
</span><span class="lines">@@ -204,19 +204,19 @@
</span><span class="cx"> {
</span><span class="cx">     switch (classType()) {
</span><span class="cx">     case CrossfadeClass:
</span><del>-        toCSSCrossfadeValue(this)-&gt;loadSubimages(cachedResourceLoader);
</del><ins>+        downcast&lt;CSSCrossfadeValue&gt;(*this).loadSubimages(cachedResourceLoader);
</ins><span class="cx">         break;
</span><span class="cx">     case CanvasClass:
</span><del>-        toCSSCanvasValue(this)-&gt;loadSubimages(cachedResourceLoader);
</del><ins>+        downcast&lt;CSSCanvasValue&gt;(*this).loadSubimages(cachedResourceLoader);
</ins><span class="cx">         break;
</span><span class="cx">     case FilterImageClass:
</span><del>-        toCSSFilterImageValue(this)-&gt;loadSubimages(cachedResourceLoader);
</del><ins>+        downcast&lt;CSSFilterImageValue&gt;(*this).loadSubimages(cachedResourceLoader);
</ins><span class="cx">         break;
</span><span class="cx">     case LinearGradientClass:
</span><del>-        toCSSLinearGradientValue(this)-&gt;loadSubimages(cachedResourceLoader);
</del><ins>+        downcast&lt;CSSLinearGradientValue&gt;(*this).loadSubimages(cachedResourceLoader);
</ins><span class="cx">         break;
</span><span class="cx">     case RadialGradientClass:
</span><del>-        toCSSRadialGradientValue(this)-&gt;loadSubimages(cachedResourceLoader);
</del><ins>+        downcast&lt;CSSRadialGradientValue&gt;(*this).loadSubimages(cachedResourceLoader);
</ins><span class="cx">         break;
</span><span class="cx">     default:
</span><span class="cx">         ASSERT_NOT_REACHED();
</span><span class="lines">@@ -225,13 +225,13 @@
</span><span class="cx"> 
</span><span class="cx"> bool CSSImageGeneratorValue::subimageIsPending(CSSValue* value)
</span><span class="cx"> {
</span><del>-    if (value-&gt;isImageValue())
-        return toCSSImageValue(value)-&gt;cachedOrPendingImage()-&gt;isPendingImage();
</del><ins>+    if (is&lt;CSSImageValue&gt;(*value))
+        return downcast&lt;CSSImageValue&gt;(*value).cachedOrPendingImage()-&gt;isPendingImage();
</ins><span class="cx">     
</span><del>-    if (value-&gt;isImageGeneratorValue())
-        return toCSSImageGeneratorValue(value)-&gt;isPending();
</del><ins>+    if (is&lt;CSSImageGeneratorValue&gt;(*value))
+        return downcast&lt;CSSImageGeneratorValue&gt;(*value).isPending();
</ins><span class="cx"> 
</span><del>-    if (value-&gt;isPrimitiveValue() &amp;&amp; toCSSPrimitiveValue(value)-&gt;getValueID() == CSSValueNone)
</del><ins>+    if (is&lt;CSSPrimitiveValue&gt;(*value) &amp;&amp; downcast&lt;CSSPrimitiveValue&gt;(*value).getValueID() == CSSValueNone)
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     ASSERT_NOT_REACHED();
</span><span class="lines">@@ -244,21 +244,21 @@
</span><span class="cx">     if (!value)
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><del>-    if (value-&gt;isImageValue()) {
-        StyleCachedImage* styleCachedImage = toCSSImageValue(value)-&gt;cachedImage(cachedResourceLoader);
</del><ins>+    if (is&lt;CSSImageValue&gt;(*value)) {
+        StyleCachedImage* styleCachedImage = downcast&lt;CSSImageValue&gt;(*value).cachedImage(cachedResourceLoader);
</ins><span class="cx">         if (!styleCachedImage)
</span><span class="cx">             return nullptr;
</span><span class="cx"> 
</span><span class="cx">         return styleCachedImage-&gt;cachedImage();
</span><span class="cx">     }
</span><span class="cx">     
</span><del>-    if (value-&gt;isImageGeneratorValue()) {
-        toCSSImageGeneratorValue(value)-&gt;loadSubimages(cachedResourceLoader);
</del><ins>+    if (is&lt;CSSImageGeneratorValue&gt;(*value)) {
+        downcast&lt;CSSImageGeneratorValue&gt;(*value).loadSubimages(cachedResourceLoader);
</ins><span class="cx">         // FIXME: Handle CSSImageGeneratorValue (and thus cross-fades with gradients and canvas).
</span><span class="cx">         return nullptr;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (value-&gt;isPrimitiveValue() &amp;&amp; toCSSPrimitiveValue(value)-&gt;getValueID() == CSSValueNone)
</del><ins>+    if (is&lt;CSSPrimitiveValue&gt;(*value) &amp;&amp; downcast&lt;CSSPrimitiveValue&gt;(*value).getValueID() == CSSValueNone)
</ins><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><span class="cx">     ASSERT_NOT_REACHED();
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSImageGeneratorValueh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSImageGeneratorValue.h (174299 => 174300)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSImageGeneratorValue.h        2014-10-03 23:05:07 UTC (rev 174299)
+++ trunk/Source/WebCore/css/CSSImageGeneratorValue.h        2014-10-03 23:17:00 UTC (rev 174300)
</span><span class="lines">@@ -92,8 +92,8 @@
</span><span class="cx">     HashMap&lt;FloatSize, std::unique_ptr&lt;CachedGeneratedImage&gt;&gt; m_images;
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-CSS_VALUE_TYPE_CASTS(CSSImageGeneratorValue, isImageGeneratorValue())
-
</del><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><ins>+SPECIALIZE_TYPE_TRAITS_CSS_VALUE(CSSImageGeneratorValue, isImageGeneratorValue())
+
</ins><span class="cx"> #endif // CSSImageGeneratorValue_h
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSImageSetValuecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSImageSetValue.cpp (174299 => 174300)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSImageSetValue.cpp        2014-10-03 23:05:07 UTC (rev 174299)
+++ trunk/Source/WebCore/css/CSSImageSetValue.cpp        2014-10-03 23:17:00 UTC (rev 174300)
</span><span class="lines">@@ -70,13 +70,12 @@
</span><span class="cx">     size_t i = 0;
</span><span class="cx">     while (i &lt; length) {
</span><span class="cx">         CSSValue* imageValue = item(i);
</span><del>-        String imageURL = toCSSImageValue(imageValue)-&gt;url();
</del><ins>+        String imageURL = downcast&lt;CSSImageValue&gt;(*imageValue).url();
</ins><span class="cx"> 
</span><span class="cx">         ++i;
</span><span class="cx">         ASSERT_WITH_SECURITY_IMPLICATION(i &lt; length);
</span><span class="cx">         CSSValue* scaleFactorValue = item(i);
</span><del>-        ASSERT_WITH_SECURITY_IMPLICATION(scaleFactorValue-&gt;isPrimitiveValue());
-        float scaleFactor = toCSSPrimitiveValue(scaleFactorValue)-&gt;getFloatValue();
</del><ins>+        float scaleFactor = downcast&lt;CSSPrimitiveValue&gt;(*scaleFactorValue).getFloatValue();
</ins><span class="cx"> 
</span><span class="cx">         ImageWithScale image;
</span><span class="cx">         image.imageURL = imageURL;
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSImageSetValueh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSImageSetValue.h (174299 => 174300)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSImageSetValue.h        2014-10-03 23:05:07 UTC (rev 174299)
+++ trunk/Source/WebCore/css/CSSImageSetValue.h        2014-10-03 23:17:00 UTC (rev 174300)
</span><span class="lines">@@ -87,10 +87,10 @@
</span><span class="cx">     Vector&lt;ImageWithScale&gt; m_imagesInSet;
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-CSS_VALUE_TYPE_CASTS(CSSImageSetValue, isImageSetValue())
-
</del><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><ins>+SPECIALIZE_TYPE_TRAITS_CSS_VALUE(CSSImageSetValue, isImageSetValue())
+
</ins><span class="cx"> #endif // ENABLE(CSS_IMAGE_SET)
</span><span class="cx"> 
</span><span class="cx"> #endif // CSSImageSetValue_h
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSImageValueh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSImageValue.h (174299 => 174300)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSImageValue.h        2014-10-03 23:05:07 UTC (rev 174299)
+++ trunk/Source/WebCore/css/CSSImageValue.h        2014-10-03 23:17:00 UTC (rev 174300)
</span><span class="lines">@@ -69,8 +69,8 @@
</span><span class="cx">     AtomicString m_initiatorName;
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-CSS_VALUE_TYPE_CASTS(CSSImageValue, isImageValue())
-
</del><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><ins>+SPECIALIZE_TYPE_TRAITS_CSS_VALUE(CSSImageValue, isImageValue())
+
</ins><span class="cx"> #endif // CSSImageValue_h
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSInheritedValueh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSInheritedValue.h (174299 => 174300)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSInheritedValue.h        2014-10-03 23:05:07 UTC (rev 174299)
+++ trunk/Source/WebCore/css/CSSInheritedValue.h        2014-10-03 23:17:00 UTC (rev 174300)
</span><span class="lines">@@ -44,8 +44,8 @@
</span><span class="cx">     }
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-CSS_VALUE_TYPE_CASTS(CSSInheritedValue, isInheritedValue())
-
</del><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><ins>+SPECIALIZE_TYPE_TRAITS_CSS_VALUE(CSSInheritedValue, isInheritedValue())
+
</ins><span class="cx"> #endif // CSSInheritedValue_h
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSInitialValueh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSInitialValue.h (174299 => 174300)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSInitialValue.h        2014-10-03 23:05:07 UTC (rev 174299)
+++ trunk/Source/WebCore/css/CSSInitialValue.h        2014-10-03 23:17:00 UTC (rev 174300)
</span><span class="lines">@@ -53,8 +53,8 @@
</span><span class="cx">     bool m_isImplicit;
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-CSS_VALUE_TYPE_CASTS(CSSInitialValue, isInitialValue())
-
</del><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><ins>+SPECIALIZE_TYPE_TRAITS_CSS_VALUE(CSSInitialValue, isInitialValue())
+
</ins><span class="cx"> #endif // CSSInitialValue_h
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSLineBoxContainValueh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSLineBoxContainValue.h (174299 => 174300)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSLineBoxContainValue.h        2014-10-03 23:05:07 UTC (rev 174299)
+++ trunk/Source/WebCore/css/CSSLineBoxContainValue.h        2014-10-03 23:17:00 UTC (rev 174300)
</span><span class="lines">@@ -56,8 +56,8 @@
</span><span class="cx">     LineBoxContain m_value;
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-CSS_VALUE_TYPE_CASTS(CSSLineBoxContainValue, isLineBoxContainValue())
</del><ins>+} // namespace WebCore
</ins><span class="cx"> 
</span><del>-} // namespace
</del><ins>+SPECIALIZE_TYPE_TRAITS_CSS_VALUE(CSSLineBoxContainValue, isLineBoxContainValue())
</ins><span class="cx"> 
</span><del>-#endif
</del><ins>+#endif // CSSLineBoxContainValue_h
</ins></span></pre></div>
<a id="trunkSourceWebCorecssCSSParsercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSParser.cpp (174299 => 174300)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSParser.cpp        2014-10-03 23:05:07 UTC (rev 174299)
+++ trunk/Source/WebCore/css/CSSParser.cpp        2014-10-03 23:17:00 UTC (rev 174300)
</span><span class="lines">@@ -1345,14 +1345,14 @@
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     CSSValue* value = parser.m_parsedProperties.first().value();
</span><del>-    if (!value-&gt;isPrimitiveValue())
</del><ins>+    if (!is&lt;CSSPrimitiveValue&gt;(*value))
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
-    if (!primitiveValue-&gt;isRGBColor())
</del><ins>+    CSSPrimitiveValue&amp; primitiveValue = downcast&lt;CSSPrimitiveValue&gt;(*value);
+    if (!primitiveValue.isRGBColor())
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    color = primitiveValue-&gt;getRGBA32Value();
</del><ins>+    color = primitiveValue.getRGBA32Value();
</ins><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -3118,7 +3118,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (lval-&gt;isBaseValueList()) {
</span><del>-        toCSSValueList(*lval).append(WTF::move(rval));
</del><ins>+        downcast&lt;CSSValueList&gt;(*lval).append(WTF::move(rval));
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -3425,8 +3425,8 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (lval-&gt;isValueList()) {
-        toCSSValueList(*lval).append(WTF::move(rval));
</del><ins>+    if (is&lt;CSSValueList&gt;(*lval)) {
+        downcast&lt;CSSValueList&gt;(*lval).append(WTF::move(rval));
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -4170,10 +4170,10 @@
</span><span class="cx">         value1.swap(value2);
</span><span class="cx"> 
</span><span class="cx"> #ifndef NDEBUG
</span><del>-    CSSPrimitiveValue* first = toCSSPrimitiveValue(value1.get());
-    CSSPrimitiveValue* second = toCSSPrimitiveValue(value2.get());
-    ident1 = first-&gt;getPairValue()-&gt;first()-&gt;getValueID();
-    ident2 = second-&gt;getPairValue()-&gt;first()-&gt;getValueID();
</del><ins>+    CSSPrimitiveValue&amp; first = downcast&lt;CSSPrimitiveValue&gt;(*value1);
+    CSSPrimitiveValue&amp; second = downcast&lt;CSSPrimitiveValue&gt;(*value2);
+    ident1 = first.getPairValue()-&gt;first()-&gt;getValueID();
+    ident2 = second.getPairValue()-&gt;first()-&gt;getValueID();
</ins><span class="cx">     ASSERT(ident1 == CSSValueLeft || ident1 == CSSValueRight);
</span><span class="cx">     ASSERT(ident2 == CSSValueBottom || ident2 == CSSValueTop);
</span><span class="cx"> #endif
</span><span class="lines">@@ -4231,8 +4231,8 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    RefPtr&lt;CSSPrimitiveValue&gt; parsedValue1 = toCSSPrimitiveValue(value1.get());
-    RefPtr&lt;CSSPrimitiveValue&gt; parsedValue2 = toCSSPrimitiveValue(value2.get());
</del><ins>+    RefPtr&lt;CSSPrimitiveValue&gt; parsedValue1 = downcast&lt;CSSPrimitiveValue&gt;(value1.get());
+    RefPtr&lt;CSSPrimitiveValue&gt; parsedValue2 = downcast&lt;CSSPrimitiveValue&gt;(value2.get());
</ins><span class="cx"> 
</span><span class="cx">     value1.clear();
</span><span class="cx">     value2.clear();
</span><span class="lines">@@ -4329,7 +4329,7 @@
</span><span class="cx"> 
</span><span class="cx">     // If only one value was specified, value2 is the same as value1.
</span><span class="cx">     m_implicitShorthand = true;
</span><del>-    value2 = cssValuePool().createIdentifierValue(toCSSPrimitiveValue(value1.get())-&gt;getValueID());
</del><ins>+    value2 = cssValuePool().createIdentifierValue(downcast&lt;CSSPrimitiveValue&gt;(*value1).getValueID());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> PassRefPtr&lt;CSSValue&gt; CSSParser::parseFillSize(CSSPropertyID propId, bool&amp; allowComma)
</span><span class="lines">@@ -4946,7 +4946,7 @@
</span><span class="cx"> 
</span><span class="cx"> static PassRefPtr&lt;CSSValue&gt; gridMissingGridPositionValue(CSSValue* value)
</span><span class="cx"> {
</span><del>-    if (value-&gt;isPrimitiveValue() &amp;&amp; toCSSPrimitiveValue(value)-&gt;isString())
</del><ins>+    if (is&lt;CSSPrimitiveValue&gt;(*value) &amp;&amp; downcast&lt;CSSPrimitiveValue&gt;(*value).isString())
</ins><span class="cx">         return value;
</span><span class="cx"> 
</span><span class="cx">     return cssValuePool().createIdentifierValue(CSSValueAuto);
</span><span class="lines">@@ -4998,7 +4998,7 @@
</span><span class="cx">         if (m_valueList-&gt;current()-&gt;unit == CSSParserValue::ValueList) {
</span><span class="cx">             if (trailingIdentWasAdded) {
</span><span class="cx">                 // A row's trailing ident must be concatenated with the next row's leading one.
</span><del>-                parseGridLineNames(*m_valueList, *templateRows, toCSSGridLineNamesValue(templateRows-&gt;item(templateRows-&gt;length() - 1)));
</del><ins>+                parseGridLineNames(*m_valueList, *templateRows, downcast&lt;CSSGridLineNamesValue&gt;(templateRows-&gt;item(templateRows-&gt;length() - 1)));
</ins><span class="cx">             } else
</span><span class="cx">                 parseGridLineNames(*m_valueList, *templateRows);
</span><span class="cx">         }
</span><span class="lines">@@ -5900,7 +5900,7 @@
</span><span class="cx">         // arguments except the first two. Thus, and index greater than one
</span><span class="cx">         // indicates an invalid production.
</span><span class="cx">         if (args-&gt;currentIndex() &gt; 1)
</span><del>-            return 0;
</del><ins>+            return nullptr;
</ins><span class="cx"> 
</span><span class="cx">         if (!args-&gt;currentIndex() &amp;&amp; argument-&gt;id != CSSValueAt) {
</span><span class="cx">             if (RefPtr&lt;CSSPrimitiveValue&gt; radius = parseShapeRadius(argument)) {
</span><span class="lines">@@ -5908,7 +5908,7 @@
</span><span class="cx">                 continue;
</span><span class="cx">             }
</span><span class="cx"> 
</span><del>-            return 0;
</del><ins>+            return nullptr;
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         if (argument-&gt;id == CSSValueAt &amp;&amp; args-&gt;next()) {
</span><span class="lines">@@ -5916,14 +5916,12 @@
</span><span class="cx">             RefPtr&lt;CSSValue&gt; centerY;
</span><span class="cx">             parseFillPosition(args, centerX, centerY);
</span><span class="cx">             if (centerX &amp;&amp; centerY &amp;&amp; !args-&gt;current()) {
</span><del>-                ASSERT(centerX-&gt;isPrimitiveValue());
-                ASSERT(centerY-&gt;isPrimitiveValue());
-                shape-&gt;setCenterX(toCSSPrimitiveValue(centerX.get()));
-                shape-&gt;setCenterY(toCSSPrimitiveValue(centerY.get()));
</del><ins>+                shape-&gt;setCenterX(downcast&lt;CSSPrimitiveValue&gt;(centerX.get()));
+                shape-&gt;setCenterY(downcast&lt;CSSPrimitiveValue&gt;(centerY.get()));
</ins><span class="cx">             } else
</span><del>-                return 0;
</del><ins>+                return nullptr;
</ins><span class="cx">         } else
</span><del>-            return 0;
</del><ins>+            return nullptr;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     return shape;
</span><span class="lines">@@ -5946,7 +5944,7 @@
</span><span class="cx">         // arguments except the first three. Thus, an index greater than two
</span><span class="cx">         // indicates an invalid production.
</span><span class="cx">         if (args-&gt;currentIndex() &gt; 2)
</span><del>-            return 0;
</del><ins>+            return nullptr;
</ins><span class="cx"> 
</span><span class="cx">         if (args-&gt;currentIndex() &lt; 2 &amp;&amp; argument-&gt;id != CSSValueAt) {
</span><span class="cx">             if (RefPtr&lt;CSSPrimitiveValue&gt; radius = parseShapeRadius(argument)) {
</span><span class="lines">@@ -5957,22 +5955,20 @@
</span><span class="cx">                 continue;
</span><span class="cx">             }
</span><span class="cx"> 
</span><del>-            return 0;
</del><ins>+            return nullptr;
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         if (argument-&gt;id != CSSValueAt || !args-&gt;next()) // expecting ellipse(.. at &lt;position&gt;)
</span><del>-            return 0;
</del><ins>+            return nullptr;
</ins><span class="cx"> 
</span><span class="cx">         RefPtr&lt;CSSValue&gt; centerX;
</span><span class="cx">         RefPtr&lt;CSSValue&gt; centerY;
</span><span class="cx">         parseFillPosition(args, centerX, centerY);
</span><span class="cx">         if (!centerX || !centerY || args-&gt;current())
</span><del>-            return 0;
</del><ins>+            return nullptr;
</ins><span class="cx"> 
</span><del>-        ASSERT(centerX-&gt;isPrimitiveValue());
-        ASSERT(centerY-&gt;isPrimitiveValue());
-        shape-&gt;setCenterX(toCSSPrimitiveValue(centerX.get()));
-        shape-&gt;setCenterY(toCSSPrimitiveValue(centerY.get()));
</del><ins>+        shape-&gt;setCenterX(downcast&lt;CSSPrimitiveValue&gt;(centerX.get()));
+        shape-&gt;setCenterY(downcast&lt;CSSPrimitiveValue&gt;(centerY.get()));
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     return shape;
</span><span class="lines">@@ -8115,7 +8111,7 @@
</span><span class="cx">         a = args-&gt;next();
</span><span class="cx">         if (!a || a-&gt;unit != CSSPrimitiveValue::CSS_NUMBER)
</span><span class="cx">             return false;
</span><del>-        toCSSRadialGradientValue(result.get())-&gt;setFirstRadius(createPrimitiveNumericValue(a));
</del><ins>+        downcast&lt;CSSRadialGradientValue&gt;(*result).setFirstRadius(createPrimitiveNumericValue(a));
</ins><span class="cx"> 
</span><span class="cx">         // Comma after the first radius.
</span><span class="cx">         a = args-&gt;next();
</span><span class="lines">@@ -8152,7 +8148,7 @@
</span><span class="cx">         a = args-&gt;next();
</span><span class="cx">         if (!a || a-&gt;unit != CSSPrimitiveValue::CSS_NUMBER)
</span><span class="cx">             return false;
</span><del>-        toCSSRadialGradientValue(result.get())-&gt;setSecondRadius(createPrimitiveNumericValue(a));
</del><ins>+        downcast&lt;CSSRadialGradientValue&gt;(*result).setSecondRadius(createPrimitiveNumericValue(a));
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     // We now will accept any number of stops (0 or more).
</span><span class="lines">@@ -8312,14 +8308,11 @@
</span><span class="cx">             return false;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    ASSERT(!centerX || centerX-&gt;isPrimitiveValue());
-    ASSERT(!centerY || centerY-&gt;isPrimitiveValue());
-
-    result-&gt;setFirstX(toCSSPrimitiveValue(centerX.get()));
-    result-&gt;setSecondX(toCSSPrimitiveValue(centerX.get()));
</del><ins>+    result-&gt;setFirstX(downcast&lt;CSSPrimitiveValue&gt;(centerX.get()));
+    result-&gt;setSecondX(downcast&lt;CSSPrimitiveValue&gt;(centerX.get()));
</ins><span class="cx">     // CSS3 radial gradients always share the same start and end point.
</span><del>-    result-&gt;setFirstY(toCSSPrimitiveValue(centerY.get()));
-    result-&gt;setSecondY(toCSSPrimitiveValue(centerY.get()));
</del><ins>+    result-&gt;setFirstY(downcast&lt;CSSPrimitiveValue&gt;(centerY.get()));
+    result-&gt;setSecondY(downcast&lt;CSSPrimitiveValue&gt;(centerY.get()));
</ins><span class="cx"> 
</span><span class="cx">     RefPtr&lt;CSSPrimitiveValue&gt; shapeValue;
</span><span class="cx">     RefPtr&lt;CSSPrimitiveValue&gt; sizeValue;
</span><span class="lines">@@ -8578,13 +8571,11 @@
</span><span class="cx">         if (!a)
</span><span class="cx">             return false;
</span><span class="cx"> 
</span><del>-        ASSERT(centerX-&gt;isPrimitiveValue());
-        ASSERT(centerY-&gt;isPrimitiveValue());
-        result-&gt;setFirstX(toCSSPrimitiveValue(centerX.get()));
-        result-&gt;setFirstY(toCSSPrimitiveValue(centerY.get()));
</del><ins>+        result-&gt;setFirstX(downcast&lt;CSSPrimitiveValue&gt;(centerX.get()));
+        result-&gt;setFirstY(downcast&lt;CSSPrimitiveValue&gt;(centerY.get()));
</ins><span class="cx">         // Right now, CSS radial gradients have the same start and end centers.
</span><del>-        result-&gt;setSecondX(toCSSPrimitiveValue(centerX.get()));
-        result-&gt;setSecondY(toCSSPrimitiveValue(centerY.get()));
</del><ins>+        result-&gt;setSecondX(downcast&lt;CSSPrimitiveValue&gt;(centerX.get()));
+        result-&gt;setSecondY(downcast&lt;CSSPrimitiveValue&gt;(centerY.get()));
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (shapeValue || sizeValue || horizontalSize || centerX || centerY)
</span><span class="lines">@@ -11737,7 +11728,7 @@
</span><span class="cx">         CSSProperty&amp; property = m_parsedProperties[i];
</span><span class="cx">         if (property.id() == CSSPropertyFontVariant &amp;&amp; property.value()-&gt;isPrimitiveValue())
</span><span class="cx">             property.wrapValueInCommaSeparatedList();
</span><del>-        else if (property.id() == CSSPropertyFontFamily &amp;&amp; (!property.value()-&gt;isValueList() || toCSSValueList(property.value())-&gt;length() != 1)) {
</del><ins>+        else if (property.id() == CSSPropertyFontFamily &amp;&amp; (!is&lt;CSSValueList&gt;(*property.value()) || downcast&lt;CSSValueList&gt;(*property.value()).length() != 1)) {
</ins><span class="cx">             // Unlike font-family property, font-family descriptor in @font-face rule
</span><span class="cx">             // has to be a value list with exactly one family name. It cannot have a
</span><span class="cx">             // have 'initial' value and cannot 'inherit' from parent.
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSPrimitiveValueh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSPrimitiveValue.h (174299 => 174300)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSPrimitiveValue.h        2014-10-03 23:05:07 UTC (rev 174299)
+++ trunk/Source/WebCore/css/CSSPrimitiveValue.h        2014-10-03 23:17:00 UTC (rev 174300)
</span><span class="lines">@@ -421,8 +421,8 @@
</span><span class="cx">     } m_value;
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-CSS_VALUE_TYPE_CASTS(CSSPrimitiveValue, isPrimitiveValue())
-
</del><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><ins>+SPECIALIZE_TYPE_TRAITS_CSS_VALUE(CSSPrimitiveValue, isPrimitiveValue())
+
</ins><span class="cx"> #endif // CSSPrimitiveValue_h
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSReflectValueh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSReflectValue.h (174299 => 174300)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSReflectValue.h        2014-10-03 23:05:07 UTC (rev 174299)
+++ trunk/Source/WebCore/css/CSSReflectValue.h        2014-10-03 23:17:00 UTC (rev 174300)
</span><span class="lines">@@ -67,8 +67,8 @@
</span><span class="cx">     RefPtr&lt;CSSValue&gt; m_mask;
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-CSS_VALUE_TYPE_CASTS(CSSReflectValue, isReflectValue())
-
</del><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><ins>+SPECIALIZE_TYPE_TRAITS_CSS_VALUE(CSSReflectValue, isReflectValue())
+
</ins><span class="cx"> #endif // CSSReflectValue_h
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSShadowValueh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSShadowValue.h (174299 => 174300)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSShadowValue.h        2014-10-03 23:05:07 UTC (rev 174299)
+++ trunk/Source/WebCore/css/CSSShadowValue.h        2014-10-03 23:17:00 UTC (rev 174300)
</span><span class="lines">@@ -62,8 +62,8 @@
</span><span class="cx">         PassRefPtr&lt;CSSPrimitiveValue&gt; color);
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-CSS_VALUE_TYPE_CASTS(CSSShadowValue, isShadowValue())
</del><ins>+} // namespace WebCore
</ins><span class="cx"> 
</span><del>-} // namespace
</del><ins>+SPECIALIZE_TYPE_TRAITS_CSS_VALUE(CSSShadowValue, isShadowValue())
</ins><span class="cx"> 
</span><del>-#endif
</del><ins>+#endif // CSSShadowValue_h
</ins></span></pre></div>
<a id="trunkSourceWebCorecssCSSTimingFunctionValueh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSTimingFunctionValue.h (174299 => 174300)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSTimingFunctionValue.h        2014-10-03 23:05:07 UTC (rev 174299)
+++ trunk/Source/WebCore/css/CSSTimingFunctionValue.h        2014-10-03 23:17:00 UTC (rev 174300)
</span><span class="lines">@@ -63,8 +63,6 @@
</span><span class="cx">     double m_y2;
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-CSS_VALUE_TYPE_CASTS(CSSCubicBezierTimingFunctionValue, isCubicBezierTimingFunctionValue())
-
</del><span class="cx"> class CSSStepsTimingFunctionValue : public CSSValue {
</span><span class="cx"> public:
</span><span class="cx">     static PassRef&lt;CSSStepsTimingFunctionValue&gt; create(int steps, bool stepAtStart)
</span><span class="lines">@@ -91,8 +89,9 @@
</span><span class="cx">     bool m_stepAtStart;
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-CSS_VALUE_TYPE_CASTS(CSSStepsTimingFunctionValue, isStepsTimingFunctionValue())
</del><ins>+} // namespace WebCore
</ins><span class="cx"> 
</span><del>-} // namespace
</del><ins>+SPECIALIZE_TYPE_TRAITS_CSS_VALUE(CSSCubicBezierTimingFunctionValue, isCubicBezierTimingFunctionValue())
+SPECIALIZE_TYPE_TRAITS_CSS_VALUE(CSSStepsTimingFunctionValue, isStepsTimingFunctionValue())
</ins><span class="cx"> 
</span><del>-#endif
</del><ins>+#endif // CSSTimingFunctionValue_h
</ins></span></pre></div>
<a id="trunkSourceWebCorecssCSSToStyleMapcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSToStyleMap.cpp (174299 => 174300)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSToStyleMap.cpp        2014-10-03 23:05:07 UTC (rev 174299)
+++ trunk/Source/WebCore/css/CSSToStyleMap.cpp        2014-10-03 23:17:00 UTC (rev 174300)
</span><span class="lines">@@ -74,10 +74,10 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (!value-&gt;isPrimitiveValue())
</del><ins>+    if (!is&lt;CSSPrimitiveValue&gt;(*value))
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    switch (toCSSPrimitiveValue(value)-&gt;getValueID()) {
</del><ins>+    switch (downcast&lt;CSSPrimitiveValue&gt;(*value).getValueID()) {
</ins><span class="cx">     case CSSValueFixed:
</span><span class="cx">         layer-&gt;setAttachment(FixedBackgroundAttachment);
</span><span class="cx">         break;
</span><span class="lines">@@ -99,11 +99,11 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (!value-&gt;isPrimitiveValue())
</del><ins>+    if (!is&lt;CSSPrimitiveValue&gt;(*value))
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
-    layer-&gt;setClip(*primitiveValue);
</del><ins>+    CSSPrimitiveValue&amp; primitiveValue = downcast&lt;CSSPrimitiveValue&gt;(*value);
+    layer-&gt;setClip(primitiveValue);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void CSSToStyleMap::mapFillComposite(CSSPropertyID, FillLayer* layer, CSSValue* value)
</span><span class="lines">@@ -113,11 +113,11 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (!value-&gt;isPrimitiveValue())
</del><ins>+    if (!is&lt;CSSPrimitiveValue&gt;(*value))
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
-    layer-&gt;setComposite(*primitiveValue);
</del><ins>+    CSSPrimitiveValue&amp; primitiveValue = downcast&lt;CSSPrimitiveValue&gt;(*value);
+    layer-&gt;setComposite(primitiveValue);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void CSSToStyleMap::mapFillBlendMode(CSSPropertyID, FillLayer* layer, CSSValue* value)
</span><span class="lines">@@ -127,11 +127,11 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (!value-&gt;isPrimitiveValue())
</del><ins>+    if (!is&lt;CSSPrimitiveValue&gt;(*value))
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
-    layer-&gt;setBlendMode(*primitiveValue);
</del><ins>+    CSSPrimitiveValue&amp; primitiveValue = downcast&lt;CSSPrimitiveValue&gt;(*value);
+    layer-&gt;setBlendMode(primitiveValue);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void CSSToStyleMap::mapFillOrigin(CSSPropertyID, FillLayer* layer, CSSValue* value)
</span><span class="lines">@@ -141,11 +141,11 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (!value-&gt;isPrimitiveValue())
</del><ins>+    if (!is&lt;CSSPrimitiveValue&gt;(*value))
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
-    layer-&gt;setOrigin(*primitiveValue);
</del><ins>+    CSSPrimitiveValue&amp; primitiveValue = downcast&lt;CSSPrimitiveValue&gt;(*value);
+    layer-&gt;setOrigin(primitiveValue);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="lines">@@ -166,11 +166,11 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (!value-&gt;isPrimitiveValue())
</del><ins>+    if (!is&lt;CSSPrimitiveValue&gt;(*value))
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
-    layer-&gt;setRepeatX(*primitiveValue);
</del><ins>+    CSSPrimitiveValue&amp; primitiveValue = downcast&lt;CSSPrimitiveValue&gt;(*value);
+    layer-&gt;setRepeatX(primitiveValue);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void CSSToStyleMap::mapFillRepeatY(CSSPropertyID, FillLayer* layer, CSSValue* value)
</span><span class="lines">@@ -180,31 +180,31 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (!value-&gt;isPrimitiveValue())
</del><ins>+    if (!is&lt;CSSPrimitiveValue&gt;(*value))
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
-    layer-&gt;setRepeatY(*primitiveValue);
</del><ins>+    CSSPrimitiveValue&amp; primitiveValue = downcast&lt;CSSPrimitiveValue&gt;(*value);
+    layer-&gt;setRepeatY(primitiveValue);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void CSSToStyleMap::mapFillSize(CSSPropertyID, FillLayer* layer, CSSValue* value)
</span><span class="cx"> {
</span><del>-    if (!value-&gt;isPrimitiveValue()) {
</del><ins>+    if (!is&lt;CSSPrimitiveValue&gt;(*value)) {
</ins><span class="cx">         layer-&gt;setSizeType(SizeNone);
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
-    if (primitiveValue-&gt;getValueID() == CSSValueContain)
</del><ins>+    CSSPrimitiveValue&amp; primitiveValue = downcast&lt;CSSPrimitiveValue&gt;(*value);
+    if (primitiveValue.getValueID() == CSSValueContain)
</ins><span class="cx">         layer-&gt;setSizeType(Contain);
</span><del>-    else if (primitiveValue-&gt;getValueID() == CSSValueCover)
</del><ins>+    else if (primitiveValue.getValueID() == CSSValueCover)
</ins><span class="cx">         layer-&gt;setSizeType(Cover);
</span><span class="cx">     else
</span><span class="cx">         layer-&gt;setSizeType(SizeLength);
</span><span class="cx"> 
</span><span class="cx">     LengthSize b = FillLayer::initialFillSizeLength(layer-&gt;type());
</span><span class="cx"> 
</span><del>-    if (value-&gt;isInitialValue() || primitiveValue-&gt;getValueID() == CSSValueContain || primitiveValue-&gt;getValueID() == CSSValueCover) {
</del><ins>+    if (value-&gt;isInitialValue() || primitiveValue.getValueID() == CSSValueContain || primitiveValue.getValueID() == CSSValueCover) {
</ins><span class="cx">         layer-&gt;setSizeLength(b);
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="lines">@@ -212,13 +212,13 @@
</span><span class="cx">     Length firstLength;
</span><span class="cx">     Length secondLength;
</span><span class="cx"> 
</span><del>-    if (Pair* pair = primitiveValue-&gt;getPairValue()) {
</del><ins>+    if (Pair* pair = primitiveValue.getPairValue()) {
</ins><span class="cx">         CSSPrimitiveValue* first = static_cast&lt;CSSPrimitiveValue*&gt;(pair-&gt;first());
</span><span class="cx">         CSSPrimitiveValue* second = static_cast&lt;CSSPrimitiveValue*&gt;(pair-&gt;second());
</span><span class="cx">         firstLength = first-&gt;convertToLength&lt;AnyConversion&gt;(m_resolver-&gt;state().cssToLengthConversionData());
</span><span class="cx">         secondLength = second-&gt;convertToLength&lt;AnyConversion&gt;(m_resolver-&gt;state().cssToLengthConversionData());
</span><span class="cx">     } else {
</span><del>-        firstLength = primitiveValue-&gt;convertToLength&lt;AnyConversion&gt;(m_resolver-&gt;state().cssToLengthConversionData());
</del><ins>+        firstLength = primitiveValue.convertToLength&lt;AnyConversion&gt;(m_resolver-&gt;state().cssToLengthConversionData());
</ins><span class="cx">         secondLength = Length();
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -237,10 +237,10 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (!value-&gt;isPrimitiveValue())
</del><ins>+    if (!is&lt;CSSPrimitiveValue&gt;(*value))
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
</del><ins>+    CSSPrimitiveValue* primitiveValue = downcast&lt;CSSPrimitiveValue&gt;(value);
</ins><span class="cx">     Pair* pair = primitiveValue-&gt;getPairValue();
</span><span class="cx">     if (pair) {
</span><span class="cx">         ASSERT_UNUSED(propertyID, propertyID == CSSPropertyBackgroundPositionX || propertyID == CSSPropertyWebkitMaskPositionX);
</span><span class="lines">@@ -269,10 +269,10 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (!value-&gt;isPrimitiveValue())
</del><ins>+    if (!is&lt;CSSPrimitiveValue&gt;(*value))
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
</del><ins>+    CSSPrimitiveValue* primitiveValue = downcast&lt;CSSPrimitiveValue&gt;(value);
</ins><span class="cx">     Pair* pair = primitiveValue-&gt;getPairValue();
</span><span class="cx">     if (pair) {
</span><span class="cx">         ASSERT_UNUSED(propertyID, propertyID == CSSPropertyBackgroundPositionY || propertyID == CSSPropertyWebkitMaskPositionY);
</span><span class="lines">@@ -302,11 +302,11 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (!value-&gt;isPrimitiveValue())
</del><ins>+    if (!is&lt;CSSPrimitiveValue&gt;(*value))
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
-    switch (primitiveValue-&gt;getValueID()) {
</del><ins>+    CSSPrimitiveValue&amp; primitiveValue = downcast&lt;CSSPrimitiveValue&gt;(*value);
+    switch (primitiveValue.getValueID()) {
</ins><span class="cx">     case CSSValueAlpha:
</span><span class="cx">         type = EMaskSourceType::MaskAlpha;
</span><span class="cx">         break;
</span><span class="lines">@@ -329,11 +329,11 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (!value-&gt;isPrimitiveValue())
</del><ins>+    if (!is&lt;CSSPrimitiveValue&gt;(*value))
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
-    animation-&gt;setDelay(primitiveValue-&gt;computeTime&lt;double, CSSPrimitiveValue::Seconds&gt;());
</del><ins>+    CSSPrimitiveValue&amp; primitiveValue = downcast&lt;CSSPrimitiveValue&gt;(*value);
+    animation-&gt;setDelay(primitiveValue.computeTime&lt;double, CSSPrimitiveValue::Seconds&gt;());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void CSSToStyleMap::mapAnimationDirection(Animation* layer, CSSValue* value)
</span><span class="lines">@@ -343,11 +343,11 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (!value-&gt;isPrimitiveValue())
</del><ins>+    if (!is&lt;CSSPrimitiveValue&gt;(*value))
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
-    switch (primitiveValue-&gt;getValueID()) {
</del><ins>+    CSSPrimitiveValue&amp; primitiveValue = downcast&lt;CSSPrimitiveValue&gt;(*value);
+    switch (primitiveValue.getValueID()) {
</ins><span class="cx">     case CSSValueNormal:
</span><span class="cx">         layer-&gt;setDirection(Animation::AnimationDirectionNormal);
</span><span class="cx">         break;
</span><span class="lines">@@ -372,11 +372,11 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (!value-&gt;isPrimitiveValue())
</del><ins>+    if (!is&lt;CSSPrimitiveValue&gt;(*value))
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
-    animation-&gt;setDuration(primitiveValue-&gt;computeTime&lt;double, CSSPrimitiveValue::Seconds&gt;());
</del><ins>+    CSSPrimitiveValue&amp; primitiveValue = downcast&lt;CSSPrimitiveValue&gt;(*value);
+    animation-&gt;setDuration(primitiveValue.computeTime&lt;double, CSSPrimitiveValue::Seconds&gt;());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void CSSToStyleMap::mapAnimationFillMode(Animation* layer, CSSValue* value)
</span><span class="lines">@@ -386,11 +386,11 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (!value-&gt;isPrimitiveValue())
</del><ins>+    if (!is&lt;CSSPrimitiveValue&gt;(*value))
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
-    switch (primitiveValue-&gt;getValueID()) {
</del><ins>+    CSSPrimitiveValue&amp; primitiveValue = downcast&lt;CSSPrimitiveValue&gt;(*value);
+    switch (primitiveValue.getValueID()) {
</ins><span class="cx">     case CSSValueNone:
</span><span class="cx">         layer-&gt;setFillMode(AnimationFillModeNone);
</span><span class="cx">         break;
</span><span class="lines">@@ -415,14 +415,14 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (!value-&gt;isPrimitiveValue())
</del><ins>+    if (!is&lt;CSSPrimitiveValue&gt;(*value))
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
-    if (primitiveValue-&gt;getValueID() == CSSValueInfinite)
</del><ins>+    CSSPrimitiveValue&amp; primitiveValue = downcast&lt;CSSPrimitiveValue&gt;(*value);
+    if (primitiveValue.getValueID() == CSSValueInfinite)
</ins><span class="cx">         animation-&gt;setIterationCount(Animation::IterationCountInfinite);
</span><span class="cx">     else
</span><del>-        animation-&gt;setIterationCount(primitiveValue-&gt;getFloatValue());
</del><ins>+        animation-&gt;setIterationCount(primitiveValue.getFloatValue());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void CSSToStyleMap::mapAnimationName(Animation* layer, CSSValue* value)
</span><span class="lines">@@ -432,14 +432,14 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (!value-&gt;isPrimitiveValue())
</del><ins>+    if (!is&lt;CSSPrimitiveValue&gt;(*value))
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
-    if (primitiveValue-&gt;getValueID() == CSSValueNone)
</del><ins>+    CSSPrimitiveValue&amp; primitiveValue = downcast&lt;CSSPrimitiveValue&gt;(*value);
+    if (primitiveValue.getValueID() == CSSValueNone)
</ins><span class="cx">         layer-&gt;setIsNoneAnimation(true);
</span><span class="cx">     else
</span><del>-        layer-&gt;setName(primitiveValue-&gt;getStringValue());
</del><ins>+        layer-&gt;setName(primitiveValue.getStringValue());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void CSSToStyleMap::mapAnimationPlayState(Animation* layer, CSSValue* value)
</span><span class="lines">@@ -449,11 +449,11 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (!value-&gt;isPrimitiveValue())
</del><ins>+    if (!is&lt;CSSPrimitiveValue&gt;(*value))
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
-    EAnimPlayState playState = (primitiveValue-&gt;getValueID() == CSSValuePaused) ? AnimPlayStatePaused : AnimPlayStatePlaying;
</del><ins>+    CSSPrimitiveValue&amp; primitiveValue = downcast&lt;CSSPrimitiveValue&gt;(*value);
+    EAnimPlayState playState = (primitiveValue.getValueID() == CSSValuePaused) ? AnimPlayStatePaused : AnimPlayStatePlaying;
</ins><span class="cx">     layer-&gt;setPlayState(playState);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -465,19 +465,19 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (!value-&gt;isPrimitiveValue())
</del><ins>+    if (!is&lt;CSSPrimitiveValue&gt;(*value))
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
-    if (primitiveValue-&gt;getValueID() == CSSValueAll) {
</del><ins>+    CSSPrimitiveValue&amp; primitiveValue = downcast&lt;CSSPrimitiveValue&gt;(*value);
+    if (primitiveValue.getValueID() == CSSValueAll) {
</ins><span class="cx">         animation-&gt;setAnimationMode(Animation::AnimateAll);
</span><span class="cx">         animation-&gt;setProperty(CSSPropertyInvalid);
</span><del>-    } else if (primitiveValue-&gt;getValueID() == CSSValueNone) {
</del><ins>+    } else if (primitiveValue.getValueID() == CSSValueNone) {
</ins><span class="cx">         animation-&gt;setAnimationMode(Animation::AnimateNone);
</span><span class="cx">         animation-&gt;setProperty(CSSPropertyInvalid);
</span><span class="cx">     } else {
</span><span class="cx">         animation-&gt;setAnimationMode(Animation::AnimateSingleProperty);
</span><del>-        animation-&gt;setProperty(primitiveValue-&gt;getPropertyID());
</del><ins>+        animation-&gt;setProperty(primitiveValue.getPropertyID());
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -488,9 +488,9 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (value-&gt;isPrimitiveValue()) {
-        CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
-        switch (primitiveValue-&gt;getValueID()) {
</del><ins>+    if (is&lt;CSSPrimitiveValue&gt;(*value)) {
+        CSSPrimitiveValue&amp; primitiveValue = downcast&lt;CSSPrimitiveValue&gt;(*value);
+        switch (primitiveValue.getValueID()) {
</ins><span class="cx">         case CSSValueLinear:
</span><span class="cx">             animation-&gt;setTimingFunction(LinearTimingFunction::create());
</span><span class="cx">             break;
</span><span class="lines">@@ -518,23 +518,23 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (value-&gt;isCubicBezierTimingFunctionValue()) {
-        CSSCubicBezierTimingFunctionValue* cubicTimingFunction = toCSSCubicBezierTimingFunctionValue(value);
-        animation-&gt;setTimingFunction(CubicBezierTimingFunction::create(cubicTimingFunction-&gt;x1(), cubicTimingFunction-&gt;y1(), cubicTimingFunction-&gt;x2(), cubicTimingFunction-&gt;y2()));
-    } else if (value-&gt;isStepsTimingFunctionValue()) {
-        CSSStepsTimingFunctionValue* stepsTimingFunction = toCSSStepsTimingFunctionValue(value);
-        animation-&gt;setTimingFunction(StepsTimingFunction::create(stepsTimingFunction-&gt;numberOfSteps(), stepsTimingFunction-&gt;stepAtStart()));
</del><ins>+    if (is&lt;CSSCubicBezierTimingFunctionValue&gt;(*value)) {
+        CSSCubicBezierTimingFunctionValue&amp; cubicTimingFunction = downcast&lt;CSSCubicBezierTimingFunctionValue&gt;(*value);
+        animation-&gt;setTimingFunction(CubicBezierTimingFunction::create(cubicTimingFunction.x1(), cubicTimingFunction.y1(), cubicTimingFunction.x2(), cubicTimingFunction.y2()));
+    } else if (is&lt;CSSStepsTimingFunctionValue&gt;(*value)) {
+        CSSStepsTimingFunctionValue&amp; stepsTimingFunction = downcast&lt;CSSStepsTimingFunctionValue&gt;(*value);
+        animation-&gt;setTimingFunction(StepsTimingFunction::create(stepsTimingFunction.numberOfSteps(), stepsTimingFunction.stepAtStart()));
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void CSSToStyleMap::mapNinePieceImage(CSSPropertyID property, CSSValue* value, NinePieceImage&amp; image)
</span><span class="cx"> {
</span><span class="cx">     // If we're not a value list, then we are &quot;none&quot; and don't need to alter the empty image at all.
</span><del>-    if (!value || !value-&gt;isValueList())
</del><ins>+    if (!is&lt;CSSValueList&gt;(value))
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     // Retrieve the border image value.
</span><del>-    CSSValueList* borderImage = toCSSValueList(value);
</del><ins>+    CSSValueList&amp; borderImage = downcast&lt;CSSValueList&gt;(*value);
</ins><span class="cx"> 
</span><span class="cx">     // Set the image (this kicks off the load).
</span><span class="cx">     CSSPropertyID imageProperty;
</span><span class="lines">@@ -545,8 +545,8 @@
</span><span class="cx">     else
</span><span class="cx">         imageProperty = property;
</span><span class="cx"> 
</span><del>-    for (unsigned i = 0 ; i &lt; borderImage-&gt;length() ; ++i) {
-        CSSValue* current = borderImage-&gt;item(i);
</del><ins>+    for (unsigned i = 0 ; i &lt; borderImage.length(); ++i) {
+        CSSValue* current = borderImage.item(i);
</ins><span class="cx"> 
</span><span class="cx">         if (current-&gt;isImageValue() || current-&gt;isImageGeneratorValue()
</span><span class="cx"> #if ENABLE(CSS_IMAGE_SET)
</span><span class="lines">@@ -556,19 +556,19 @@
</span><span class="cx">             image.setImage(styleImage(imageProperty, current));
</span><span class="cx">         else if (current-&gt;isBorderImageSliceValue())
</span><span class="cx">             mapNinePieceImageSlice(current, image);
</span><del>-        else if (current-&gt;isValueList()) {
-            CSSValueList* slashList = toCSSValueList(current);
</del><ins>+        else if (is&lt;CSSValueList&gt;(*current)) {
+            CSSValueList&amp; slashList = downcast&lt;CSSValueList&gt;(*current);
</ins><span class="cx">             // Map in the image slices.
</span><del>-            if (slashList-&gt;item(0) &amp;&amp; slashList-&gt;item(0)-&gt;isBorderImageSliceValue())
-                mapNinePieceImageSlice(slashList-&gt;item(0), image);
</del><ins>+            if (slashList.item(0) &amp;&amp; slashList.item(0)-&gt;isBorderImageSliceValue())
+                mapNinePieceImageSlice(slashList.item(0), image);
</ins><span class="cx"> 
</span><span class="cx">             // Map in the border slices.
</span><del>-            if (slashList-&gt;item(1))
-                image.setBorderSlices(mapNinePieceImageQuad(slashList-&gt;item(1)));
</del><ins>+            if (slashList.item(1))
+                image.setBorderSlices(mapNinePieceImageQuad(slashList.item(1)));
</ins><span class="cx"> 
</span><span class="cx">             // Map in the outset.
</span><del>-            if (slashList-&gt;item(2))
-                image.setOutset(mapNinePieceImageQuad(slashList-&gt;item(2)));
</del><ins>+            if (slashList.item(2))
+                image.setOutset(mapNinePieceImageQuad(slashList.item(2)));
</ins><span class="cx">         } else if (current-&gt;isPrimitiveValue()) {
</span><span class="cx">             // Set the appropriate rules for stretch/round/repeat of the slices.
</span><span class="cx">             mapNinePieceImageRepeat(current, image);
</span><span class="lines">@@ -592,15 +592,15 @@
</span><span class="cx"> 
</span><span class="cx"> void CSSToStyleMap::mapNinePieceImageSlice(CSSValue* value, NinePieceImage&amp; image)
</span><span class="cx"> {
</span><del>-    if (!value || !value-&gt;isBorderImageSliceValue())
</del><ins>+    if (!is&lt;CSSBorderImageSliceValue&gt;(value))
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     // Retrieve the border image value.
</span><del>-    CSSBorderImageSliceValue* borderImageSlice = toCSSBorderImageSliceValue(value);
</del><ins>+    CSSBorderImageSliceValue&amp; borderImageSlice = downcast&lt;CSSBorderImageSliceValue&gt;(*value);
</ins><span class="cx"> 
</span><span class="cx">     // Set up a length box to represent our image slices.
</span><span class="cx">     LengthBox box;
</span><del>-    Quad* slices = borderImageSlice-&gt;slices();
</del><ins>+    Quad* slices = borderImageSlice.slices();
</ins><span class="cx">     if (slices-&gt;top()-&gt;isPercentage())
</span><span class="cx">         box.m_top = Length(slices-&gt;top()-&gt;getDoubleValue(), Percent);
</span><span class="cx">     else
</span><span class="lines">@@ -620,23 +620,23 @@
</span><span class="cx">     image.setImageSlices(box);
</span><span class="cx"> 
</span><span class="cx">     // Set our fill mode.
</span><del>-    image.setFill(borderImageSlice-&gt;m_fill);
</del><ins>+    image.setFill(borderImageSlice.m_fill);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> LengthBox CSSToStyleMap::mapNinePieceImageQuad(CSSValue* value)
</span><span class="cx"> {
</span><del>-    if (!value || !value-&gt;isPrimitiveValue())
</del><ins>+    if (!is&lt;CSSPrimitiveValue&gt;(value))
</ins><span class="cx">         return LengthBox();
</span><span class="cx"> 
</span><span class="cx">     // Get our zoom value.
</span><span class="cx">     CSSToLengthConversionData conversionData = useSVGZoomRules() ? m_resolver-&gt;state().cssToLengthConversionData().copyWithAdjustedZoom(1.0f) : m_resolver-&gt;state().cssToLengthConversionData();
</span><span class="cx"> 
</span><span class="cx">     // Retrieve the primitive value.
</span><del>-    CSSPrimitiveValue* borderWidths = toCSSPrimitiveValue(value);
</del><ins>+    CSSPrimitiveValue&amp; borderWidths = downcast&lt;CSSPrimitiveValue&gt;(*value);
</ins><span class="cx"> 
</span><span class="cx">     // Set up a length box to represent our image slices.
</span><span class="cx">     LengthBox box; // Defaults to 'auto' so we don't have to handle that explicitly below.
</span><del>-    Quad* slices = borderWidths-&gt;getQuadValue();
</del><ins>+    Quad* slices = borderWidths.getQuadValue();
</ins><span class="cx">     if (slices-&gt;top()-&gt;isNumber())
</span><span class="cx">         box.m_top = Length(slices-&gt;top()-&gt;getIntValue(), Relative);
</span><span class="cx">     else if (slices-&gt;top()-&gt;isPercentage())
</span><span class="lines">@@ -670,11 +670,11 @@
</span><span class="cx"> 
</span><span class="cx"> void CSSToStyleMap::mapNinePieceImageRepeat(CSSValue* value, NinePieceImage&amp; image)
</span><span class="cx"> {
</span><del>-    if (!value || !value-&gt;isPrimitiveValue())
</del><ins>+    if (!is&lt;CSSPrimitiveValue&gt;(value))
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
-    Pair* pair = primitiveValue-&gt;getPairValue();
</del><ins>+    CSSPrimitiveValue&amp; primitiveValue = downcast&lt;CSSPrimitiveValue&gt;(*value);
+    Pair* pair = primitiveValue.getPairValue();
</ins><span class="cx">     if (!pair || !pair-&gt;first() || !pair-&gt;second())
</span><span class="cx">         return;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSUnicodeRangeValueh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSUnicodeRangeValue.h (174299 => 174300)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSUnicodeRangeValue.h        2014-10-03 23:05:07 UTC (rev 174299)
+++ trunk/Source/WebCore/css/CSSUnicodeRangeValue.h        2014-10-03 23:17:00 UTC (rev 174300)
</span><span class="lines">@@ -57,8 +57,8 @@
</span><span class="cx">     UChar32 m_to;
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-CSS_VALUE_TYPE_CASTS(CSSUnicodeRangeValue, isUnicodeRangeValue())
-
</del><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><ins>+SPECIALIZE_TYPE_TRAITS_CSS_VALUE(CSSUnicodeRangeValue, isUnicodeRangeValue())
+
</ins><span class="cx"> #endif // CSSUnicodeRangeValue_h
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSValuecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSValue.cpp (174299 => 174300)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSValue.cpp        2014-10-03 23:05:07 UTC (rev 174299)
+++ trunk/Source/WebCore/css/CSSValue.cpp        2014-10-03 23:17:00 UTC (rev 174300)
</span><span class="lines">@@ -91,7 +91,7 @@
</span><span class="cx"> 
</span><span class="cx"> bool CSSValue::isImplicitInitialValue() const
</span><span class="cx"> {
</span><del>-    return m_classType == InitialClass &amp;&amp; toCSSInitialValue(this)-&gt;isImplicit();
</del><ins>+    return m_classType == InitialClass &amp;&amp; downcast&lt;CSSInitialValue&gt;(*this).isImplicit();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> CSSValue::Type CSSValue::cssValueType() const
</span><span class="lines">@@ -112,14 +112,14 @@
</span><span class="cx">     // This should get called for internal instances only.
</span><span class="cx">     ASSERT(!isCSSOMSafe());
</span><span class="cx"> 
</span><del>-    if (isPrimitiveValue())
-        toCSSPrimitiveValue(this)-&gt;addSubresourceStyleURLs(urls, styleSheet);
-    else if (isValueList())
-        toCSSValueList(this)-&gt;addSubresourceStyleURLs(urls, styleSheet);
-    else if (classType() == FontFaceSrcClass)
-        toCSSFontFaceSrcValue(this)-&gt;addSubresourceStyleURLs(urls, styleSheet);
-    else if (classType() == ReflectClass)
-        toCSSReflectValue(this)-&gt;addSubresourceStyleURLs(urls, styleSheet);
</del><ins>+    if (is&lt;CSSPrimitiveValue&gt;(*this))
+        downcast&lt;CSSPrimitiveValue&gt;(*this).addSubresourceStyleURLs(urls, styleSheet);
+    else if (is&lt;CSSValueList&gt;(*this))
+        downcast&lt;CSSValueList&gt;(*this).addSubresourceStyleURLs(urls, styleSheet);
+    else if (is&lt;CSSFontFaceSrcValue&gt;(*this))
+        downcast&lt;CSSFontFaceSrcValue&gt;(*this).addSubresourceStyleURLs(urls, styleSheet);
+    else if (is&lt;CSSReflectValue&gt;(*this))
+        downcast&lt;CSSReflectValue&gt;(*this).addSubresourceStyleURLs(urls, styleSheet);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool CSSValue::hasFailedOrCanceledSubresources() const
</span><span class="lines">@@ -127,19 +127,19 @@
</span><span class="cx">     // This should get called for internal instances only.
</span><span class="cx">     ASSERT(!isCSSOMSafe());
</span><span class="cx"> 
</span><del>-    if (isValueList())
-        return toCSSValueList(this)-&gt;hasFailedOrCanceledSubresources();
-    if (classType() == FontFaceSrcClass)
-        return toCSSFontFaceSrcValue(this)-&gt;hasFailedOrCanceledSubresources();
-    if (classType() == ImageClass)
-        return toCSSImageValue(this)-&gt;hasFailedOrCanceledSubresources();
-    if (classType() == CrossfadeClass)
-        return toCSSCrossfadeValue(this)-&gt;hasFailedOrCanceledSubresources();
-    if (classType() == FilterImageClass)
-        return toCSSFilterImageValue(this)-&gt;hasFailedOrCanceledSubresources();
</del><ins>+    if (is&lt;CSSValueList&gt;(*this))
+        return downcast&lt;CSSValueList&gt;(*this).hasFailedOrCanceledSubresources();
+    if (is&lt;CSSFontFaceSrcValue&gt;(*this))
+        return downcast&lt;CSSFontFaceSrcValue&gt;(*this).hasFailedOrCanceledSubresources();
+    if (is&lt;CSSImageValue&gt;(*this))
+        return downcast&lt;CSSImageValue&gt;(*this).hasFailedOrCanceledSubresources();
+    if (is&lt;CSSCrossfadeValue&gt;(*this))
+        return downcast&lt;CSSCrossfadeValue&gt;(*this).hasFailedOrCanceledSubresources();
+    if (is&lt;CSSFilterImageValue&gt;(*this))
+        return downcast&lt;CSSFilterImageValue&gt;(*this).hasFailedOrCanceledSubresources();
</ins><span class="cx"> #if ENABLE(CSS_IMAGE_SET)
</span><del>-    if (classType() == ImageSetClass)
-        return toCSSImageSetValue(this)-&gt;hasFailedOrCanceledSubresources();
</del><ins>+    if (is&lt;CSSImageSetValue&gt;(*this))
+        return downcast&lt;CSSImageSetValue&gt;(*this).hasFailedOrCanceledSubresources();
</ins><span class="cx"> #endif
</span><span class="cx">     return false;
</span><span class="cx"> }
</span><span class="lines">@@ -229,9 +229,9 @@
</span><span class="cx">             ASSERT_NOT_REACHED();
</span><span class="cx">             return false;
</span><span class="cx">         }
</span><del>-    } else if (m_classType == ValueListClass &amp;&amp; other.m_classType != ValueListClass)
-        return toCSSValueList(this)-&gt;equals(other);
-    else if (m_classType != ValueListClass &amp;&amp; other.m_classType == ValueListClass)
</del><ins>+    } else if (is&lt;CSSValueList&gt;(*this) &amp;&amp; !is&lt;CSSValueList&gt;(other))
+        return downcast&lt;CSSValueList&gt;(*this).equals(other);
+    else if (!is&lt;CSSValueList&gt;(*this) &amp;&amp; is&lt;CSSValueList&gt;(other))
</ins><span class="cx">         return static_cast&lt;const CSSValueList&amp;&gt;(other).equals(*this);
</span><span class="cx">     return false;
</span><span class="cx"> }
</span><span class="lines">@@ -246,71 +246,71 @@
</span><span class="cx"> 
</span><span class="cx">     switch (classType()) {
</span><span class="cx">     case AspectRatioClass:
</span><del>-        return toCSSAspectRatioValue(this)-&gt;customCSSText();
</del><ins>+        return downcast&lt;CSSAspectRatioValue&gt;(*this).customCSSText();
</ins><span class="cx">     case BorderImageSliceClass:
</span><del>-        return toCSSBorderImageSliceValue(this)-&gt;customCSSText();
</del><ins>+        return downcast&lt;CSSBorderImageSliceValue&gt;(*this).customCSSText();
</ins><span class="cx">     case CanvasClass:
</span><del>-        return toCSSCanvasValue(this)-&gt;customCSSText();
</del><ins>+        return downcast&lt;CSSCanvasValue&gt;(*this).customCSSText();
</ins><span class="cx">     case CursorImageClass:
</span><del>-        return toCSSCursorImageValue(this)-&gt;customCSSText();
</del><ins>+        return downcast&lt;CSSCursorImageValue&gt;(*this).customCSSText();
</ins><span class="cx">     case FilterImageClass:
</span><del>-        return toCSSFilterImageValue(this)-&gt;customCSSText();
</del><ins>+        return downcast&lt;CSSFilterImageValue&gt;(*this).customCSSText();
</ins><span class="cx">     case FontClass:
</span><del>-        return toCSSFontValue(this)-&gt;customCSSText();
</del><ins>+        return downcast&lt;CSSFontValue&gt;(*this).customCSSText();
</ins><span class="cx">     case FontFaceSrcClass:
</span><del>-        return toCSSFontFaceSrcValue(this)-&gt;customCSSText();
</del><ins>+        return downcast&lt;CSSFontFaceSrcValue&gt;(*this).customCSSText();
</ins><span class="cx">     case FontFeatureClass:
</span><del>-        return toCSSFontFeatureValue(this)-&gt;customCSSText();
</del><ins>+        return downcast&lt;CSSFontFeatureValue&gt;(*this).customCSSText();
</ins><span class="cx">     case FunctionClass:
</span><del>-        return toCSSFunctionValue(this)-&gt;customCSSText();
</del><ins>+        return downcast&lt;CSSFunctionValue&gt;(*this).customCSSText();
</ins><span class="cx">     case LinearGradientClass:
</span><del>-        return toCSSLinearGradientValue(this)-&gt;customCSSText();
</del><ins>+        return downcast&lt;CSSLinearGradientValue&gt;(*this).customCSSText();
</ins><span class="cx">     case RadialGradientClass:
</span><del>-        return toCSSRadialGradientValue(this)-&gt;customCSSText();
</del><ins>+        return downcast&lt;CSSRadialGradientValue&gt;(*this).customCSSText();
</ins><span class="cx">     case CrossfadeClass:
</span><del>-        return toCSSCrossfadeValue(this)-&gt;customCSSText();
</del><ins>+        return downcast&lt;CSSCrossfadeValue&gt;(*this).customCSSText();
</ins><span class="cx">     case ImageClass:
</span><del>-        return toCSSImageValue(this)-&gt;customCSSText();
</del><ins>+        return downcast&lt;CSSImageValue&gt;(*this).customCSSText();
</ins><span class="cx">     case InheritedClass:
</span><del>-        return toCSSInheritedValue(this)-&gt;customCSSText();
</del><ins>+        return downcast&lt;CSSInheritedValue&gt;(*this).customCSSText();
</ins><span class="cx">     case InitialClass:
</span><del>-        return toCSSInitialValue(this)-&gt;customCSSText();
</del><ins>+        return downcast&lt;CSSInitialValue&gt;(*this).customCSSText();
</ins><span class="cx"> #if ENABLE(CSS_GRID_LAYOUT)
</span><span class="cx">     case GridLineNamesClass:
</span><del>-        return toCSSGridLineNamesValue(this)-&gt;customCSSText();
</del><ins>+        return downcast&lt;CSSGridLineNamesValue&gt;(*this).customCSSText();
</ins><span class="cx">     case GridTemplateAreasClass:
</span><del>-        return toCSSGridTemplateAreasValue(this)-&gt;customCSSText();
</del><ins>+        return downcast&lt;CSSGridTemplateAreasValue&gt;(*this).customCSSText();
</ins><span class="cx"> #endif
</span><span class="cx">     case PrimitiveClass:
</span><del>-        return toCSSPrimitiveValue(this)-&gt;customCSSText();
</del><ins>+        return downcast&lt;CSSPrimitiveValue&gt;(*this).customCSSText();
</ins><span class="cx">     case ReflectClass:
</span><del>-        return toCSSReflectValue(this)-&gt;customCSSText();
</del><ins>+        return downcast&lt;CSSReflectValue&gt;(*this).customCSSText();
</ins><span class="cx">     case ShadowClass:
</span><del>-        return toCSSShadowValue(this)-&gt;customCSSText();
</del><ins>+        return downcast&lt;CSSShadowValue&gt;(*this).customCSSText();
</ins><span class="cx">     case CubicBezierTimingFunctionClass:
</span><del>-        return toCSSCubicBezierTimingFunctionValue(this)-&gt;customCSSText();
</del><ins>+        return downcast&lt;CSSCubicBezierTimingFunctionValue&gt;(*this).customCSSText();
</ins><span class="cx">     case StepsTimingFunctionClass:
</span><del>-        return toCSSStepsTimingFunctionValue(this)-&gt;customCSSText();
</del><ins>+        return downcast&lt;CSSStepsTimingFunctionValue&gt;(*this).customCSSText();
</ins><span class="cx">     case UnicodeRangeClass:
</span><del>-        return toCSSUnicodeRangeValue(this)-&gt;customCSSText();
</del><ins>+        return downcast&lt;CSSUnicodeRangeValue&gt;(*this).customCSSText();
</ins><span class="cx">     case ValueListClass:
</span><del>-        return toCSSValueList(this)-&gt;customCSSText();
</del><ins>+        return downcast&lt;CSSValueList&gt;(*this).customCSSText();
</ins><span class="cx">     case WebKitCSSTransformClass:
</span><del>-        return toWebKitCSSTransformValue(this)-&gt;customCSSText();
</del><ins>+        return downcast&lt;WebKitCSSTransformValue&gt;(*this).customCSSText();
</ins><span class="cx">     case LineBoxContainClass:
</span><del>-        return toCSSLineBoxContainValue(this)-&gt;customCSSText();
</del><ins>+        return downcast&lt;CSSLineBoxContainValue&gt;(*this).customCSSText();
</ins><span class="cx">     case CalculationClass:
</span><del>-        return toCSSCalcValue(this)-&gt;customCSSText();
</del><ins>+        return downcast&lt;CSSCalcValue&gt;(*this).customCSSText();
</ins><span class="cx"> #if ENABLE(CSS_IMAGE_SET)
</span><span class="cx">     case ImageSetClass:
</span><del>-        return toCSSImageSetValue(this)-&gt;customCSSText();
</del><ins>+        return downcast&lt;CSSImageSetValue&gt;(*this).customCSSText();
</ins><span class="cx"> #endif
</span><span class="cx">     case WebKitCSSFilterClass:
</span><del>-        return toWebKitCSSFilterValue(this)-&gt;customCSSText();
</del><ins>+        return downcast&lt;WebKitCSSFilterValue&gt;(*this).customCSSText();
</ins><span class="cx">     case SVGColorClass:
</span><del>-        return toSVGColor(this)-&gt;customCSSText();
</del><ins>+        return downcast&lt;SVGColor&gt;(*this).customCSSText();
</ins><span class="cx">     case SVGPaintClass:
</span><del>-        return toSVGPaint(this)-&gt;customCSSText();
</del><ins>+        return downcast&lt;SVGPaint&gt;(*this).customCSSText();
</ins><span class="cx">     }
</span><span class="cx">     ASSERT_NOT_REACHED();
</span><span class="cx">     return String();
</span><span class="lines">@@ -327,101 +327,101 @@
</span><span class="cx"> 
</span><span class="cx">     switch (classType()) {
</span><span class="cx">     case AspectRatioClass:
</span><del>-        delete toCSSAspectRatioValue(this);
</del><ins>+        delete downcast&lt;CSSAspectRatioValue&gt;(this);
</ins><span class="cx">         return;
</span><span class="cx">     case BorderImageSliceClass:
</span><del>-        delete toCSSBorderImageSliceValue(this);
</del><ins>+        delete downcast&lt;CSSBorderImageSliceValue&gt;(this);
</ins><span class="cx">         return;
</span><span class="cx">     case CanvasClass:
</span><del>-        delete toCSSCanvasValue(this);
</del><ins>+        delete downcast&lt;CSSCanvasValue&gt;(this);
</ins><span class="cx">         return;
</span><span class="cx">     case CursorImageClass:
</span><del>-        delete toCSSCursorImageValue(this);
</del><ins>+        delete downcast&lt;CSSCursorImageValue&gt;(this);
</ins><span class="cx">         return;
</span><span class="cx">     case FontClass:
</span><del>-        delete toCSSFontValue(this);
</del><ins>+        delete downcast&lt;CSSFontValue&gt;(this);
</ins><span class="cx">         return;
</span><span class="cx">     case FontFaceSrcClass:
</span><del>-        delete toCSSFontFaceSrcValue(this);
</del><ins>+        delete downcast&lt;CSSFontFaceSrcValue&gt;(this);
</ins><span class="cx">         return;
</span><span class="cx">     case FontFeatureClass:
</span><del>-        delete toCSSFontFeatureValue(this);
</del><ins>+        delete downcast&lt;CSSFontFeatureValue&gt;(this);
</ins><span class="cx">         return;
</span><span class="cx">     case FunctionClass:
</span><del>-        delete toCSSFunctionValue(this);
</del><ins>+        delete downcast&lt;CSSFunctionValue&gt;(this);
</ins><span class="cx">         return;
</span><span class="cx">     case LinearGradientClass:
</span><del>-        delete toCSSLinearGradientValue(this);
</del><ins>+        delete downcast&lt;CSSLinearGradientValue&gt;(this);
</ins><span class="cx">         return;
</span><span class="cx">     case RadialGradientClass:
</span><del>-        delete toCSSRadialGradientValue(this);
</del><ins>+        delete downcast&lt;CSSRadialGradientValue&gt;(this);
</ins><span class="cx">         return;
</span><span class="cx">     case CrossfadeClass:
</span><del>-        delete toCSSCrossfadeValue(this);
</del><ins>+        delete downcast&lt;CSSCrossfadeValue&gt;(this);
</ins><span class="cx">         return;
</span><span class="cx">     case ImageClass:
</span><del>-        delete toCSSImageValue(this);
</del><ins>+        delete downcast&lt;CSSImageValue&gt;(this);
</ins><span class="cx">         return;
</span><span class="cx">     case InheritedClass:
</span><del>-        delete toCSSInheritedValue(this);
</del><ins>+        delete downcast&lt;CSSInheritedValue&gt;(this);
</ins><span class="cx">         return;
</span><span class="cx">     case InitialClass:
</span><del>-        delete toCSSInitialValue(this);
</del><ins>+        delete downcast&lt;CSSInitialValue&gt;(this);
</ins><span class="cx">         return;
</span><span class="cx"> #if ENABLE(CSS_GRID_LAYOUT)
</span><span class="cx">     case GridLineNamesClass:
</span><del>-        delete toCSSGridLineNamesValue(this);
</del><ins>+        delete downcast&lt;CSSGridLineNamesValue&gt;(this);
</ins><span class="cx">         return;
</span><span class="cx">     case GridTemplateAreasClass:
</span><del>-        delete toCSSGridTemplateAreasValue(this);
</del><ins>+        delete downcast&lt;CSSGridTemplateAreasValue&gt;(this);
</ins><span class="cx">         return;
</span><span class="cx"> #endif
</span><span class="cx">     case PrimitiveClass:
</span><del>-        delete toCSSPrimitiveValue(this);
</del><ins>+        delete downcast&lt;CSSPrimitiveValue&gt;(this);
</ins><span class="cx">         return;
</span><span class="cx">     case ReflectClass:
</span><del>-        delete toCSSReflectValue(this);
</del><ins>+        delete downcast&lt;CSSReflectValue&gt;(this);
</ins><span class="cx">         return;
</span><span class="cx">     case ShadowClass:
</span><del>-        delete toCSSShadowValue(this);
</del><ins>+        delete downcast&lt;CSSShadowValue&gt;(this);
</ins><span class="cx">         return;
</span><span class="cx">     case CubicBezierTimingFunctionClass:
</span><del>-        delete toCSSCubicBezierTimingFunctionValue(this);
</del><ins>+        delete downcast&lt;CSSCubicBezierTimingFunctionValue&gt;(this);
</ins><span class="cx">         return;
</span><span class="cx">     case StepsTimingFunctionClass:
</span><del>-        delete toCSSStepsTimingFunctionValue(this);
</del><ins>+        delete downcast&lt;CSSStepsTimingFunctionValue&gt;(this);
</ins><span class="cx">         return;
</span><span class="cx">     case UnicodeRangeClass:
</span><del>-        delete toCSSUnicodeRangeValue(this);
</del><ins>+        delete downcast&lt;CSSUnicodeRangeValue&gt;(this);
</ins><span class="cx">         return;
</span><span class="cx">     case ValueListClass:
</span><del>-        delete toCSSValueList(this);
</del><ins>+        delete downcast&lt;CSSValueList&gt;(this);
</ins><span class="cx">         return;
</span><span class="cx">     case WebKitCSSTransformClass:
</span><del>-        delete toWebKitCSSTransformValue(this);
</del><ins>+        delete downcast&lt;WebKitCSSTransformValue&gt;(this);
</ins><span class="cx">         return;
</span><span class="cx">     case LineBoxContainClass:
</span><del>-        delete toCSSLineBoxContainValue(this);
</del><ins>+        delete downcast&lt;CSSLineBoxContainValue&gt;(this);
</ins><span class="cx">         return;
</span><span class="cx">     case CalculationClass:
</span><del>-        delete toCSSCalcValue(this);
</del><ins>+        delete downcast&lt;CSSCalcValue&gt;(this);
</ins><span class="cx">         return;
</span><span class="cx"> #if ENABLE(CSS_IMAGE_SET)
</span><span class="cx">     case ImageSetClass:
</span><del>-        delete toCSSImageSetValue(this);
</del><ins>+        delete downcast&lt;CSSImageSetValue&gt;(this);
</ins><span class="cx">         return;
</span><span class="cx"> #endif
</span><span class="cx">     case FilterImageClass:
</span><del>-        delete toCSSFilterImageValue(this);
</del><ins>+        delete downcast&lt;CSSFilterImageValue&gt;(this);
</ins><span class="cx">         return;
</span><span class="cx">     case WebKitCSSFilterClass:
</span><del>-        delete toWebKitCSSFilterValue(this);
</del><ins>+        delete downcast&lt;WebKitCSSFilterValue&gt;(this);
</ins><span class="cx">         return;
</span><span class="cx">     case SVGColorClass:
</span><del>-        delete toSVGColor(this);
</del><ins>+        delete downcast&lt;SVGColor&gt;(this);
</ins><span class="cx">         return;
</span><span class="cx">     case SVGPaintClass:
</span><del>-        delete toSVGPaint(this);
</del><ins>+        delete downcast&lt;SVGPaint&gt;(this);
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx">     ASSERT_NOT_REACHED();
</span><span class="lines">@@ -431,24 +431,24 @@
</span><span class="cx"> {
</span><span class="cx">     switch (classType()) {
</span><span class="cx">     case PrimitiveClass:
</span><del>-        return toCSSPrimitiveValue(this)-&gt;cloneForCSSOM();
</del><ins>+        return downcast&lt;CSSPrimitiveValue&gt;(*this).cloneForCSSOM();
</ins><span class="cx">     case ValueListClass:
</span><del>-        return toCSSValueList(this)-&gt;cloneForCSSOM();
</del><ins>+        return downcast&lt;CSSValueList&gt;(*this).cloneForCSSOM();
</ins><span class="cx">     case ImageClass:
</span><span class="cx">     case CursorImageClass:
</span><del>-        return toCSSImageValue(this)-&gt;cloneForCSSOM();
</del><ins>+        return downcast&lt;CSSImageValue&gt;(*this).cloneForCSSOM();
</ins><span class="cx">     case WebKitCSSFilterClass:
</span><del>-        return toWebKitCSSFilterValue(this)-&gt;cloneForCSSOM();
</del><ins>+        return downcast&lt;WebKitCSSFilterValue&gt;(*this).cloneForCSSOM();
</ins><span class="cx">     case WebKitCSSTransformClass:
</span><del>-        return toWebKitCSSTransformValue(this)-&gt;cloneForCSSOM();
</del><ins>+        return downcast&lt;WebKitCSSTransformValue&gt;(*this).cloneForCSSOM();
</ins><span class="cx"> #if ENABLE(CSS_IMAGE_SET)
</span><span class="cx">     case ImageSetClass:
</span><del>-        return toCSSImageSetValue(this)-&gt;cloneForCSSOM();
</del><ins>+        return downcast&lt;CSSImageSetValue&gt;(*this).cloneForCSSOM();
</ins><span class="cx"> #endif
</span><span class="cx">     case SVGColorClass:
</span><del>-        return toSVGColor(this)-&gt;cloneForCSSOM();
</del><ins>+        return downcast&lt;SVGColor&gt;(*this).cloneForCSSOM();
</ins><span class="cx">     case SVGPaintClass:
</span><del>-        return toSVGPaint(this)-&gt;cloneForCSSOM();
</del><ins>+        return downcast&lt;SVGPaint&gt;(*this).cloneForCSSOM();
</ins><span class="cx">     default:
</span><span class="cx">         ASSERT(!isSubtypeExposedToCSSOM());
</span><span class="cx">         return TextCloneCSSValue::create(classType(), cssText());
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSValueh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSValue.h (174299 => 174300)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSValue.h        2014-10-03 23:05:07 UTC (rev 174299)
+++ trunk/Source/WebCore/css/CSSValue.h        2014-10-03 23:17:00 UTC (rev 174300)
</span><span class="lines">@@ -26,6 +26,7 @@
</span><span class="cx"> #include &lt;wtf/ListHashSet.h&gt;
</span><span class="cx"> #include &lt;wtf/RefCounted.h&gt;
</span><span class="cx"> #include &lt;wtf/RefPtr.h&gt;
</span><ins>+#include &lt;wtf/TypeCasts.h&gt;
</ins><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="lines">@@ -249,9 +250,11 @@
</span><span class="cx">     return first.get().equals(second.get());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-#define CSS_VALUE_TYPE_CASTS(ToValueTypeName, predicate) \
-    TYPE_CASTS_BASE(ToValueTypeName, CSSValue, value, value-&gt;predicate, value.predicate)
-
</del><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><ins>+#define SPECIALIZE_TYPE_TRAITS_CSS_VALUE(ToValueTypeName, predicate) \
+SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::ToValueTypeName) \
+    static bool isType(const WebCore::CSSValue&amp; value) { return value.predicate; } \
+SPECIALIZE_TYPE_TRAITS_END()
+
</ins><span class="cx"> #endif // CSSValue_h
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSValueListh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSValueList.h (174299 => 174300)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSValueList.h        2014-10-03 23:05:07 UTC (rev 174299)
+++ trunk/Source/WebCore/css/CSSValueList.h        2014-10-03 23:17:00 UTC (rev 174300)
</span><span class="lines">@@ -81,8 +81,6 @@
</span><span class="cx">     Vector&lt;Ref&lt;CSSValue&gt;, 4&gt; m_values;
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-CSS_VALUE_TYPE_CASTS(CSSValueList, isValueList())
-
</del><span class="cx"> inline void CSSValueList::append(PassRef&lt;CSSValue&gt; value)
</span><span class="cx"> {
</span><span class="cx">     m_values.append(WTF::move(value));
</span><span class="lines">@@ -97,7 +95,11 @@
</span><span class="cx"> // Please take care not to pass these around as they do hold onto a raw pointer.
</span><span class="cx"> class CSSValueListInspector {
</span><span class="cx"> public:
</span><del>-    CSSValueListInspector(CSSValue* value) : m_list((value &amp;&amp; value-&gt;isValueList()) ? toCSSValueList(value) : 0) { }
</del><ins>+    CSSValueListInspector(CSSValue* value)
+        : m_list(is&lt;CSSValueList&gt;(value) ? downcast&lt;CSSValueList&gt;(value) : nullptr)
+    {
+    }
+
</ins><span class="cx">     CSSValue* item(size_t index) const { ASSERT_WITH_SECURITY_IMPLICATION(index &lt; length()); return m_list-&gt;itemWithoutBoundsCheck(index); }
</span><span class="cx">     CSSValue* first() const { return item(0); }
</span><span class="cx">     CSSValue* second() const { return item(1); }
</span><span class="lines">@@ -123,4 +125,6 @@
</span><span class="cx"> };
</span><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><ins>+SPECIALIZE_TYPE_TRAITS_CSS_VALUE(CSSValueList, isValueList())
+
</ins><span class="cx"> #endif // CSSValueList_h
</span></span></pre></div>
<a id="trunkSourceWebCorecssDeprecatedStyleBuildercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/DeprecatedStyleBuilder.cpp (174299 => 174300)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/DeprecatedStyleBuilder.cpp        2014-10-03 23:05:07 UTC (rev 174299)
+++ trunk/Source/WebCore/css/DeprecatedStyleBuilder.cpp        2014-10-03 23:17:00 UTC (rev 174300)
</span><span class="lines">@@ -32,6 +32,7 @@
</span><span class="cx"> #include &quot;CSSAspectRatioValue.h&quot;
</span><span class="cx"> #include &quot;CSSCalculationValue.h&quot;
</span><span class="cx"> #include &quot;CSSCursorImageValue.h&quot;
</span><ins>+#include &quot;CSSImageSetValue.h&quot;
</ins><span class="cx"> #include &quot;CSSPrimitiveValue.h&quot;
</span><span class="cx"> #include &quot;CSSPrimitiveValueMappings.h&quot;
</span><span class="cx"> #include &quot;CSSToStyleMap.h&quot;
</span><span class="lines">@@ -149,8 +150,8 @@
</span><span class="cx">     static void setValue(RenderStyle* style, SetterType value) { (style-&gt;*setterFunction)(value); }
</span><span class="cx">     static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
</span><span class="cx">     {
</span><del>-        if (value-&gt;isPrimitiveValue())
-            setValue(styleResolver-&gt;style(), *toCSSPrimitiveValue(value));
</del><ins>+        if (is&lt;CSSPrimitiveValue&gt;(*value))
+            setValue(styleResolver-&gt;style(), downcast&lt;CSSPrimitiveValue&gt;(*value));
</ins><span class="cx">     }
</span><span class="cx">     static PropertyHandler createHandler()
</span><span class="cx">     {
</span><span class="lines">@@ -165,14 +166,14 @@
</span><span class="cx">     static void setValue(RenderStyle* style, NumberType value) { (style-&gt;*setterFunction)(value); }
</span><span class="cx">     static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
</span><span class="cx">     {
</span><del>-        if (!value-&gt;isPrimitiveValue())
</del><ins>+        if (!is&lt;CSSPrimitiveValue&gt;(*value))
</ins><span class="cx">             return;
</span><span class="cx"> 
</span><del>-        CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
-        if (primitiveValue-&gt;getValueID() == idMapsToMinusOne)
</del><ins>+        CSSPrimitiveValue&amp; primitiveValue = downcast&lt;CSSPrimitiveValue&gt;(*value);
+        if (primitiveValue.getValueID() == idMapsToMinusOne)
</ins><span class="cx">             setValue(styleResolver-&gt;style(), -1);
</span><span class="cx">         else
</span><del>-            setValue(styleResolver-&gt;style(), primitiveValue-&gt;getValue&lt;NumberType&gt;(CSSPrimitiveValue::CSS_NUMBER));
</del><ins>+            setValue(styleResolver-&gt;style(), primitiveValue.getValue&lt;NumberType&gt;(CSSPrimitiveValue::CSS_NUMBER));
</ins><span class="cx">     }
</span><span class="cx">     static PropertyHandler createHandler()
</span><span class="cx">     {
</span><span class="lines">@@ -213,16 +214,16 @@
</span><span class="cx"> 
</span><span class="cx">     static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
</span><span class="cx">     {
</span><del>-        if (!value-&gt;isPrimitiveValue())
</del><ins>+        if (!is&lt;CSSPrimitiveValue&gt;(*value))
</ins><span class="cx">             return;
</span><span class="cx"> 
</span><del>-        CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
-        if (primitiveValue-&gt;getValueID() == autoIdentity)
</del><ins>+        CSSPrimitiveValue&amp; primitiveValue = downcast&lt;CSSPrimitiveValue&gt;(*value);
+        if (primitiveValue.getValueID() == autoIdentity)
</ins><span class="cx">             setAuto(styleResolver-&gt;style());
</span><span class="cx">         else if (valueType == Number)
</span><del>-            setValue(styleResolver-&gt;style(), *primitiveValue);
</del><ins>+            setValue(styleResolver-&gt;style(), primitiveValue);
</ins><span class="cx">         else if (valueType == ComputeLength)
</span><del>-            setValue(styleResolver-&gt;style(), primitiveValue-&gt;computeLength&lt;T&gt;(styleResolver-&gt;state().cssToLengthConversionData()));
</del><ins>+            setValue(styleResolver-&gt;style(), primitiveValue.computeLength&lt;T&gt;(styleResolver-&gt;state().cssToLengthConversionData()));
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     static PropertyHandler createHandler() { return PropertyHandler(&amp;applyInheritValue, &amp;applyInitialValue, &amp;applyValue); }
</span><span class="lines">@@ -252,19 +253,19 @@
</span><span class="cx"> 
</span><span class="cx">     static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
</span><span class="cx">     {
</span><del>-        if (!value-&gt;isPrimitiveValue())
</del><ins>+        if (!is&lt;CSSPrimitiveValue&gt;(*value))
</ins><span class="cx">             return;
</span><span class="cx"> 
</span><del>-        CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
</del><ins>+        CSSPrimitiveValue&amp; primitiveValue = downcast&lt;CSSPrimitiveValue&gt;(*value);
</ins><span class="cx"> 
</span><del>-        if (Rect* rect = primitiveValue-&gt;getRectValue()) {
</del><ins>+        if (Rect* rect = primitiveValue.getRectValue()) {
</ins><span class="cx">             Length top = convertToLength(styleResolver, rect-&gt;top());
</span><span class="cx">             Length right = convertToLength(styleResolver, rect-&gt;right());
</span><span class="cx">             Length bottom = convertToLength(styleResolver, rect-&gt;bottom());
</span><span class="cx">             Length left = convertToLength(styleResolver, rect-&gt;left());
</span><span class="cx">             styleResolver-&gt;style()-&gt;setClip(top, right, bottom, left);
</span><span class="cx">             styleResolver-&gt;style()-&gt;setHasClip(true);
</span><del>-        } else if (primitiveValue-&gt;getValueID() == CSSValueAuto) {
</del><ins>+        } else if (primitiveValue.getValueID() == CSSValueAuto) {
</ins><span class="cx">             styleResolver-&gt;style()-&gt;setClip(Length(), Length(), Length(), Length());
</span><span class="cx">             styleResolver-&gt;style()-&gt;setHasClip(false);
</span><span class="cx">         }
</span><span class="lines">@@ -298,17 +299,17 @@
</span><span class="cx"> 
</span><span class="cx">     static void applyValue(CSSPropertyID propertyID, StyleResolver* styleResolver, CSSValue* value)
</span><span class="cx">     {
</span><del>-        if (!value-&gt;isPrimitiveValue())
</del><ins>+        if (!is&lt;CSSPrimitiveValue&gt;(*value))
</ins><span class="cx">             return;
</span><span class="cx"> 
</span><del>-        CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
-        if (inheritColorFromParent &amp;&amp; primitiveValue-&gt;getValueID() == CSSValueCurrentcolor)
</del><ins>+        CSSPrimitiveValue&amp; primitiveValue = downcast&lt;CSSPrimitiveValue&gt;(*value);
+        if (inheritColorFromParent &amp;&amp; primitiveValue.getValueID() == CSSValueCurrentcolor)
</ins><span class="cx">             applyInheritValue(propertyID, styleResolver);
</span><span class="cx">         else {
</span><span class="cx">             if (styleResolver-&gt;applyPropertyToRegularStyle())
</span><del>-                (styleResolver-&gt;style()-&gt;*setterFunction)(styleResolver-&gt;colorFromPrimitiveValue(primitiveValue));
</del><ins>+                (styleResolver-&gt;style()-&gt;*setterFunction)(styleResolver-&gt;colorFromPrimitiveValue(&amp;primitiveValue));
</ins><span class="cx">             if (styleResolver-&gt;applyPropertyToVisitedLinkStyle())
</span><del>-                (styleResolver-&gt;style()-&gt;*visitedLinkSetterFunction)(styleResolver-&gt;colorFromPrimitiveValue(primitiveValue, /* forVisitedLink */ true));
</del><ins>+                (styleResolver-&gt;style()-&gt;*visitedLinkSetterFunction)(styleResolver-&gt;colorFromPrimitiveValue(&amp;primitiveValue, /* forVisitedLink */ true));
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -359,46 +360,46 @@
</span><span class="cx">     static void setValue(RenderStyle* style, Length value) { (style-&gt;*setterFunction)(WTF::move(value)); }
</span><span class="cx">     static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
</span><span class="cx">     {
</span><del>-        if (!value-&gt;isPrimitiveValue())
</del><ins>+        if (!is&lt;CSSPrimitiveValue&gt;(*value))
</ins><span class="cx">             return;
</span><span class="cx"> 
</span><del>-        CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
-        if (noneEnabled &amp;&amp; primitiveValue-&gt;getValueID() == CSSValueNone) {
</del><ins>+        CSSPrimitiveValue&amp; primitiveValue = downcast&lt;CSSPrimitiveValue&gt;(*value);
+        if (noneEnabled &amp;&amp; primitiveValue.getValueID() == CSSValueNone) {
</ins><span class="cx">             if (noneUndefined)
</span><span class="cx">                 setValue(styleResolver-&gt;style(), Length(Undefined));
</span><span class="cx">             else
</span><span class="cx">                 setValue(styleResolver-&gt;style(), Length());
</span><span class="cx">         }
</span><span class="cx">         if (legacyIntrinsicEnabled) {
</span><del>-            if (primitiveValue-&gt;getValueID() == CSSValueIntrinsic)
</del><ins>+            if (primitiveValue.getValueID() == CSSValueIntrinsic)
</ins><span class="cx">                 setValue(styleResolver-&gt;style(), Length(Intrinsic));
</span><del>-            else if (primitiveValue-&gt;getValueID() == CSSValueMinIntrinsic)
</del><ins>+            else if (primitiveValue.getValueID() == CSSValueMinIntrinsic)
</ins><span class="cx">                 setValue(styleResolver-&gt;style(), Length(MinIntrinsic));
</span><span class="cx">         }
</span><span class="cx">         if (intrinsicEnabled) {
</span><del>-            if (primitiveValue-&gt;getValueID() == CSSValueWebkitMinContent)
</del><ins>+            if (primitiveValue.getValueID() == CSSValueWebkitMinContent)
</ins><span class="cx">                 setValue(styleResolver-&gt;style(), Length(MinContent));
</span><del>-            else if (primitiveValue-&gt;getValueID() == CSSValueWebkitMaxContent)
</del><ins>+            else if (primitiveValue.getValueID() == CSSValueWebkitMaxContent)
</ins><span class="cx">                 setValue(styleResolver-&gt;style(), Length(MaxContent));
</span><del>-            else if (primitiveValue-&gt;getValueID() == CSSValueWebkitFillAvailable)
</del><ins>+            else if (primitiveValue.getValueID() == CSSValueWebkitFillAvailable)
</ins><span class="cx">                 setValue(styleResolver-&gt;style(), Length(FillAvailable));
</span><del>-            else if (primitiveValue-&gt;getValueID() == CSSValueWebkitFitContent)
</del><ins>+            else if (primitiveValue.getValueID() == CSSValueWebkitFitContent)
</ins><span class="cx">                 setValue(styleResolver-&gt;style(), Length(FitContent));
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         CSSToLengthConversionData conversionData = styleResolver-&gt;useSVGZoomRulesForLength() ?
</span><span class="cx">             styleResolver-&gt;state().cssToLengthConversionData().copyWithAdjustedZoom(1.0f)
</span><span class="cx">             : styleResolver-&gt;state().cssToLengthConversionData();
</span><del>-        if (autoEnabled &amp;&amp; primitiveValue-&gt;getValueID() == CSSValueAuto)
</del><ins>+        if (autoEnabled &amp;&amp; primitiveValue.getValueID() == CSSValueAuto)
</ins><span class="cx">             setValue(styleResolver-&gt;style(), Length());
</span><del>-        else if (primitiveValue-&gt;isLength()) {
-            Length length = primitiveValue-&gt;computeLength&lt;Length&gt;(conversionData);
-            length.setHasQuirk(primitiveValue-&gt;isQuirkValue());
</del><ins>+        else if (primitiveValue.isLength()) {
+            Length length = primitiveValue.computeLength&lt;Length&gt;(conversionData);
+            length.setHasQuirk(primitiveValue.isQuirkValue());
</ins><span class="cx">             setValue(styleResolver-&gt;style(), length);
</span><del>-        } else if (primitiveValue-&gt;isPercentage())
-            setValue(styleResolver-&gt;style(), Length(primitiveValue-&gt;getDoubleValue(), Percent));
-        else if (primitiveValue-&gt;isCalculatedPercentageWithLength())
-            setValue(styleResolver-&gt;style(), Length(primitiveValue-&gt;cssCalcValue()-&gt;createCalculationValue(conversionData)));
</del><ins>+        } else if (primitiveValue.isPercentage())
+            setValue(styleResolver-&gt;style(), Length(primitiveValue.getDoubleValue(), Percent));
+        else if (primitiveValue.isCalculatedPercentageWithLength())
+            setValue(styleResolver-&gt;style(), Length(primitiveValue.cssCalcValue()-&gt;createCalculationValue(conversionData)));
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     static PropertyHandler createHandler()
</span><span class="lines">@@ -415,14 +416,14 @@
</span><span class="cx">     static void setValue(RenderStyle* style, const AtomicString&amp; value) { (style-&gt;*setterFunction)(value); }
</span><span class="cx">     static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
</span><span class="cx">     {
</span><del>-        if (!value-&gt;isPrimitiveValue())
</del><ins>+        if (!is&lt;CSSPrimitiveValue&gt;(*value))
</ins><span class="cx">             return;
</span><del>-        CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
-        if ((identBehavior == MapNoneToNull &amp;&amp; primitiveValue-&gt;getValueID() == CSSValueNone)
-            || (identBehavior == MapAutoToNull &amp;&amp; primitiveValue-&gt;getValueID() == CSSValueAuto))
</del><ins>+        CSSPrimitiveValue&amp; primitiveValue = downcast&lt;CSSPrimitiveValue&gt;(*value);
+        if ((identBehavior == MapNoneToNull &amp;&amp; primitiveValue.getValueID() == CSSValueNone)
+            || (identBehavior == MapAutoToNull &amp;&amp; primitiveValue.getValueID() == CSSValueAuto))
</ins><span class="cx">             setValue(styleResolver-&gt;style(), nullAtom);
</span><span class="cx">         else
</span><del>-            setValue(styleResolver-&gt;style(), primitiveValue-&gt;getStringValue());
</del><ins>+            setValue(styleResolver-&gt;style(), primitiveValue.getStringValue());
</ins><span class="cx">     }
</span><span class="cx">     static PropertyHandler createHandler()
</span><span class="cx">     {
</span><span class="lines">@@ -437,11 +438,11 @@
</span><span class="cx">     static void setValue(RenderStyle* style, LengthSize value) { (style-&gt;*setterFunction)(WTF::move(value)); }
</span><span class="cx">     static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
</span><span class="cx">     {
</span><del>-        if (!value-&gt;isPrimitiveValue())
</del><ins>+        if (!is&lt;CSSPrimitiveValue&gt;(*value))
</ins><span class="cx">             return;
</span><span class="cx"> 
</span><del>-        CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
-        Pair* pair = primitiveValue-&gt;getPairValue();
</del><ins>+        CSSPrimitiveValue&amp; primitiveValue = downcast&lt;CSSPrimitiveValue&gt;(*value);
+        Pair* pair = primitiveValue.getPairValue();
</ins><span class="cx">         if (!pair || !pair-&gt;first() || !pair-&gt;second())
</span><span class="cx">             return;
</span><span class="cx"> 
</span><span class="lines">@@ -552,13 +553,13 @@
</span><span class="cx">     {
</span><span class="cx">         FillLayer* child = (styleResolver-&gt;style()-&gt;*accessLayersFunction)();
</span><span class="cx">         FillLayer* previousChild = nullptr;
</span><del>-        if (value-&gt;isValueList()
</del><ins>+        if (is&lt;CSSValueList&gt;(*value)
</ins><span class="cx"> #if ENABLE(CSS_IMAGE_SET)
</span><del>-        &amp;&amp; !value-&gt;isImageSetValue()
</del><ins>+        &amp;&amp; !is&lt;CSSImageSetValue&gt;(*value)
</ins><span class="cx"> #endif
</span><span class="cx">         ) {
</span><span class="cx">             // Walk each value and put it into a layer, creating new layers as needed.
</span><del>-            CSSValueList&amp; valueList = toCSSValueList(*value);
</del><ins>+            CSSValueList&amp; valueList = downcast&lt;CSSValueList&gt;(*value);
</ins><span class="cx">             for (unsigned i = 0; i &lt; valueList.length(); i++) {
</span><span class="cx">                 if (!child) {
</span><span class="cx">                     previousChild-&gt;setNext(std::make_unique&lt;FillLayer&gt;(fillLayerType));
</span><span class="lines">@@ -595,12 +596,12 @@
</span><span class="cx">     static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
</span><span class="cx">     {
</span><span class="cx">         // note: CSSPropertyLetter/WordSpacing right now sets to zero if it's not a primitive value for some reason...
</span><del>-        if (!value-&gt;isPrimitiveValue())
</del><ins>+        if (!is&lt;CSSPrimitiveValue&gt;(*value))
</ins><span class="cx">             return;
</span><span class="cx"> 
</span><del>-        CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
</del><ins>+        CSSPrimitiveValue&amp; primitiveValue = downcast&lt;CSSPrimitiveValue&gt;(*value);
</ins><span class="cx"> 
</span><del>-        CSSValueID ident = primitiveValue-&gt;getValueID();
</del><ins>+        CSSValueID ident = primitiveValue.getValueID();
</ins><span class="cx">         T length;
</span><span class="cx">         if (normalEnabled &amp;&amp; ident == CSSValueNormal) {
</span><span class="cx">             length = 0;
</span><span class="lines">@@ -615,9 +616,9 @@
</span><span class="cx"> 
</span><span class="cx">             // Any original result that was &gt;= 1 should not be allowed to fall below 1.
</span><span class="cx">             // This keeps border lines from vanishing.
</span><del>-            length = primitiveValue-&gt;computeLength&lt;T&gt;(conversionData);
</del><ins>+            length = primitiveValue.computeLength&lt;T&gt;(conversionData);
</ins><span class="cx">             if (conversionData.zoom() &lt; 1.0f &amp;&amp; length &lt; 1.0) {
</span><del>-                T originalLength = primitiveValue-&gt;computeLength&lt;T&gt;(conversionData.copyWithAdjustedZoom(1.0f));
</del><ins>+                T originalLength = primitiveValue.computeLength&lt;T&gt;(conversionData.copyWithAdjustedZoom(1.0f));
</ins><span class="cx">                 if (originalLength &gt;= 1.0)
</span><span class="cx">                     length = 1.0;
</span><span class="cx">             }
</span><span class="lines">@@ -654,11 +655,11 @@
</span><span class="cx"> 
</span><span class="cx">     static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
</span><span class="cx">     {
</span><del>-        if (!value-&gt;isPrimitiveValue())
</del><ins>+        if (!is&lt;CSSPrimitiveValue&gt;(*value))
</ins><span class="cx">             return;
</span><del>-        CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
</del><ins>+        CSSPrimitiveValue&amp; primitiveValue = downcast&lt;CSSPrimitiveValue&gt;(*value);
</ins><span class="cx">         FontDescription fontDescription = styleResolver-&gt;fontDescription();
</span><del>-        (fontDescription.*setterFunction)(*primitiveValue);
</del><ins>+        (fontDescription.*setterFunction)(primitiveValue);
</ins><span class="cx">         styleResolver-&gt;setFontDescription(fontDescription);
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -697,10 +698,10 @@
</span><span class="cx"> 
</span><span class="cx">     static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
</span><span class="cx">     {
</span><del>-        if (!value-&gt;isValueList())
</del><ins>+        if (!is&lt;CSSValueList&gt;(*value))
</ins><span class="cx">             return;
</span><span class="cx"> 
</span><del>-        auto&amp; valueList = toCSSValueList(*value);
</del><ins>+        auto&amp; valueList = downcast&lt;CSSValueList&gt;(*value);
</ins><span class="cx"> 
</span><span class="cx">         FontDescription fontDescription = styleResolver-&gt;style()-&gt;fontDescription();
</span><span class="cx">         // Before mapping in a new font-family property, we should reset the generic family.
</span><span class="lines">@@ -712,14 +713,14 @@
</span><span class="cx"> 
</span><span class="cx">         for (unsigned i = 0; i &lt; valueList.length(); ++i) {
</span><span class="cx">             CSSValue* item = valueList.item(i);
</span><del>-            if (!item-&gt;isPrimitiveValue())
</del><ins>+            if (!is&lt;CSSPrimitiveValue&gt;(*item))
</ins><span class="cx">                 continue;
</span><del>-            CSSPrimitiveValue* contentValue = toCSSPrimitiveValue(item);
</del><ins>+            CSSPrimitiveValue&amp; contentValue = downcast&lt;CSSPrimitiveValue&gt;(*item);
</ins><span class="cx">             AtomicString face;
</span><del>-            if (contentValue-&gt;isString())
-                face = contentValue-&gt;getStringValue();
</del><ins>+            if (contentValue.isString())
+                face = contentValue.getStringValue();
</ins><span class="cx">             else if (Settings* settings = styleResolver-&gt;document().settings()) {
</span><del>-                switch (contentValue-&gt;getValueID()) {
</del><ins>+                switch (contentValue.getValueID()) {
</ins><span class="cx">                 case CSSValueWebkitBody:
</span><span class="cx">                     face = settings-&gt;standardFontFamily();
</span><span class="cx">                     break;
</span><span class="lines">@@ -840,10 +841,10 @@
</span><span class="cx">     
</span><span class="cx">     static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
</span><span class="cx">     {
</span><del>-        if (!value-&gt;isPrimitiveValue())
</del><ins>+        if (!is&lt;CSSPrimitiveValue&gt;(*value))
</ins><span class="cx">             return;
</span><span class="cx"> 
</span><del>-        CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
</del><ins>+        CSSPrimitiveValue&amp; primitiveValue = downcast&lt;CSSPrimitiveValue&gt;(*value);
</ins><span class="cx"> 
</span><span class="cx">         FontDescription fontDescription = styleResolver-&gt;style()-&gt;fontDescription();
</span><span class="cx">         fontDescription.setKeywordSize(0);
</span><span class="lines">@@ -856,7 +857,7 @@
</span><span class="cx">             parentIsAbsoluteSize = styleResolver-&gt;parentStyle()-&gt;fontDescription().isAbsoluteSize();
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        if (CSSValueID ident = primitiveValue-&gt;getValueID()) {
</del><ins>+        if (CSSValueID ident = primitiveValue.getValueID()) {
</ins><span class="cx">             // Keywords are being used.
</span><span class="cx">             switch (ident) {
</span><span class="cx">             case CSSValueXxSmall:
</span><span class="lines">@@ -886,15 +887,14 @@
</span><span class="cx"> 
</span><span class="cx">             fontDescription.setIsAbsoluteSize(parentIsAbsoluteSize &amp;&amp; (ident == CSSValueLarger || ident == CSSValueSmaller || ident == CSSValueWebkitRubyText));
</span><span class="cx">         } else {
</span><del>-            fontDescription.setIsAbsoluteSize(parentIsAbsoluteSize
-                                              || !(primitiveValue-&gt;isPercentage() || primitiveValue-&gt;isFontRelativeLength()));
-            if (primitiveValue-&gt;isLength()) {
-                size = primitiveValue-&gt;computeLength&lt;float&gt;(CSSToLengthConversionData(styleResolver-&gt;parentStyle(), styleResolver-&gt;rootElementStyle(), styleResolver-&gt;document().renderView(), 1.0f, true));
-                styleResolver-&gt;state().setFontSizeHasViewportUnits(primitiveValue-&gt;isViewportPercentageLength());
-            } else if (primitiveValue-&gt;isPercentage())
-                size = (primitiveValue-&gt;getFloatValue() * parentSize) / 100.0f;
-            else if (primitiveValue-&gt;isCalculatedPercentageWithLength()) {
-                Ref&lt;CalculationValue&gt; calculationValue { primitiveValue-&gt;cssCalcValue()-&gt;createCalculationValue(styleResolver-&gt;state().cssToLengthConversionData().copyWithAdjustedZoom(1.0f)) };
</del><ins>+            fontDescription.setIsAbsoluteSize(parentIsAbsoluteSize || !(primitiveValue.isPercentage() || primitiveValue.isFontRelativeLength()));
+            if (primitiveValue.isLength()) {
+                size = primitiveValue.computeLength&lt;float&gt;(CSSToLengthConversionData(styleResolver-&gt;parentStyle(), styleResolver-&gt;rootElementStyle(), styleResolver-&gt;document().renderView(), 1.0f, true));
+                styleResolver-&gt;state().setFontSizeHasViewportUnits(primitiveValue.isViewportPercentageLength());
+            } else if (primitiveValue.isPercentage())
+                size = (primitiveValue.getFloatValue() * parentSize) / 100.0f;
+            else if (primitiveValue.isCalculatedPercentageWithLength()) {
+                Ref&lt;CalculationValue&gt; calculationValue { primitiveValue.cssCalcValue()-&gt;createCalculationValue(styleResolver-&gt;state().cssToLengthConversionData().copyWithAdjustedZoom(1.0f)) };
</ins><span class="cx">                 size = calculationValue-&gt;evaluate(parentSize);
</span><span class="cx">             } else
</span><span class="cx">                 return;
</span><span class="lines">@@ -919,11 +919,11 @@
</span><span class="cx"> public:
</span><span class="cx">     static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
</span><span class="cx">     {
</span><del>-        if (!value-&gt;isPrimitiveValue())
</del><ins>+        if (!is&lt;CSSPrimitiveValue&gt;(*value))
</ins><span class="cx">             return;
</span><del>-        CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
</del><ins>+        CSSPrimitiveValue&amp; primitiveValue = downcast&lt;CSSPrimitiveValue&gt;(*value);
</ins><span class="cx">         FontDescription fontDescription = styleResolver-&gt;fontDescription();
</span><del>-        switch (primitiveValue-&gt;getValueID()) {
</del><ins>+        switch (primitiveValue.getValueID()) {
</ins><span class="cx">         case CSSValueInvalid:
</span><span class="cx">             ASSERT_NOT_REACHED();
</span><span class="cx">             break;
</span><span class="lines">@@ -934,7 +934,7 @@
</span><span class="cx">             fontDescription.setWeight(fontDescription.lighterWeight());
</span><span class="cx">             break;
</span><span class="cx">         default:
</span><del>-            fontDescription.setWeight(*primitiveValue);
</del><ins>+            fontDescription.setWeight(primitiveValue);
</ins><span class="cx">         }
</span><span class="cx">         styleResolver-&gt;setFontDescription(fontDescription);
</span><span class="cx">     }
</span><span class="lines">@@ -976,13 +976,12 @@
</span><span class="cx">         FontDescription::LigaturesState discretionaryLigaturesState = FontDescription::NormalLigaturesState;
</span><span class="cx">         FontDescription::LigaturesState historicalLigaturesState = FontDescription::NormalLigaturesState;
</span><span class="cx"> 
</span><del>-        if (value-&gt;isValueList()) {
-            CSSValueList* valueList = toCSSValueList(value);
-            for (size_t i = 0; i &lt; valueList-&gt;length(); ++i) {
-                CSSValue* item = valueList-&gt;itemWithoutBoundsCheck(i);
-                ASSERT(item-&gt;isPrimitiveValue());
-                if (item-&gt;isPrimitiveValue()) {
-                    switch (toCSSPrimitiveValue(item)-&gt;getValueID()) {
</del><ins>+        if (is&lt;CSSValueList&gt;(*value)) {
+            CSSValueList&amp; valueList = downcast&lt;CSSValueList&gt;(*value);
+            for (size_t i = 0; i &lt; valueList.length(); ++i) {
+                CSSValue* item = valueList.itemWithoutBoundsCheck(i);
+                if (is&lt;CSSPrimitiveValue&gt;(*item)) {
+                    switch (downcast&lt;CSSPrimitiveValue&gt;(*item).getValueID()) {
</ins><span class="cx">                     case CSSValueNoCommonLigatures:
</span><span class="cx">                         commonLigaturesState = FontDescription::DisabledLigaturesState;
</span><span class="cx">                         break;
</span><span class="lines">@@ -1009,10 +1008,8 @@
</span><span class="cx">             }
</span><span class="cx">         }
</span><span class="cx"> #if !ASSERT_DISABLED
</span><del>-        else {
-            ASSERT_WITH_SECURITY_IMPLICATION(value-&gt;isPrimitiveValue());
-            ASSERT(toCSSPrimitiveValue(value)-&gt;getValueID() == CSSValueNormal);
-        }
</del><ins>+        else
+            ASSERT(downcast&lt;CSSPrimitiveValue&gt;(*value).getValueID() == CSSValueNormal);
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">         FontDescription fontDescription = styleResolver-&gt;fontDescription();
</span><span class="lines">@@ -1159,9 +1156,9 @@
</span><span class="cx">     }
</span><span class="cx">     static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
</span><span class="cx">     {
</span><del>-        bool setCounterIncrementToNone = counterBehavior == Increment &amp;&amp; value-&gt;isPrimitiveValue() &amp;&amp; toCSSPrimitiveValue(value)-&gt;getValueID() == CSSValueNone;
</del><ins>+        bool setCounterIncrementToNone = counterBehavior == Increment &amp;&amp; is&lt;CSSPrimitiveValue&gt;(*value) &amp;&amp; downcast&lt;CSSPrimitiveValue&gt;(*value).getValueID() == CSSValueNone;
</ins><span class="cx"> 
</span><del>-        if (!value-&gt;isValueList() &amp;&amp; !setCounterIncrementToNone)
</del><ins>+        if (!is&lt;CSSValueList&gt;(*value) &amp;&amp; !setCounterIncrementToNone)
</ins><span class="cx">             return;
</span><span class="cx"> 
</span><span class="cx">         CounterDirectiveMap&amp; map = styleResolver-&gt;style()-&gt;accessCounterDirectives();
</span><span class="lines">@@ -1177,14 +1174,14 @@
</span><span class="cx">         if (setCounterIncrementToNone)
</span><span class="cx">             return;
</span><span class="cx">         
</span><del>-        CSSValueList* list = toCSSValueList(value);
-        int length = list ? list-&gt;length() : 0;
</del><ins>+        CSSValueList&amp; list = downcast&lt;CSSValueList&gt;(*value);
+        int length = list.length();
</ins><span class="cx">         for (int i = 0; i &lt; length; ++i) {
</span><del>-            CSSValue* currValue = list-&gt;itemWithoutBoundsCheck(i);
-            if (!currValue-&gt;isPrimitiveValue())
</del><ins>+            CSSValue* currValue = list.itemWithoutBoundsCheck(i);
+            if (!is&lt;CSSPrimitiveValue&gt;(*currValue))
</ins><span class="cx">                 continue;
</span><span class="cx"> 
</span><del>-            Pair* pair = toCSSPrimitiveValue(currValue)-&gt;getPairValue();
</del><ins>+            Pair* pair = downcast&lt;CSSPrimitiveValue&gt;(*currValue).getPairValue();
</ins><span class="cx">             if (!pair || !pair-&gt;first() || !pair-&gt;second())
</span><span class="cx">                 continue;
</span><span class="cx"> 
</span><span class="lines">@@ -1219,27 +1216,27 @@
</span><span class="cx">     static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
</span><span class="cx">     {
</span><span class="cx">         styleResolver-&gt;style()-&gt;clearCursorList();
</span><del>-        if (value-&gt;isValueList()) {
-            CSSValueList* list = toCSSValueList(value);
-            int len = list-&gt;length();
</del><ins>+        if (is&lt;CSSValueList&gt;(*value)) {
+            CSSValueList&amp; list = downcast&lt;CSSValueList&gt;(*value);
+            int length = list.length();
</ins><span class="cx">             styleResolver-&gt;style()-&gt;setCursor(CursorAuto);
</span><del>-            for (int i = 0; i &lt; len; i++) {
-                CSSValue* item = list-&gt;itemWithoutBoundsCheck(i);
-                if (item-&gt;isCursorImageValue()) {
-                    CSSCursorImageValue* image = toCSSCursorImageValue(item);
-                    if (image-&gt;updateIfSVGCursorIsUsed(styleResolver-&gt;element())) // Elements with SVG cursors are not allowed to share style.
</del><ins>+            for (int i = 0; i &lt; length; i++) {
+                CSSValue* item = list.itemWithoutBoundsCheck(i);
+                if (is&lt;CSSCursorImageValue&gt;(*item)) {
+                    CSSCursorImageValue&amp; image = downcast&lt;CSSCursorImageValue&gt;(*item);
+                    if (image.updateIfSVGCursorIsUsed(styleResolver-&gt;element())) // Elements with SVG cursors are not allowed to share style.
</ins><span class="cx">                         styleResolver-&gt;style()-&gt;setUnique();
</span><del>-                    styleResolver-&gt;style()-&gt;addCursor(styleResolver-&gt;styleImage(CSSPropertyCursor, image), image-&gt;hotSpot());
-                } else if (item-&gt;isPrimitiveValue()) {
-                    CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(item);
-                    if (primitiveValue-&gt;isValueID())
-                        styleResolver-&gt;style()-&gt;setCursor(*primitiveValue);
</del><ins>+                    styleResolver-&gt;style()-&gt;addCursor(styleResolver-&gt;styleImage(CSSPropertyCursor, &amp;image), image.hotSpot());
+                } else if (is&lt;CSSPrimitiveValue&gt;(*item)) {
+                    CSSPrimitiveValue&amp; primitiveValue = downcast&lt;CSSPrimitiveValue&gt;(*item);
+                    if (primitiveValue.isValueID())
+                        styleResolver-&gt;style()-&gt;setCursor(primitiveValue);
</ins><span class="cx">                 }
</span><span class="cx">             }
</span><del>-        } else if (value-&gt;isPrimitiveValue()) {
-            CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
-            if (primitiveValue-&gt;isValueID() &amp;&amp; styleResolver-&gt;style()-&gt;cursor() != ECursor(*primitiveValue))
-                styleResolver-&gt;style()-&gt;setCursor(*primitiveValue);
</del><ins>+        } else if (is&lt;CSSPrimitiveValue&gt;(*value)) {
+            CSSPrimitiveValue&amp; primitiveValue = downcast&lt;CSSPrimitiveValue&gt;(*value);
+            if (primitiveValue.isValueID() &amp;&amp; styleResolver-&gt;style()-&gt;cursor() != ECursor(primitiveValue))
+                styleResolver-&gt;style()-&gt;setCursor(primitiveValue);
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -1250,14 +1247,14 @@
</span><span class="cx"> public:
</span><span class="cx">     static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
</span><span class="cx">     {
</span><del>-        if (!value-&gt;isPrimitiveValue())
</del><ins>+        if (!is&lt;CSSPrimitiveValue&gt;(*value))
</ins><span class="cx">             return;
</span><span class="cx"> 
</span><del>-        CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
-        ASSERT(primitiveValue-&gt;isValueID());
</del><ins>+        CSSPrimitiveValue&amp; primitiveValue = downcast&lt;CSSPrimitiveValue&gt;(*value);
+        ASSERT(primitiveValue.isValueID());
</ins><span class="cx"> 
</span><del>-        if (primitiveValue-&gt;getValueID() != CSSValueWebkitMatchParent)
-            styleResolver-&gt;style()-&gt;setTextAlign(*primitiveValue);
</del><ins>+        if (primitiveValue.getValueID() != CSSValueWebkitMatchParent)
+            styleResolver-&gt;style()-&gt;setTextAlign(primitiveValue);
</ins><span class="cx">         else if (styleResolver-&gt;parentStyle()-&gt;textAlign() == TASTART)
</span><span class="cx">             styleResolver-&gt;style()-&gt;setTextAlign(styleResolver-&gt;parentStyle()-&gt;isLeftToRightDirection() ? LEFT : RIGHT);
</span><span class="cx">         else if (styleResolver-&gt;parentStyle()-&gt;textAlign() == TAEND)
</span><span class="lines">@@ -1279,8 +1276,7 @@
</span><span class="cx">         TextDecoration t = RenderStyle::initialTextDecoration();
</span><span class="cx">         for (CSSValueListIterator i(value); i.hasMore(); i.advance()) {
</span><span class="cx">             CSSValue* item = i.value();
</span><del>-            ASSERT_WITH_SECURITY_IMPLICATION(item-&gt;isPrimitiveValue());
-            t |= *toCSSPrimitiveValue(item);
</del><ins>+            t |= downcast&lt;CSSPrimitiveValue&gt;(*item);
</ins><span class="cx">         }
</span><span class="cx">         styleResolver-&gt;style()-&gt;setTextDecoration(t);
</span><span class="cx">     }
</span><span class="lines">@@ -1324,14 +1320,14 @@
</span><span class="cx"> public:
</span><span class="cx">     static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
</span><span class="cx">     {
</span><del>-        if (value-&gt;isPrimitiveValue()) {
-            styleResolver-&gt;style()-&gt;setTextDecorationSkip(valueToDecorationSkip(*toCSSPrimitiveValue(value)));
</del><ins>+        if (is&lt;CSSPrimitiveValue&gt;(*value)) {
+            styleResolver-&gt;style()-&gt;setTextDecorationSkip(valueToDecorationSkip(downcast&lt;CSSPrimitiveValue&gt;(*value)));
</ins><span class="cx">             return;
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         TextDecorationSkip skip = RenderStyle::initialTextDecorationSkip();
</span><span class="cx">         for (CSSValueListIterator i(value); i.hasMore(); i.advance())
</span><del>-            skip |= valueToDecorationSkip(*toCSSPrimitiveValue(i.value()));
</del><ins>+            skip |= valueToDecorationSkip(downcast&lt;CSSPrimitiveValue&gt;(*i.value()));
</ins><span class="cx">         styleResolver-&gt;style()-&gt;setTextDecorationSkip(skip);
</span><span class="cx">     }
</span><span class="cx">     static PropertyHandler createHandler()
</span><span class="lines">@@ -1345,10 +1341,10 @@
</span><span class="cx"> public:
</span><span class="cx">     static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
</span><span class="cx">     {
</span><del>-        if (!value-&gt;isPrimitiveValue())
</del><ins>+        if (!is&lt;CSSPrimitiveValue&gt;(*value))
</ins><span class="cx">             return;
</span><span class="cx"> 
</span><del>-        CSSPrimitiveValue&amp; primitiveValue = toCSSPrimitiveValue(*value);
</del><ins>+        CSSPrimitiveValue&amp; primitiveValue = downcast&lt;CSSPrimitiveValue&gt;(*value);
</ins><span class="cx">         Length marqueeLength(Undefined);
</span><span class="cx">         switch (primitiveValue.getValueID()) {
</span><span class="cx">         case CSSValueSmall:
</span><span class="lines">@@ -1380,14 +1376,14 @@
</span><span class="cx"> public:
</span><span class="cx">     static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
</span><span class="cx">     {
</span><del>-        if (!value-&gt;isPrimitiveValue())
</del><ins>+        if (!is&lt;CSSPrimitiveValue&gt;(*value))
</ins><span class="cx">             return;
</span><span class="cx"> 
</span><del>-        CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
-        if (primitiveValue-&gt;getValueID() == CSSValueInfinite)
</del><ins>+        CSSPrimitiveValue&amp; primitiveValue = downcast&lt;CSSPrimitiveValue&gt;(*value);
+        if (primitiveValue.getValueID() == CSSValueInfinite)
</ins><span class="cx">             styleResolver-&gt;style()-&gt;setMarqueeLoopCount(-1); // -1 means repeat forever.
</span><del>-        else if (primitiveValue-&gt;isNumber())
-            styleResolver-&gt;style()-&gt;setMarqueeLoopCount(primitiveValue-&gt;getIntValue());
</del><ins>+        else if (primitiveValue.isNumber())
+            styleResolver-&gt;style()-&gt;setMarqueeLoopCount(primitiveValue.getIntValue());
</ins><span class="cx">     }
</span><span class="cx">     static PropertyHandler createHandler()
</span><span class="cx">     {
</span><span class="lines">@@ -1400,11 +1396,11 @@
</span><span class="cx"> public:
</span><span class="cx">     static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
</span><span class="cx">     {
</span><del>-        if (!value-&gt;isPrimitiveValue())
</del><ins>+        if (!is&lt;CSSPrimitiveValue&gt;(*value))
</ins><span class="cx">             return;
</span><span class="cx"> 
</span><del>-        CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
-        if (CSSValueID ident = primitiveValue-&gt;getValueID()) {
</del><ins>+        CSSPrimitiveValue&amp; primitiveValue = downcast&lt;CSSPrimitiveValue&gt;(*value);
+        if (CSSValueID ident = primitiveValue.getValueID()) {
</ins><span class="cx">             switch (ident) {
</span><span class="cx">             case CSSValueSlow:
</span><span class="cx">                 styleResolver-&gt;style()-&gt;setMarqueeSpeed(500); // 500 msec.
</span><span class="lines">@@ -1418,10 +1414,10 @@
</span><span class="cx">             default:
</span><span class="cx">                 break;
</span><span class="cx">             }
</span><del>-        } else if (primitiveValue-&gt;isTime())
-            styleResolver-&gt;style()-&gt;setMarqueeSpeed(primitiveValue-&gt;computeTime&lt;int, CSSPrimitiveValue::Milliseconds&gt;());
-        else if (primitiveValue-&gt;isNumber()) // For scrollamount support.
-            styleResolver-&gt;style()-&gt;setMarqueeSpeed(primitiveValue-&gt;getIntValue());
</del><ins>+        } else if (primitiveValue.isTime())
+            styleResolver-&gt;style()-&gt;setMarqueeSpeed(primitiveValue.computeTime&lt;int, CSSPrimitiveValue::Milliseconds&gt;());
+        else if (primitiveValue.isNumber()) // For scrollamount support.
+            styleResolver-&gt;style()-&gt;setMarqueeSpeed(primitiveValue.getIntValue());
</ins><span class="cx">     }
</span><span class="cx">     static PropertyHandler createHandler()
</span><span class="cx">     {
</span><span class="lines">@@ -1435,8 +1431,8 @@
</span><span class="cx">     static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
</span><span class="cx">     {
</span><span class="cx">         // This is true if value is 'auto' or 'alphabetic'.
</span><del>-        if (value-&gt;isPrimitiveValue()) {
-            TextUnderlinePosition t = *toCSSPrimitiveValue(value);
</del><ins>+        if (is&lt;CSSPrimitiveValue&gt;(*value)) {
+            TextUnderlinePosition t = downcast&lt;CSSPrimitiveValue&gt;(*value);
</ins><span class="cx">             styleResolver-&gt;style()-&gt;setTextUnderlinePosition(t);
</span><span class="cx">             return;
</span><span class="cx">         }
</span><span class="lines">@@ -1444,8 +1440,7 @@
</span><span class="cx">         unsigned t = 0;
</span><span class="cx">         for (CSSValueListIterator i(value); i.hasMore(); i.advance()) {
</span><span class="cx">             CSSValue* item = i.value();
</span><del>-            ASSERT_WITH_SECURITY_IMPLICATION(item-&gt;isPrimitiveValue());
-            TextUnderlinePosition t2 = *toCSSPrimitiveValue(item);
</del><ins>+            TextUnderlinePosition t2 = downcast&lt;CSSPrimitiveValue&gt;(*item);
</ins><span class="cx">             t |= t2;
</span><span class="cx">         }
</span><span class="cx">         styleResolver-&gt;style()-&gt;setTextUnderlinePosition(static_cast&lt;TextUnderlinePosition&gt;(t));
</span><span class="lines">@@ -1461,22 +1456,22 @@
</span><span class="cx"> public:
</span><span class="cx">     static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
</span><span class="cx">     {
</span><del>-        if (!value-&gt;isPrimitiveValue())
</del><ins>+        if (!is&lt;CSSPrimitiveValue&gt;(*value))
</ins><span class="cx">             return;
</span><span class="cx"> 
</span><del>-        CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
</del><ins>+        CSSPrimitiveValue&amp; primitiveValue = downcast&lt;CSSPrimitiveValue&gt;(*value);
</ins><span class="cx">         Length lineHeight;
</span><span class="cx"> 
</span><del>-        if (primitiveValue-&gt;getValueID() == CSSValueNormal)
</del><ins>+        if (primitiveValue.getValueID() == CSSValueNormal)
</ins><span class="cx">             lineHeight = RenderStyle::initialLineHeight();
</span><del>-        else if (primitiveValue-&gt;isLength()) {
-            lineHeight = primitiveValue-&gt;computeLength&lt;Length&gt;(csstoLengthConversionDataWithTextZoomFactor(*styleResolver));
-        } else if (primitiveValue-&gt;isPercentage()) {
</del><ins>+        else if (primitiveValue.isLength())
+            lineHeight = primitiveValue.computeLength&lt;Length&gt;(csstoLengthConversionDataWithTextZoomFactor(*styleResolver));
+        else if (primitiveValue.isPercentage()) {
</ins><span class="cx">             // FIXME: percentage should not be restricted to an integer here.
</span><del>-            lineHeight = Length((styleResolver-&gt;style()-&gt;computedFontSize() * primitiveValue-&gt;getIntValue()) / 100, Fixed);
-        } else if (primitiveValue-&gt;isNumber()) {
</del><ins>+            lineHeight = Length((styleResolver-&gt;style()-&gt;computedFontSize() * primitiveValue.getIntValue()) / 100, Fixed);
+        } else if (primitiveValue.isNumber()) {
</ins><span class="cx">             // FIXME: number and percentage values should produce the same type of Length (ie. Fixed or Percent).
</span><del>-            lineHeight = Length(primitiveValue-&gt;getDoubleValue() * 100.0, Percent);
</del><ins>+            lineHeight = Length(primitiveValue.getDoubleValue() * 100.0, Percent);
</ins><span class="cx">         } else
</span><span class="cx">             return;
</span><span class="cx">         styleResolver-&gt;style()-&gt;setLineHeight(lineHeight);
</span><span class="lines">@@ -1494,27 +1489,27 @@
</span><span class="cx"> public:
</span><span class="cx">     static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
</span><span class="cx">     {
</span><del>-        if (!value-&gt;isPrimitiveValue())
</del><ins>+        if (!is&lt;CSSPrimitiveValue&gt;(*value))
</ins><span class="cx">             return;
</span><span class="cx"> 
</span><del>-        CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
</del><ins>+        CSSPrimitiveValue&amp; primitiveValue = downcast&lt;CSSPrimitiveValue&gt;(*value);
</ins><span class="cx">         Length lineHeight;
</span><span class="cx"> 
</span><del>-        if (primitiveValue-&gt;getValueID() == CSSValueNormal)
</del><ins>+        if (primitiveValue.getValueID() == CSSValueNormal)
</ins><span class="cx">             lineHeight = RenderStyle::initialLineHeight();
</span><del>-        else if (primitiveValue-&gt;isLength()) {
-            lineHeight = primitiveValue-&gt;computeLength&lt;Length&gt;(csstoLengthConversionDataWithTextZoomFactor(*styleResolver));
</del><ins>+        else if (primitiveValue.isLength()) {
+            lineHeight = primitiveValue.computeLength&lt;Length&gt;(csstoLengthConversionDataWithTextZoomFactor(*styleResolver));
</ins><span class="cx">             if (styleResolver-&gt;style()-&gt;textSizeAdjust().isPercentage())
</span><span class="cx">                 lineHeight = Length(lineHeight.value() * styleResolver-&gt;style()-&gt;textSizeAdjust().multiplier(), Fixed);
</span><del>-        } else if (primitiveValue-&gt;isPercentage()) {
</del><ins>+        } else if (primitiveValue.isPercentage()) {
</ins><span class="cx">             // FIXME: percentage should not be restricted to an integer here.
</span><del>-            lineHeight = Length((styleResolver-&gt;style()-&gt;fontSize() * primitiveValue-&gt;getIntValue()) / 100, Fixed);
-        } else if (primitiveValue-&gt;isNumber()) {
</del><ins>+            lineHeight = Length((styleResolver-&gt;style()-&gt;fontSize() * primitiveValue.getIntValue()) / 100, Fixed);
+        } else if (primitiveValue.isNumber()) {
</ins><span class="cx">             // FIXME: number and percentage values should produce the same type of Length (ie. Fixed or Percent).
</span><span class="cx">             if (styleResolver-&gt;style()-&gt;textSizeAdjust().isPercentage())
</span><del>-                lineHeight = Length(primitiveValue-&gt;getDoubleValue() * styleResolver-&gt;style()-&gt;textSizeAdjust().multiplier() * 100.0, Percent);
</del><ins>+                lineHeight = Length(primitiveValue.getDoubleValue() * styleResolver-&gt;style()-&gt;textSizeAdjust().multiplier() * 100.0, Percent);
</ins><span class="cx">             else
</span><del>-                lineHeight = Length(primitiveValue-&gt;getDoubleValue() * 100.0, Percent);
</del><ins>+                lineHeight = Length(primitiveValue.getDoubleValue() * 100.0, Percent);
</ins><span class="cx">         } else
</span><span class="cx">             return;
</span><span class="cx">         styleResolver-&gt;style()-&gt;setLineHeight(lineHeight);
</span><span class="lines">@@ -1544,20 +1539,20 @@
</span><span class="cx"> public:
</span><span class="cx">     static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
</span><span class="cx">     {
</span><del>-        if (!value-&gt;isPrimitiveValue())
</del><ins>+        if (!is&lt;CSSPrimitiveValue&gt;(*value))
</ins><span class="cx">             return;
</span><span class="cx"> 
</span><del>-        CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
</del><ins>+        CSSPrimitiveValue&amp; primitiveValue = downcast&lt;CSSPrimitiveValue&gt;(*value);
</ins><span class="cx">         Length wordSpacing;
</span><span class="cx"> 
</span><del>-        if (primitiveValue-&gt;getValueID() == CSSValueNormal)
</del><ins>+        if (primitiveValue.getValueID() == CSSValueNormal)
</ins><span class="cx">             wordSpacing = RenderStyle::initialWordSpacing();
</span><del>-        else if (primitiveValue-&gt;isLength()) {
-            wordSpacing = primitiveValue-&gt;computeLength&lt;Length&gt;(csstoLengthConversionDataWithTextZoomFactor(*styleResolver));
-        } else if (primitiveValue-&gt;isPercentage())
-            wordSpacing = Length(primitiveValue-&gt;getDoubleValue(), Percent);
-        else if (primitiveValue-&gt;isNumber())
-            wordSpacing = Length(primitiveValue-&gt;getDoubleValue(), Fixed);
</del><ins>+        else if (primitiveValue.isLength()) {
+            wordSpacing = primitiveValue.computeLength&lt;Length&gt;(csstoLengthConversionDataWithTextZoomFactor(*styleResolver));
+        } else if (primitiveValue.isPercentage())
+            wordSpacing = Length(primitiveValue.getDoubleValue(), Percent);
+        else if (primitiveValue.isNumber())
+            wordSpacing = Length(primitiveValue.getDoubleValue(), Fixed);
</ins><span class="cx">         else
</span><span class="cx">             return;
</span><span class="cx">         styleResolver-&gt;style()-&gt;setWordSpacing(wordSpacing);
</span><span class="lines">@@ -1667,21 +1662,21 @@
</span><span class="cx">         switch (inspector.length()) {
</span><span class="cx">         case 2: {
</span><span class="cx">             // &lt;length&gt;{2} | &lt;page-size&gt; &lt;orientation&gt;
</span><del>-            if (!inspector.first()-&gt;isPrimitiveValue() || !inspector.second()-&gt;isPrimitiveValue())
</del><ins>+            if (!is&lt;CSSPrimitiveValue&gt;(*inspector.first()) || !is&lt;CSSPrimitiveValue&gt;(*inspector.second()))
</ins><span class="cx">                 return;
</span><del>-            CSSPrimitiveValue* first = toCSSPrimitiveValue(inspector.first());
-            CSSPrimitiveValue* second = toCSSPrimitiveValue(inspector.second());
-            if (first-&gt;isLength()) {
</del><ins>+            CSSPrimitiveValue&amp; first = downcast&lt;CSSPrimitiveValue&gt;(*inspector.first());
+            CSSPrimitiveValue&amp; second = downcast&lt;CSSPrimitiveValue&gt;(*inspector.second());
+            if (first.isLength()) {
</ins><span class="cx">                 // &lt;length&gt;{2}
</span><del>-                if (!second-&gt;isLength())
</del><ins>+                if (!second.isLength())
</ins><span class="cx">                     return;
</span><span class="cx">                 CSSToLengthConversionData conversionData = styleResolver-&gt;state().cssToLengthConversionData().copyWithAdjustedZoom(1.0f);
</span><del>-                width = first-&gt;computeLength&lt;Length&gt;(conversionData);
-                height = second-&gt;computeLength&lt;Length&gt;(conversionData);
</del><ins>+                width = first.computeLength&lt;Length&gt;(conversionData);
+                height = second.computeLength&lt;Length&gt;(conversionData);
</ins><span class="cx">             } else {
</span><span class="cx">                 // &lt;page-size&gt; &lt;orientation&gt;
</span><span class="cx">                 // The value order is guaranteed. See CSSParser::parseSizeParameter.
</span><del>-                if (!getPageSizeFromName(first, second, width, height))
</del><ins>+                if (!getPageSizeFromName(&amp;first, &amp;second, width, height))
</ins><span class="cx">                     return;
</span><span class="cx">             }
</span><span class="cx">             pageSizeType = PAGE_SIZE_RESOLVED;
</span><span class="lines">@@ -1689,15 +1684,15 @@
</span><span class="cx">         }
</span><span class="cx">         case 1: {
</span><span class="cx">             // &lt;length&gt; | auto | &lt;page-size&gt; | [ portrait | landscape]
</span><del>-            if (!inspector.first()-&gt;isPrimitiveValue())
</del><ins>+            if (!is&lt;CSSPrimitiveValue&gt;(*inspector.first()))
</ins><span class="cx">                 return;
</span><del>-            CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(inspector.first());
-            if (primitiveValue-&gt;isLength()) {
</del><ins>+            CSSPrimitiveValue&amp; primitiveValue = downcast&lt;CSSPrimitiveValue&gt;(*inspector.first());
+            if (primitiveValue.isLength()) {
</ins><span class="cx">                 // &lt;length&gt;
</span><span class="cx">                 pageSizeType = PAGE_SIZE_RESOLVED;
</span><del>-                width = height = primitiveValue-&gt;computeLength&lt;Length&gt;(styleResolver-&gt;state().cssToLengthConversionData().copyWithAdjustedZoom(1.0f));
</del><ins>+                width = height = primitiveValue.computeLength&lt;Length&gt;(styleResolver-&gt;state().cssToLengthConversionData().copyWithAdjustedZoom(1.0f));
</ins><span class="cx">             } else {
</span><del>-                switch (primitiveValue-&gt;getValueID()) {
</del><ins>+                switch (primitiveValue.getValueID()) {
</ins><span class="cx">                 case 0:
</span><span class="cx">                     return;
</span><span class="cx">                 case CSSValueAuto:
</span><span class="lines">@@ -1712,7 +1707,7 @@
</span><span class="cx">                 default:
</span><span class="cx">                     // &lt;page-size&gt;
</span><span class="cx">                     pageSizeType = PAGE_SIZE_RESOLVED;
</span><del>-                    if (!getPageSizeFromName(primitiveValue, 0, width, height))
</del><ins>+                    if (!getPageSizeFromName(&amp;primitiveValue, nullptr, width, height))
</ins><span class="cx">                         return;
</span><span class="cx">                 }
</span><span class="cx">             }
</span><span class="lines">@@ -1745,45 +1740,45 @@
</span><span class="cx"> 
</span><span class="cx">     static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
</span><span class="cx">     {
</span><del>-        if (value-&gt;isValueList()) {
-            CSSValueList* list = toCSSValueList(value);
-            ASSERT(list-&gt;length() == 2);
-            if (list-&gt;length() != 2)
</del><ins>+        if (is&lt;CSSValueList&gt;(*value)) {
+            CSSValueList&amp; list = downcast&lt;CSSValueList&gt;(*value);
+            ASSERT(list.length() == 2);
+            if (list.length() != 2)
</ins><span class="cx">                 return;
</span><span class="cx">             for (unsigned i = 0; i &lt; 2; ++i) {
</span><del>-                CSSValue* item = list-&gt;itemWithoutBoundsCheck(i);
-                if (!item-&gt;isPrimitiveValue())
</del><ins>+                CSSValue* item = list.itemWithoutBoundsCheck(i);
+                if (!is&lt;CSSPrimitiveValue&gt;(*item))
</ins><span class="cx">                     continue;
</span><span class="cx"> 
</span><del>-                CSSPrimitiveValue* value = toCSSPrimitiveValue(item);
-                if (value-&gt;getValueID() == CSSValueFilled || value-&gt;getValueID() == CSSValueOpen)
-                    styleResolver-&gt;style()-&gt;setTextEmphasisFill(*value);
</del><ins>+                CSSPrimitiveValue&amp; value = downcast&lt;CSSPrimitiveValue&gt;(*item);
+                if (value.getValueID() == CSSValueFilled || value.getValueID() == CSSValueOpen)
+                    styleResolver-&gt;style()-&gt;setTextEmphasisFill(value);
</ins><span class="cx">                 else
</span><del>-                    styleResolver-&gt;style()-&gt;setTextEmphasisMark(*value);
</del><ins>+                    styleResolver-&gt;style()-&gt;setTextEmphasisMark(value);
</ins><span class="cx">             }
</span><span class="cx">             styleResolver-&gt;style()-&gt;setTextEmphasisCustomMark(nullAtom);
</span><span class="cx">             return;
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        if (!value-&gt;isPrimitiveValue())
</del><ins>+        if (!is&lt;CSSPrimitiveValue&gt;(*value))
</ins><span class="cx">             return;
</span><del>-        CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
</del><ins>+        CSSPrimitiveValue&amp; primitiveValue = downcast&lt;CSSPrimitiveValue&gt;(*value);
</ins><span class="cx"> 
</span><del>-        if (primitiveValue-&gt;isString()) {
</del><ins>+        if (primitiveValue.isString()) {
</ins><span class="cx">             styleResolver-&gt;style()-&gt;setTextEmphasisFill(TextEmphasisFillFilled);
</span><span class="cx">             styleResolver-&gt;style()-&gt;setTextEmphasisMark(TextEmphasisMarkCustom);
</span><del>-            styleResolver-&gt;style()-&gt;setTextEmphasisCustomMark(primitiveValue-&gt;getStringValue());
</del><ins>+            styleResolver-&gt;style()-&gt;setTextEmphasisCustomMark(primitiveValue.getStringValue());
</ins><span class="cx">             return;
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         styleResolver-&gt;style()-&gt;setTextEmphasisCustomMark(nullAtom);
</span><span class="cx"> 
</span><del>-        if (primitiveValue-&gt;getValueID() == CSSValueFilled || primitiveValue-&gt;getValueID() == CSSValueOpen) {
-            styleResolver-&gt;style()-&gt;setTextEmphasisFill(*primitiveValue);
</del><ins>+        if (primitiveValue.getValueID() == CSSValueFilled || primitiveValue.getValueID() == CSSValueOpen) {
+            styleResolver-&gt;style()-&gt;setTextEmphasisFill(primitiveValue);
</ins><span class="cx">             styleResolver-&gt;style()-&gt;setTextEmphasisMark(TextEmphasisMarkAuto);
</span><span class="cx">         } else {
</span><span class="cx">             styleResolver-&gt;style()-&gt;setTextEmphasisFill(TextEmphasisFillFilled);
</span><del>-            styleResolver-&gt;style()-&gt;setTextEmphasisMark(*primitiveValue);
</del><ins>+            styleResolver-&gt;style()-&gt;setTextEmphasisMark(primitiveValue);
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -1815,14 +1810,14 @@
</span><span class="cx"> public:
</span><span class="cx">     static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
</span><span class="cx">     {
</span><del>-        if (value-&gt;isPrimitiveValue()) {
-            styleResolver-&gt;style()-&gt;setTextEmphasisPosition(valueToEmphasisPosition(*toCSSPrimitiveValue(value)));
</del><ins>+        if (is&lt;CSSPrimitiveValue&gt;(*value)) {
+            styleResolver-&gt;style()-&gt;setTextEmphasisPosition(valueToEmphasisPosition(downcast&lt;CSSPrimitiveValue&gt;(*value)));
</ins><span class="cx">             return;
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         TextEmphasisPosition position = 0;
</span><span class="cx">         for (CSSValueListIterator i(value); i.hasMore(); i.advance())
</span><del>-            position |= valueToEmphasisPosition(*toCSSPrimitiveValue(i.value()));
</del><ins>+            position |= valueToEmphasisPosition(downcast&lt;CSSPrimitiveValue&gt;(*i.value()));
</ins><span class="cx">         styleResolver-&gt;style()-&gt;setTextEmphasisPosition(position);
</span><span class="cx">     }
</span><span class="cx">     static PropertyHandler createHandler()
</span><span class="lines">@@ -1935,23 +1930,23 @@
</span><span class="cx"> public:
</span><span class="cx">     static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
</span><span class="cx">     {
</span><del>-        if (!value-&gt;isPrimitiveValue())
</del><ins>+        if (!is&lt;CSSPrimitiveValue&gt;(*value))
</ins><span class="cx">             return;
</span><span class="cx"> 
</span><del>-        CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
</del><ins>+        CSSPrimitiveValue&amp; primitiveValue = downcast&lt;CSSPrimitiveValue&gt;(*value);
</ins><span class="cx"> 
</span><del>-        EResize r = RESIZE_NONE;
-        switch (primitiveValue-&gt;getValueID()) {
</del><ins>+        EResize resize = RESIZE_NONE;
+        switch (primitiveValue.getValueID()) {
</ins><span class="cx">         case 0:
</span><span class="cx">             return;
</span><span class="cx">         case CSSValueAuto:
</span><span class="cx">             if (Settings* settings = styleResolver-&gt;document().settings())
</span><del>-                r = settings-&gt;textAreasAreResizable() ? RESIZE_BOTH : RESIZE_NONE;
</del><ins>+                resize = settings-&gt;textAreasAreResizable() ? RESIZE_BOTH : RESIZE_NONE;
</ins><span class="cx">             break;
</span><span class="cx">         default:
</span><del>-            r = *primitiveValue;
</del><ins>+            resize = primitiveValue;
</ins><span class="cx">         }
</span><del>-        styleResolver-&gt;style()-&gt;setResize(r);
</del><ins>+        styleResolver-&gt;style()-&gt;setResize(resize);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     static PropertyHandler createHandler()
</span><span class="lines">@@ -1965,15 +1960,15 @@
</span><span class="cx"> public:
</span><span class="cx">     static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
</span><span class="cx">     {
</span><del>-        if (!value-&gt;isPrimitiveValue())
</del><ins>+        if (!is&lt;CSSPrimitiveValue&gt;(*value))
</ins><span class="cx">             return;
</span><span class="cx"> 
</span><del>-        CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
</del><ins>+        CSSPrimitiveValue&amp; primitiveValue = downcast&lt;CSSPrimitiveValue&gt;(*value);
</ins><span class="cx"> 
</span><del>-        if (primitiveValue-&gt;getValueID())
-            return styleResolver-&gt;style()-&gt;setVerticalAlign(*primitiveValue);
</del><ins>+        if (primitiveValue.getValueID())
+            return styleResolver-&gt;style()-&gt;setVerticalAlign(primitiveValue);
</ins><span class="cx"> 
</span><del>-        styleResolver-&gt;style()-&gt;setVerticalAlignLength(primitiveValue-&gt;convertToLength&lt;FixedIntegerConversion | PercentConversion | CalculatedConversion&gt;(styleResolver-&gt;state().cssToLengthConversionData()));
</del><ins>+        styleResolver-&gt;style()-&gt;setVerticalAlignLength(primitiveValue.convertToLength&lt;FixedIntegerConversion | PercentConversion | CalculatedConversion&gt;(styleResolver-&gt;state().cssToLengthConversionData()));
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     static PropertyHandler createHandler()
</span><span class="lines">@@ -2003,26 +1998,26 @@
</span><span class="cx"> 
</span><span class="cx">     static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
</span><span class="cx">     {
</span><del>-        if (value-&gt;isPrimitiveValue()) {
-            CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
</del><ins>+        if (is&lt;CSSPrimitiveValue&gt;(*value)) {
+            CSSPrimitiveValue&amp; primitiveValue = downcast&lt;CSSPrimitiveValue&gt;(*value);
</ins><span class="cx"> 
</span><del>-            if (primitiveValue-&gt;getValueID() == CSSValueAuto)
</del><ins>+            if (primitiveValue.getValueID() == CSSValueAuto)
</ins><span class="cx">                 return styleResolver-&gt;style()-&gt;setAspectRatioType(AspectRatioAuto);
</span><del>-            if (primitiveValue-&gt;getValueID() == CSSValueFromDimensions)
</del><ins>+            if (primitiveValue.getValueID() == CSSValueFromDimensions)
</ins><span class="cx">                 return styleResolver-&gt;style()-&gt;setAspectRatioType(AspectRatioFromDimensions);
</span><del>-            if (primitiveValue-&gt;getValueID() == CSSValueFromIntrinsic)
</del><ins>+            if (primitiveValue.getValueID() == CSSValueFromIntrinsic)
</ins><span class="cx">                 return styleResolver-&gt;style()-&gt;setAspectRatioType(AspectRatioFromIntrinsic);
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        if (!value-&gt;isAspectRatioValue()) {
</del><ins>+        if (!is&lt;CSSAspectRatioValue&gt;(*value)) {
</ins><span class="cx">             styleResolver-&gt;style()-&gt;setAspectRatioType(AspectRatioAuto);
</span><span class="cx">             return;
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        CSSAspectRatioValue* aspectRatioValue = toCSSAspectRatioValue(value);
</del><ins>+        CSSAspectRatioValue&amp; aspectRatioValue = downcast&lt;CSSAspectRatioValue&gt;(*value);
</ins><span class="cx">         styleResolver-&gt;style()-&gt;setAspectRatioType(AspectRatioSpecified);
</span><del>-        styleResolver-&gt;style()-&gt;setAspectRatioDenominator(aspectRatioValue-&gt;denominatorValue());
-        styleResolver-&gt;style()-&gt;setAspectRatioNumerator(aspectRatioValue-&gt;numeratorValue());
</del><ins>+        styleResolver-&gt;style()-&gt;setAspectRatioDenominator(aspectRatioValue.denominatorValue());
+        styleResolver-&gt;style()-&gt;setAspectRatioNumerator(aspectRatioValue.numeratorValue());
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     static PropertyHandler createHandler()
</span><span class="lines">@@ -2054,26 +2049,25 @@
</span><span class="cx"> 
</span><span class="cx">     static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
</span><span class="cx">     {
</span><del>-        ASSERT_WITH_SECURITY_IMPLICATION(value-&gt;isPrimitiveValue());
-        CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
</del><ins>+        CSSPrimitiveValue&amp; primitiveValue = downcast&lt;CSSPrimitiveValue&gt;(*value);
</ins><span class="cx"> 
</span><del>-        if (primitiveValue-&gt;getValueID() == CSSValueNormal) {
</del><ins>+        if (primitiveValue.getValueID() == CSSValueNormal) {
</ins><span class="cx">             resetEffectiveZoom(styleResolver);
</span><span class="cx">             styleResolver-&gt;setZoom(RenderStyle::initialZoom());
</span><del>-        } else if (primitiveValue-&gt;getValueID() == CSSValueReset) {
</del><ins>+        } else if (primitiveValue.getValueID() == CSSValueReset) {
</ins><span class="cx">             styleResolver-&gt;setEffectiveZoom(RenderStyle::initialZoom());
</span><span class="cx">             styleResolver-&gt;setZoom(RenderStyle::initialZoom());
</span><del>-        } else if (primitiveValue-&gt;getValueID() == CSSValueDocument) {
</del><ins>+        } else if (primitiveValue.getValueID() == CSSValueDocument) {
</ins><span class="cx">             float docZoom = styleResolver-&gt;rootElementStyle() ? styleResolver-&gt;rootElementStyle()-&gt;zoom() : RenderStyle::initialZoom();
</span><span class="cx">             styleResolver-&gt;setEffectiveZoom(docZoom);
</span><span class="cx">             styleResolver-&gt;setZoom(docZoom);
</span><del>-        } else if (primitiveValue-&gt;isPercentage()) {
</del><ins>+        } else if (primitiveValue.isPercentage()) {
</ins><span class="cx">             resetEffectiveZoom(styleResolver);
</span><del>-            if (float percent = primitiveValue-&gt;getFloatValue())
</del><ins>+            if (float percent = primitiveValue.getFloatValue())
</ins><span class="cx">                 styleResolver-&gt;setZoom(percent / 100.0f);
</span><del>-        } else if (primitiveValue-&gt;isNumber()) {
</del><ins>+        } else if (primitiveValue.isNumber()) {
</ins><span class="cx">             resetEffectiveZoom(styleResolver);
</span><del>-            if (float number = primitiveValue-&gt;getFloatValue())
</del><ins>+            if (float number = primitiveValue.getFloatValue())
</ins><span class="cx">                 styleResolver-&gt;setZoom(number);
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="lines">@@ -2108,10 +2102,10 @@
</span><span class="cx"> 
</span><span class="cx">     static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
</span><span class="cx">     {
</span><del>-        if (!value-&gt;isPrimitiveValue())
</del><ins>+        if (!is&lt;CSSPrimitiveValue&gt;(*value))
</ins><span class="cx">             return;
</span><span class="cx"> 
</span><del>-        EDisplay display = *toCSSPrimitiveValue(value);
</del><ins>+        EDisplay display = downcast&lt;CSSPrimitiveValue&gt;(*value);
</ins><span class="cx"> 
</span><span class="cx">         if (!isValidDisplayValue(styleResolver, display))
</span><span class="cx">             return;
</span><span class="lines">@@ -2131,8 +2125,8 @@
</span><span class="cx">     static void setValue(RenderStyle* style, PassRefPtr&lt;ClipPathOperation&gt; value) { (style-&gt;*setterFunction)(value); }
</span><span class="cx">     static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
</span><span class="cx">     {
</span><del>-        if (value-&gt;isPrimitiveValue()) {
-            auto&amp; primitiveValue = toCSSPrimitiveValue(*value);
</del><ins>+        if (is&lt;CSSPrimitiveValue&gt;(*value)) {
+            auto&amp; primitiveValue = downcast&lt;CSSPrimitiveValue&gt;(*value);
</ins><span class="cx">             if (primitiveValue.getValueID() == CSSValueNone)
</span><span class="cx">                 setValue(styleResolver-&gt;style(), 0);
</span><span class="cx">             else if (primitiveValue.primitiveType() == CSSPrimitiveValue::CSS_URI) {
</span><span class="lines">@@ -2143,13 +2137,13 @@
</span><span class="cx">             }
</span><span class="cx">             return;
</span><span class="cx">         }
</span><del>-        if (!value-&gt;isValueList())
</del><ins>+        if (!is&lt;CSSValueList&gt;(*value))
</ins><span class="cx">             return;
</span><span class="cx">         CSSBoxType referenceBox = BoxMissing;
</span><span class="cx">         RefPtr&lt;ClipPathOperation&gt; operation;
</span><del>-        auto&amp; valueList = toCSSValueList(*value);
</del><ins>+        auto&amp; valueList = downcast&lt;CSSValueList&gt;(*value);
</ins><span class="cx">         for (unsigned i = 0; i &lt; valueList.length(); ++i) {
</span><del>-            auto&amp; primitiveValue = toCSSPrimitiveValue(*valueList.itemWithoutBoundsCheck(i));
</del><ins>+            auto&amp; primitiveValue = downcast&lt;CSSPrimitiveValue&gt;(*valueList.itemWithoutBoundsCheck(i));
</ins><span class="cx">             if (primitiveValue.isShape() &amp;&amp; !operation)
</span><span class="cx">                 operation = ShapeClipPathOperation::create(basicShapeForValue(styleResolver-&gt;state().cssToLengthConversionData(), primitiveValue.getShapeValue()));
</span><span class="cx">             else if ((primitiveValue.getValueID() == CSSValueContentBox
</span><span class="lines">@@ -2186,26 +2180,26 @@
</span><span class="cx">     static void setValue(RenderStyle* style, PassRefPtr&lt;ShapeValue&gt; value) { (style-&gt;*setterFunction)(value); }
</span><span class="cx">     static void applyValue(CSSPropertyID property, StyleResolver* styleResolver, CSSValue* value)
</span><span class="cx">     {
</span><del>-        if (value-&gt;isPrimitiveValue()) {
-            CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
-            if (primitiveValue-&gt;getValueID() == CSSValueAuto)
</del><ins>+        if (is&lt;CSSPrimitiveValue&gt;(*value)) {
+            CSSPrimitiveValue&amp; primitiveValue = downcast&lt;CSSPrimitiveValue&gt;(*value);
+            if (primitiveValue.getValueID() == CSSValueAuto)
</ins><span class="cx">                 setValue(styleResolver-&gt;style(), 0);
</span><span class="cx">         } else if (value-&gt;isImageValue() || value-&gt;isImageGeneratorValue() || value-&gt;isImageSetValue()) {
</span><span class="cx">             RefPtr&lt;ShapeValue&gt; shape = ShapeValue::createImageValue(styleResolver-&gt;styleImage(property, value));
</span><span class="cx">             setValue(styleResolver-&gt;style(), shape.release());
</span><del>-        } else if (value-&gt;isValueList()) {
</del><ins>+        } else if (is&lt;CSSValueList&gt;(*value)) {
</ins><span class="cx">             RefPtr&lt;BasicShape&gt; shape;
</span><span class="cx">             CSSBoxType referenceBox = BoxMissing;
</span><del>-            CSSValueList* valueList = toCSSValueList(value);
-            for (unsigned i = 0; i &lt; valueList-&gt;length(); ++i) {
-                CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(valueList-&gt;itemWithoutBoundsCheck(i));
-                if (primitiveValue-&gt;isShape())
-                    shape = basicShapeForValue(styleResolver-&gt;state().cssToLengthConversionData(), primitiveValue-&gt;getShapeValue());
-                else if (primitiveValue-&gt;getValueID() == CSSValueContentBox
-                    || primitiveValue-&gt;getValueID() == CSSValueBorderBox
-                    || primitiveValue-&gt;getValueID() == CSSValuePaddingBox
-                    || primitiveValue-&gt;getValueID() == CSSValueMarginBox)
-                    referenceBox = CSSBoxType(*primitiveValue);
</del><ins>+            CSSValueList&amp; valueList = downcast&lt;CSSValueList&gt;(*value);
+            for (unsigned i = 0; i &lt; valueList.length(); ++i) {
+                CSSPrimitiveValue&amp; primitiveValue = downcast&lt;CSSPrimitiveValue&gt;(*valueList.itemWithoutBoundsCheck(i));
+                if (primitiveValue.isShape())
+                    shape = basicShapeForValue(styleResolver-&gt;state().cssToLengthConversionData(), primitiveValue.getShapeValue());
+                else if (primitiveValue.getValueID() == CSSValueContentBox
+                    || primitiveValue.getValueID() == CSSValueBorderBox
+                    || primitiveValue.getValueID() == CSSValuePaddingBox
+                    || primitiveValue.getValueID() == CSSValueMarginBox)
+                    referenceBox = CSSBoxType(primitiveValue);
</ins><span class="cx">                 else
</span><span class="cx">                     return;
</span><span class="cx">             }
</span><span class="lines">@@ -2245,23 +2239,23 @@
</span><span class="cx"> 
</span><span class="cx">     static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
</span><span class="cx">     {
</span><del>-        if (!value-&gt;isValueList())
</del><ins>+        if (!is&lt;CSSValueList&gt;(*value))
</ins><span class="cx">             return;
</span><del>-        CSSValueList* valueList = toCSSValueList(value);
</del><ins>+        CSSValueList&amp; valueList = downcast&lt;CSSValueList&gt;(*value);
</ins><span class="cx">         ImageResolutionSource source = RenderStyle::initialImageResolutionSource();
</span><span class="cx">         ImageResolutionSnap snap = RenderStyle::initialImageResolutionSnap();
</span><span class="cx">         double resolution = RenderStyle::initialImageResolution();
</span><del>-        for (size_t i = 0; i &lt; valueList-&gt;length(); i++) {
-            CSSValue* item = valueList-&gt;itemWithoutBoundsCheck(i);
-            if (!item-&gt;isPrimitiveValue())
</del><ins>+        for (size_t i = 0; i &lt; valueList.length(); ++i) {
+            CSSValue&amp; item = *valueList.itemWithoutBoundsCheck(i);
+            if (!is&lt;CSSPrimitiveValue&gt;(item))
</ins><span class="cx">                 continue;
</span><del>-            CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(item);
-            if (primitiveValue-&gt;getValueID() == CSSValueFromImage)
</del><ins>+            CSSPrimitiveValue&amp; primitiveValue = downcast&lt;CSSPrimitiveValue&gt;(item);
+            if (primitiveValue.getValueID() == CSSValueFromImage)
</ins><span class="cx">                 source = ImageResolutionFromImage;
</span><del>-            else if (primitiveValue-&gt;getValueID() == CSSValueSnap)
</del><ins>+            else if (primitiveValue.getValueID() == CSSValueSnap)
</ins><span class="cx">                 snap = ImageResolutionSnapPixels;
</span><span class="cx">             else
</span><del>-                resolution = primitiveValue-&gt;getDoubleValue(CSSPrimitiveValue::CSS_DPPX);
</del><ins>+                resolution = primitiveValue.getDoubleValue(CSSPrimitiveValue::CSS_DPPX);
</ins><span class="cx">         }
</span><span class="cx">         styleResolver-&gt;style()-&gt;setImageResolutionSource(source);
</span><span class="cx">         styleResolver-&gt;style()-&gt;setImageResolutionSnap(snap);
</span><span class="lines">@@ -2297,7 +2291,7 @@
</span><span class="cx"> 
</span><span class="cx">     static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
</span><span class="cx">     {
</span><del>-        if (!value-&gt;isValueList())
</del><ins>+        if (!is&lt;CSSValueList&gt;(*value))
</ins><span class="cx">             return;
</span><span class="cx"> 
</span><span class="cx">         Length lengthOrPercentageValue;
</span><span class="lines">@@ -2305,19 +2299,19 @@
</span><span class="cx">         TextIndentLine textIndentLineValue = RenderStyle::initialTextIndentLine();
</span><span class="cx">         TextIndentType textIndentTypeValue = RenderStyle::initialTextIndentType();
</span><span class="cx"> #endif
</span><del>-        CSSValueList* valueList = toCSSValueList(value);
-        for (size_t i = 0; i &lt; valueList-&gt;length(); ++i) {
-            CSSValue* item = valueList-&gt;itemWithoutBoundsCheck(i);
-            if (!item-&gt;isPrimitiveValue())
</del><ins>+        CSSValueList&amp; valueList = downcast&lt;CSSValueList&gt;(*value);
+        for (size_t i = 0; i &lt; valueList.length(); ++i) {
+            CSSValue* item = valueList.itemWithoutBoundsCheck(i);
+            if (!is&lt;CSSPrimitiveValue&gt;(*item))
</ins><span class="cx">                 continue;
</span><span class="cx"> 
</span><del>-            CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(item);
-            if (!primitiveValue-&gt;getValueID())
-                lengthOrPercentageValue = primitiveValue-&gt;convertToLength&lt;FixedIntegerConversion | PercentConversion | CalculatedConversion&gt;(styleResolver-&gt;state().cssToLengthConversionData());
</del><ins>+            CSSPrimitiveValue&amp; primitiveValue = downcast&lt;CSSPrimitiveValue&gt;(*item);
+            if (!primitiveValue.getValueID())
+                lengthOrPercentageValue = primitiveValue.convertToLength&lt;FixedIntegerConversion | PercentConversion | CalculatedConversion&gt;(styleResolver-&gt;state().cssToLengthConversionData());
</ins><span class="cx"> #if ENABLE(CSS3_TEXT)
</span><del>-            else if (primitiveValue-&gt;getValueID() == CSSValueWebkitEachLine)
</del><ins>+            else if (primitiveValue.getValueID() == CSSValueWebkitEachLine)
</ins><span class="cx">                 textIndentLineValue = TextIndentEachLine;
</span><del>-            else if (primitiveValue-&gt;getValueID() == CSSValueWebkitHanging)
</del><ins>+            else if (primitiveValue.getValueID() == CSSValueWebkitHanging)
</ins><span class="cx">                 textIndentTypeValue = TextIndentHanging;
</span><span class="cx"> #endif
</span><span class="cx">         }
</span></span></pre></div>
<a id="trunkSourceWebCorecssMediaListcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/MediaList.cpp (174299 => 174300)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/MediaList.cpp        2014-10-03 23:05:07 UTC (rev 174299)
+++ trunk/Source/WebCore/css/MediaList.cpp        2014-10-03 23:17:00 UTC (rev 174300)
</span><span class="lines">@@ -332,10 +332,10 @@
</span><span class="cx">                 const MediaQueryExp* exp = expressions.at(j).get();
</span><span class="cx">                 if (exp-&gt;mediaFeature() == MediaFeatureNames::resolutionMediaFeature || exp-&gt;mediaFeature() == MediaFeatureNames::max_resolutionMediaFeature || exp-&gt;mediaFeature() == MediaFeatureNames::min_resolutionMediaFeature) {
</span><span class="cx">                     CSSValue* cssValue =  exp-&gt;value();
</span><del>-                    if (cssValue &amp;&amp; cssValue-&gt;isPrimitiveValue()) {
-                        CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(cssValue);
-                        if (primitiveValue-&gt;isDotsPerInch() || primitiveValue-&gt;isDotsPerCentimeter())
-                            addResolutionWarningMessageToConsole(document, mediaQuerySet-&gt;mediaText(), primitiveValue);
</del><ins>+                    if (is&lt;CSSPrimitiveValue&gt;(cssValue)) {
+                        CSSPrimitiveValue&amp; primitiveValue = downcast&lt;CSSPrimitiveValue&gt;(*cssValue);
+                        if (primitiveValue.isDotsPerInch() || primitiveValue.isDotsPerCentimeter())
+                            addResolutionWarningMessageToConsole(document, mediaQuerySet-&gt;mediaText(), &amp;primitiveValue);
</ins><span class="cx">                     }
</span><span class="cx">                 }
</span><span class="cx">             }
</span></span></pre></div>
<a id="trunkSourceWebCorecssMediaQueryEvaluatorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/MediaQueryEvaluator.cpp (174299 => 174300)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/MediaQueryEvaluator.cpp        2014-10-03 23:05:07 UTC (rev 174299)
+++ trunk/Source/WebCore/css/MediaQueryEvaluator.cpp        2014-10-03 23:17:00 UTC (rev 174300)
</span><span class="lines">@@ -186,9 +186,9 @@
</span><span class="cx"> 
</span><span class="cx"> static bool compareAspectRatioValue(CSSValue* value, int width, int height, MediaFeaturePrefix op)
</span><span class="cx"> {
</span><del>-    if (value-&gt;isAspectRatioValue()) {
-        CSSAspectRatioValue* aspectRatio = toCSSAspectRatioValue(value);
-        return compareValue(width * static_cast&lt;int&gt;(aspectRatio-&gt;denominatorValue()), height * static_cast&lt;int&gt;(aspectRatio-&gt;numeratorValue()), op);
</del><ins>+    if (is&lt;CSSAspectRatioValue&gt;(*value)) {
+        CSSAspectRatioValue&amp; aspectRatio = downcast&lt;CSSAspectRatioValue&gt;(*value);
+        return compareValue(width * static_cast&lt;int&gt;(aspectRatio.denominatorValue()), height * static_cast&lt;int&gt;(aspectRatio.numeratorValue()), op);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     return false;
</span><span class="lines">@@ -196,9 +196,8 @@
</span><span class="cx"> 
</span><span class="cx"> static bool numberValue(CSSValue* value, float&amp; result)
</span><span class="cx"> {
</span><del>-    if (value-&gt;isPrimitiveValue()
-        &amp;&amp; toCSSPrimitiveValue(value)-&gt;isNumber()) {
-        result = toCSSPrimitiveValue(value)-&gt;getFloatValue(CSSPrimitiveValue::CSS_NUMBER);
</del><ins>+    if (is&lt;CSSPrimitiveValue&gt;(*value) &amp;&amp; downcast&lt;CSSPrimitiveValue&gt;(*value).isNumber()) {
+        result = downcast&lt;CSSPrimitiveValue&gt;(*value).getFloatValue(CSSPrimitiveValue::CSS_NUMBER);
</ins><span class="cx">         return true;
</span><span class="cx">     }
</span><span class="cx">     return false;
</span><span class="lines">@@ -246,8 +245,8 @@
</span><span class="cx"> 
</span><span class="cx">     int width = view-&gt;layoutWidth();
</span><span class="cx">     int height = view-&gt;layoutHeight();
</span><del>-    if (value &amp;&amp; value-&gt;isPrimitiveValue()) {
-        const CSSValueID id = toCSSPrimitiveValue(value)-&gt;getValueID();
</del><ins>+    if (is&lt;CSSPrimitiveValue&gt;(value)) {
+        const CSSValueID id = downcast&lt;CSSPrimitiveValue&gt;(*value).getValueID();
</ins><span class="cx">         if (width &gt; height) // Square viewport is portrait.
</span><span class="cx">             return CSSValueLandscape == id;
</span><span class="cx">         return CSSValuePortrait == id;
</span><span class="lines">@@ -308,22 +307,22 @@
</span><span class="cx">     if (!value)
</span><span class="cx">         return !!deviceScaleFactor;
</span><span class="cx"> 
</span><del>-    if (!value-&gt;isPrimitiveValue())
</del><ins>+    if (!is&lt;CSSPrimitiveValue&gt;(*value))
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    CSSPrimitiveValue* resolution = toCSSPrimitiveValue(value);
-    return compareValue(deviceScaleFactor, resolution-&gt;isNumber() ? resolution-&gt;getFloatValue() : resolution-&gt;getFloatValue(CSSPrimitiveValue::CSS_DPPX), op);
</del><ins>+    CSSPrimitiveValue&amp; resolution = downcast&lt;CSSPrimitiveValue&gt;(*value);
+    return compareValue(deviceScaleFactor, resolution.isNumber() ? resolution.getFloatValue() : resolution.getFloatValue(CSSPrimitiveValue::CSS_DPPX), op);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static bool device_pixel_ratioMediaFeatureEval(CSSValue *value, const CSSToLengthConversionData&amp;, Frame* frame, MediaFeaturePrefix op)
</span><span class="cx"> {
</span><del>-    return (!value || toCSSPrimitiveValue(value)-&gt;isNumber()) &amp;&amp; evalResolution(value, frame, op);
</del><ins>+    return (!value || downcast&lt;CSSPrimitiveValue&gt;(*value).isNumber()) &amp;&amp; evalResolution(value, frame, op);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static bool resolutionMediaFeatureEval(CSSValue* value, const CSSToLengthConversionData&amp;, Frame* frame, MediaFeaturePrefix op)
</span><span class="cx"> {
</span><span class="cx"> #if ENABLE(RESOLUTION_MEDIA_QUERY)
</span><del>-    return (!value || toCSSPrimitiveValue(value)-&gt;isResolution()) &amp;&amp; evalResolution(value, frame, op);
</del><ins>+    return (!value || downcast&lt;CSSPrimitiveValue&gt;(*value).isResolution()) &amp;&amp; evalResolution(value, frame, op);
</ins><span class="cx"> #else
</span><span class="cx">     UNUSED_PARAM(value);
</span><span class="cx">     UNUSED_PARAM(frame);
</span><span class="lines">@@ -344,18 +343,18 @@
</span><span class="cx"> 
</span><span class="cx"> static bool computeLength(CSSValue* value, bool strict, const CSSToLengthConversionData&amp; conversionData, int&amp; result)
</span><span class="cx"> {
</span><del>-    if (!value-&gt;isPrimitiveValue())
</del><ins>+    if (!is&lt;CSSPrimitiveValue&gt;(*value))
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
</del><ins>+    CSSPrimitiveValue&amp; primitiveValue = downcast&lt;CSSPrimitiveValue&gt;(*value);
</ins><span class="cx"> 
</span><del>-    if (primitiveValue-&gt;isNumber()) {
-        result = primitiveValue-&gt;getIntValue();
</del><ins>+    if (primitiveValue.isNumber()) {
+        result = primitiveValue.getIntValue();
</ins><span class="cx">         return !strict || !result;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (primitiveValue-&gt;isLength()) {
-        result = primitiveValue-&gt;computeLength&lt;int&gt;(conversionData);
</del><ins>+    if (primitiveValue.isLength()) {
+        result = primitiveValue.computeLength&lt;int&gt;(conversionData);
</ins><span class="cx">         return true;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -593,7 +592,7 @@
</span><span class="cx">     if (!value)
</span><span class="cx">         return true;
</span><span class="cx"> 
</span><del>-    const int viewModeCSSKeywordID = toCSSPrimitiveValue(value)-&gt;getValueID();
</del><ins>+    const int viewModeCSSKeywordID = downcast&lt;CSSPrimitiveValue&gt;(*value).getValueID();
</ins><span class="cx">     const Page::ViewMode viewMode = frame-&gt;page()-&gt;viewMode();
</span><span class="cx">     bool result = false;
</span><span class="cx">     switch (viewMode) {
</span><span class="lines">@@ -688,10 +687,10 @@
</span><span class="cx">     if (!value)
</span><span class="cx">         return pointer != NoPointer;
</span><span class="cx"> 
</span><del>-    if (!value-&gt;isPrimitiveValue())
</del><ins>+    if (!is&lt;CSSPrimitiveValue&gt;(*value))
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    const CSSValueID id = toCSSPrimitiveValue(value)-&gt;getValueID();
</del><ins>+    const CSSValueID id = downcast&lt;CSSPrimitiveValue&gt;(*value).getValueID();
</ins><span class="cx">     return (pointer == NoPointer &amp;&amp; id == CSSValueNone)
</span><span class="cx">         || (pointer == TouchPointer &amp;&amp; id == CSSValueCoarse)
</span><span class="cx">         || (pointer == MousePointer &amp;&amp; id == CSSValueFine);
</span></span></pre></div>
<a id="trunkSourceWebCorecssSVGCSSStyleSelectorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/SVGCSSStyleSelector.cpp (174299 => 174300)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/SVGCSSStyleSelector.cpp        2014-10-03 23:05:07 UTC (rev 174299)
+++ trunk/Source/WebCore/css/SVGCSSStyleSelector.cpp        2014-10-03 23:17:00 UTC (rev 174300)
</span><span class="lines">@@ -103,9 +103,9 @@
</span><span class="cx"> void StyleResolver::applySVGProperty(CSSPropertyID id, CSSValue* value)
</span><span class="cx"> {
</span><span class="cx">     ASSERT(value);
</span><del>-    CSSPrimitiveValue* primitiveValue = 0;
-    if (value-&gt;isPrimitiveValue())
-        primitiveValue = toCSSPrimitiveValue(value);
</del><ins>+    CSSPrimitiveValue* primitiveValue = nullptr;
+    if (is&lt;CSSPrimitiveValue&gt;(*value))
+        primitiveValue = downcast&lt;CSSPrimitiveValue&gt;(value);
</ins><span class="cx"> 
</span><span class="cx">     const State&amp; state = m_state;
</span><span class="cx">     SVGRenderStyle&amp; svgStyle = state.style()-&gt;accessSVGStyle();
</span><span class="lines">@@ -208,13 +208,13 @@
</span><span class="cx">             // 'normal' is the only primitiveValue
</span><span class="cx">             if (primitiveValue)
</span><span class="cx">                 svgStyle.setPaintOrder(PaintOrderNormal);
</span><del>-            if (!value-&gt;isValueList())
</del><ins>+            if (!is&lt;CSSValueList&gt;(*value))
</ins><span class="cx">                 break;
</span><del>-            CSSValueList* orderTypeList = toCSSValueList(value);
</del><ins>+            CSSValueList&amp; orderTypeList = downcast&lt;CSSValueList&gt;(*value);
</ins><span class="cx"> 
</span><span class="cx">             // Serialization happened during parsing. No additional checking needed.
</span><del>-            unsigned length = orderTypeList-&gt;length();
-            primitiveValue = toCSSPrimitiveValue(orderTypeList-&gt;itemWithoutBoundsCheck(0));
</del><ins>+            unsigned length = orderTypeList.length();
+            primitiveValue = downcast&lt;CSSPrimitiveValue&gt;(orderTypeList.itemWithoutBoundsCheck(0));
</ins><span class="cx">             PaintOrder paintOrder;
</span><span class="cx">             switch (primitiveValue-&gt;getValueID()) {
</span><span class="cx">             case CSSValueFill:
</span><span class="lines">@@ -266,9 +266,9 @@
</span><span class="cx">                 svgStyle.setFillPaint(SVGRenderStyle::initialFillPaintType(), SVGRenderStyle::initialFillPaintColor(), SVGRenderStyle::initialFillPaintUri(), applyPropertyToRegularStyle(), applyPropertyToVisitedLinkStyle());
</span><span class="cx">                 return;
</span><span class="cx">             }
</span><del>-            if (value-&gt;isSVGPaint()) {
-                SVGPaint* svgPaint = toSVGPaint(value);
-                svgStyle.setFillPaint(svgPaint-&gt;paintType(), colorFromSVGColorCSSValue(svgPaint, state.style()-&gt;color()), svgPaint-&gt;uri(), applyPropertyToRegularStyle(), applyPropertyToVisitedLinkStyle());
</del><ins>+            if (is&lt;SVGPaint&gt;(*value)) {
+                SVGPaint&amp; svgPaint = downcast&lt;SVGPaint&gt;(*value);
+                svgStyle.setFillPaint(svgPaint.paintType(), colorFromSVGColorCSSValue(&amp;svgPaint, state.style()-&gt;color()), svgPaint.uri(), applyPropertyToRegularStyle(), applyPropertyToVisitedLinkStyle());
</ins><span class="cx">             }
</span><span class="cx">             break;
</span><span class="cx">         }
</span><span class="lines">@@ -283,30 +283,30 @@
</span><span class="cx">                 svgStyle.setStrokePaint(SVGRenderStyle::initialStrokePaintType(), SVGRenderStyle::initialStrokePaintColor(), SVGRenderStyle::initialStrokePaintUri(), applyPropertyToRegularStyle(), applyPropertyToVisitedLinkStyle());
</span><span class="cx">                 return;
</span><span class="cx">             }
</span><del>-            if (value-&gt;isSVGPaint()) {
-                SVGPaint* svgPaint = toSVGPaint(value);
-                svgStyle.setStrokePaint(svgPaint-&gt;paintType(), colorFromSVGColorCSSValue(svgPaint, state.style()-&gt;color()), svgPaint-&gt;uri(), applyPropertyToRegularStyle(), applyPropertyToVisitedLinkStyle());
</del><ins>+            if (is&lt;SVGPaint&gt;(*value)) {
+                SVGPaint&amp; svgPaint = downcast&lt;SVGPaint&gt;(*value);
+                svgStyle.setStrokePaint(svgPaint.paintType(), colorFromSVGColorCSSValue(&amp;svgPaint, state.style()-&gt;color()), svgPaint.uri(), applyPropertyToRegularStyle(), applyPropertyToVisitedLinkStyle());
</ins><span class="cx">             }
</span><span class="cx">             break;
</span><span class="cx">         }
</span><span class="cx">         case CSSPropertyStrokeDasharray:
</span><span class="cx">         {
</span><span class="cx">             HANDLE_INHERIT_AND_INITIAL(strokeDashArray, StrokeDashArray)
</span><del>-            if (!value-&gt;isValueList()) {
</del><ins>+            if (!is&lt;CSSValueList&gt;(*value)) {
</ins><span class="cx">                 svgStyle.setStrokeDashArray(SVGRenderStyle::initialStrokeDashArray());
</span><span class="cx">                 break;
</span><span class="cx">             }
</span><span class="cx"> 
</span><del>-            CSSValueList* dashes = toCSSValueList(value);
</del><ins>+            CSSValueList&amp; dashes = downcast&lt;CSSValueList&gt;(*value);
</ins><span class="cx"> 
</span><span class="cx">             Vector&lt;SVGLength&gt; array;
</span><del>-            size_t length = dashes-&gt;length();
</del><ins>+            size_t length = dashes.length();
</ins><span class="cx">             for (size_t i = 0; i &lt; length; ++i) {
</span><del>-                CSSValue* currValue = dashes-&gt;itemWithoutBoundsCheck(i);
-                if (!currValue-&gt;isPrimitiveValue())
</del><ins>+                CSSValue* currValue = dashes.itemWithoutBoundsCheck(i);
+                if (!is&lt;CSSPrimitiveValue&gt;(*currValue))
</ins><span class="cx">                     continue;
</span><span class="cx"> 
</span><del>-                CSSPrimitiveValue* dash = toCSSPrimitiveValue(dashes-&gt;itemWithoutBoundsCheck(i));
</del><ins>+                CSSPrimitiveValue* dash = downcast&lt;CSSPrimitiveValue&gt;(dashes.itemWithoutBoundsCheck(i));
</ins><span class="cx">                 array.append(SVGLength::fromCSSPrimitiveValue(dash));
</span><span class="cx">             }
</span><span class="cx"> 
</span><span class="lines">@@ -491,15 +491,15 @@
</span><span class="cx">         case CSSPropertyStopColor:
</span><span class="cx">         {
</span><span class="cx">             HANDLE_INHERIT_AND_INITIAL(stopColor, StopColor);
</span><del>-            if (value-&gt;isSVGColor())
-                svgStyle.setStopColor(colorFromSVGColorCSSValue(toSVGColor(value), state.style()-&gt;color()));
</del><ins>+            if (is&lt;SVGColor&gt;(*value))
+                svgStyle.setStopColor(colorFromSVGColorCSSValue(downcast&lt;SVGColor&gt;(value), state.style()-&gt;color()));
</ins><span class="cx">             break;
</span><span class="cx">         }
</span><span class="cx">        case CSSPropertyLightingColor:
</span><span class="cx">         {
</span><span class="cx">             HANDLE_INHERIT_AND_INITIAL(lightingColor, LightingColor);
</span><del>-            if (value-&gt;isSVGColor())
-                svgStyle.setLightingColor(colorFromSVGColorCSSValue(toSVGColor(value), state.style()-&gt;color()));
</del><ins>+            if (is&lt;SVGColor&gt;(*value))
+                svgStyle.setLightingColor(colorFromSVGColorCSSValue(downcast&lt;SVGColor&gt;(value), state.style()-&gt;color()));
</ins><span class="cx">             break;
</span><span class="cx">         }
</span><span class="cx">         case CSSPropertyFloodOpacity:
</span><span class="lines">@@ -523,8 +523,8 @@
</span><span class="cx">         case CSSPropertyFloodColor:
</span><span class="cx">         {
</span><span class="cx">             HANDLE_INHERIT_AND_INITIAL(floodColor, FloodColor);
</span><del>-            if (value-&gt;isSVGColor())
-                svgStyle.setFloodColor(colorFromSVGColorCSSValue(toSVGColor(value), state.style()-&gt;color()));
</del><ins>+            if (is&lt;SVGColor&gt;(*value))
+                svgStyle.setFloodColor(colorFromSVGColorCSSValue(downcast&lt;SVGColor&gt;(value), state.style()-&gt;color()));
</ins><span class="cx">             break;
</span><span class="cx">         }
</span><span class="cx">         case CSSPropertyGlyphOrientationHorizontal:
</span><span class="lines">@@ -571,27 +571,27 @@
</span><span class="cx">             if (isInitial || primitiveValue) // initial | none
</span><span class="cx">                 return svgStyle.setShadow(nullptr);
</span><span class="cx"> 
</span><del>-            if (!value-&gt;isValueList())
</del><ins>+            if (!is&lt;CSSValueList&gt;(*value))
</ins><span class="cx">                 return;
</span><span class="cx"> 
</span><del>-            CSSValueList* list = toCSSValueList(value);
-            if (!list-&gt;length())
</del><ins>+            CSSValueList&amp; list = downcast&lt;CSSValueList&gt;(*value);
+            if (!list.length())
</ins><span class="cx">                 return;
</span><span class="cx"> 
</span><del>-            CSSValue* firstValue = list-&gt;itemWithoutBoundsCheck(0);
-            if (!firstValue-&gt;isShadowValue())
</del><ins>+            CSSValue* firstValue = list.itemWithoutBoundsCheck(0);
+            if (!is&lt;CSSShadowValue&gt;(*firstValue))
</ins><span class="cx">                 return;
</span><del>-            CSSShadowValue* item = toCSSShadowValue(firstValue);
-            IntPoint location(item-&gt;x-&gt;computeLength&lt;int&gt;(state.cssToLengthConversionData().copyWithAdjustedZoom(1.0f)),
-                item-&gt;y-&gt;computeLength&lt;int&gt;(state.cssToLengthConversionData().copyWithAdjustedZoom(1.0f)));
-            int blur = item-&gt;blur ? item-&gt;blur-&gt;computeLength&lt;int&gt;(state.cssToLengthConversionData().copyWithAdjustedZoom(1.0f)) : 0;
</del><ins>+            CSSShadowValue&amp; item = downcast&lt;CSSShadowValue&gt;(*firstValue);
+            IntPoint location(item.x-&gt;computeLength&lt;int&gt;(state.cssToLengthConversionData().copyWithAdjustedZoom(1.0f)),
+                item.y-&gt;computeLength&lt;int&gt;(state.cssToLengthConversionData().copyWithAdjustedZoom(1.0f)));
+            int blur = item.blur ? item.blur-&gt;computeLength&lt;int&gt;(state.cssToLengthConversionData().copyWithAdjustedZoom(1.0f)) : 0;
</ins><span class="cx">             Color color;
</span><del>-            if (item-&gt;color)
-                color = colorFromPrimitiveValue(item-&gt;color.get());
</del><ins>+            if (item.color)
+                color = colorFromPrimitiveValue(item.color.get());
</ins><span class="cx"> 
</span><span class="cx">             // -webkit-svg-shadow does should not have a spread or style
</span><del>-            ASSERT(!item-&gt;spread);
-            ASSERT(!item-&gt;style);
</del><ins>+            ASSERT(!item.spread);
+            ASSERT(!item.style);
</ins><span class="cx"> 
</span><span class="cx">             auto shadowData = std::make_unique&lt;ShadowData&gt;(location, blur, 0, Normal, false, color.isValid() ? color : Color::transparent);
</span><span class="cx">             svgStyle.setShadow(WTF::move(shadowData));
</span></span></pre></div>
<a id="trunkSourceWebCorecssSourceSizeListcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/SourceSizeList.cpp (174299 => 174300)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/SourceSizeList.cpp        2014-10-03 23:05:07 UTC (rev 174299)
+++ trunk/Source/WebCore/css/SourceSizeList.cpp        2014-10-03 23:17:00 UTC (rev 174300)
</span><span class="lines">@@ -60,7 +60,7 @@
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx">     RefPtr&lt;CSSValue&gt; cssValue = value.createCSSValue();
</span><del>-    RefPtr&lt;CSSPrimitiveValue&gt; primitiveValue = toCSSPrimitiveValue(cssValue.get());
</del><ins>+    RefPtr&lt;CSSPrimitiveValue&gt; primitiveValue = downcast&lt;CSSPrimitiveValue&gt;(cssValue.get());
</ins><span class="cx">     return primitiveValue-&gt;computeLength&lt;unsigned&gt;(conversionData);
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorecssStylePropertiescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/StyleProperties.cpp (174299 => 174300)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/StyleProperties.cpp        2014-10-03 23:05:07 UTC (rev 174299)
+++ trunk/Source/WebCore/css/StyleProperties.cpp        2014-10-03 23:17:00 UTC (rev 174300)
</span><span class="lines">@@ -363,7 +363,7 @@
</span><span class="cx">         values[i] = getPropertyCSSValue(shorthand.properties()[i]);
</span><span class="cx">         if (values[i]) {
</span><span class="cx">             if (values[i]-&gt;isBaseValueList())
</span><del>-                numLayers = std::max(toCSSValueList(values[i].get())-&gt;length(), numLayers);
</del><ins>+                numLayers = std::max(downcast&lt;CSSValueList&gt;(*values[i]).length(), numLayers);
</ins><span class="cx">             else
</span><span class="cx">                 numLayers = std::max&lt;size_t&gt;(1U, numLayers);
</span><span class="cx">         }
</span><span class="lines">@@ -384,7 +384,7 @@
</span><span class="cx">             RefPtr&lt;CSSValue&gt; value;
</span><span class="cx">             if (values[j]) {
</span><span class="cx">                 if (values[j]-&gt;isBaseValueList())
</span><del>-                    value = toCSSValueList(values[j].get())-&gt;item(i);
</del><ins>+                    value = downcast&lt;CSSValueList&gt;(*values[j]).item(i);
</ins><span class="cx">                 else {
</span><span class="cx">                     value = values[j];
</span><span class="cx"> 
</span><span class="lines">@@ -408,16 +408,16 @@
</span><span class="cx">                     || (j &lt; size - 1 &amp;&amp; shorthand.properties()[j + 1] == CSSPropertyWebkitMaskRepeatY &amp;&amp; value)) {
</span><span class="cx">                     RefPtr&lt;CSSValue&gt; yValue;
</span><span class="cx">                     RefPtr&lt;CSSValue&gt; nextValue = values[j + 1];
</span><del>-                    if (nextValue-&gt;isValueList())
-                        yValue = toCSSValueList(nextValue.get())-&gt;itemWithoutBoundsCheck(i);
</del><ins>+                    if (is&lt;CSSValueList&gt;(*nextValue))
+                        yValue = downcast&lt;CSSValueList&gt;(*nextValue).itemWithoutBoundsCheck(i);
</ins><span class="cx">                     else
</span><span class="cx">                         yValue = nextValue;
</span><span class="cx"> 
</span><del>-                    if (!value-&gt;isPrimitiveValue() || !yValue-&gt;isPrimitiveValue())
</del><ins>+                    if (!is&lt;CSSPrimitiveValue&gt;(*value) || !is&lt;CSSPrimitiveValue&gt;(*yValue))
</ins><span class="cx">                         continue;
</span><span class="cx"> 
</span><del>-                    CSSValueID xId = toCSSPrimitiveValue(value.get())-&gt;getValueID();
-                    CSSValueID yId = toCSSPrimitiveValue(yValue.get())-&gt;getValueID();
</del><ins>+                    CSSValueID xId = downcast&lt;CSSPrimitiveValue&gt;(*value).getValueID();
+                    CSSValueID yId = downcast&lt;CSSPrimitiveValue&gt;(*yValue).getValueID();
</ins><span class="cx">                     if (xId != yId) {
</span><span class="cx">                         if (xId == CSSValueRepeat &amp;&amp; yId == CSSValueNoRepeat) {
</span><span class="cx">                             useRepeatXShorthand = true;
</span></span></pre></div>
<a id="trunkSourceWebCorecssStyleResolvercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/StyleResolver.cpp (174299 => 174300)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/StyleResolver.cpp        2014-10-03 23:05:07 UTC (rev 174299)
+++ trunk/Source/WebCore/css/StyleResolver.cpp        2014-10-03 23:17:00 UTC (rev 174300)
</span><span class="lines">@@ -1643,13 +1643,13 @@
</span><span class="cx">             switch (property.id()) {
</span><span class="cx">             case CSSPropertyWebkitWritingMode:
</span><span class="cx">                 if (!hadImportantWebkitWritingMode || property.isImportant()) {
</span><del>-                    writingMode = toCSSPrimitiveValue(*property.value());
</del><ins>+                    writingMode = downcast&lt;CSSPrimitiveValue&gt;(*property.value());
</ins><span class="cx">                     hadImportantWebkitWritingMode = property.isImportant();
</span><span class="cx">                 }
</span><span class="cx">                 break;
</span><span class="cx">             case CSSPropertyDirection:
</span><span class="cx">                 if (!hadImportantDirection || property.isImportant()) {
</span><del>-                    direction = toCSSPrimitiveValue(*property.value());
</del><ins>+                    direction = downcast&lt;CSSPrimitiveValue&gt;(*property.value());
</ins><span class="cx">                     hadImportantDirection = property.isImportant();
</span><span class="cx">                 }
</span><span class="cx">                 break;
</span><span class="lines">@@ -1931,22 +1931,22 @@
</span><span class="cx"> 
</span><span class="cx"> static bool createGridTrackSize(CSSValue* value, GridTrackSize&amp; trackSize, const StyleResolver::State&amp; state)
</span><span class="cx"> {
</span><del>-    if (value-&gt;isPrimitiveValue()) {
-        CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
</del><ins>+    if (is&lt;CSSPrimitiveValue&gt;(*value)) {
+        CSSPrimitiveValue&amp; primitiveValue = downcast&lt;CSSPrimitiveValue&gt;(*value);
</ins><span class="cx">         GridLength workingLength;
</span><del>-        if (!createGridTrackBreadth(primitiveValue, state, workingLength))
</del><ins>+        if (!createGridTrackBreadth(&amp;primitiveValue, state, workingLength))
</ins><span class="cx">             return false;
</span><span class="cx"> 
</span><span class="cx">         trackSize.setLength(workingLength);
</span><span class="cx">         return true;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    CSSFunctionValue* minmaxFunction = toCSSFunctionValue(value);
-    CSSValueList* arguments = minmaxFunction-&gt;arguments();
</del><ins>+    CSSFunctionValue&amp; minmaxFunction = downcast&lt;CSSFunctionValue&gt;(*value);
+    CSSValueList* arguments = minmaxFunction.arguments();
</ins><span class="cx">     ASSERT_WITH_SECURITY_IMPLICATION(arguments-&gt;length() == 2);
</span><span class="cx">     GridLength minTrackBreadth;
</span><span class="cx">     GridLength maxTrackBreadth;
</span><del>-    if (!createGridTrackBreadth(toCSSPrimitiveValue(arguments-&gt;itemWithoutBoundsCheck(0)), state, minTrackBreadth) || !createGridTrackBreadth(toCSSPrimitiveValue(arguments-&gt;itemWithoutBoundsCheck(1)), state, maxTrackBreadth))
</del><ins>+    if (!createGridTrackBreadth(downcast&lt;CSSPrimitiveValue&gt;(arguments-&gt;itemWithoutBoundsCheck(0)), state, minTrackBreadth) || !createGridTrackBreadth(downcast&lt;CSSPrimitiveValue&gt;(arguments-&gt;itemWithoutBoundsCheck(1)), state, maxTrackBreadth))
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     trackSize.setMinMax(minTrackBreadth, maxTrackBreadth);
</span><span class="lines">@@ -1956,9 +1956,9 @@
</span><span class="cx"> static bool createGridTrackList(CSSValue* value, Vector&lt;GridTrackSize&gt;&amp; trackSizes, NamedGridLinesMap&amp; namedGridLines, OrderedNamedGridLinesMap&amp; orderedNamedGridLines, const StyleResolver::State&amp; state)
</span><span class="cx"> {
</span><span class="cx">     // Handle 'none'.
</span><del>-    if (value-&gt;isPrimitiveValue()) {
-        CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
-        return primitiveValue-&gt;getValueID() == CSSValueNone;
</del><ins>+    if (is&lt;CSSPrimitiveValue&gt;(*value)) {
+        CSSPrimitiveValue&amp; primitiveValue = downcast&lt;CSSPrimitiveValue&gt;(*value);
+        return primitiveValue.getValueID() == CSSValueNone;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (!value-&gt;isValueList())
</span><span class="lines">@@ -1967,10 +1967,10 @@
</span><span class="cx">     size_t currentNamedGridLine = 0;
</span><span class="cx">     for (CSSValueListIterator i = value; i.hasMore(); i.advance()) {
</span><span class="cx">         CSSValue* currValue = i.value();
</span><del>-        if (currValue-&gt;isGridLineNamesValue()) {
-            CSSGridLineNamesValue* lineNamesValue = toCSSGridLineNamesValue(currValue);
-            for (CSSValueListIterator j = lineNamesValue; j.hasMore(); j.advance()) {
-                String namedGridLine = toCSSPrimitiveValue(j.value())-&gt;getStringValue();
</del><ins>+        if (is&lt;CSSGridLineNamesValue&gt;(*currValue)) {
+            CSSGridLineNamesValue&amp; lineNamesValue = downcast&lt;CSSGridLineNamesValue&gt;(*currValue);
+            for (CSSValueListIterator j = &amp;lineNamesValue; j.hasMore(); j.advance()) {
+                String namedGridLine = downcast&lt;CSSPrimitiveValue&gt;(j.value())-&gt;getStringValue();
</ins><span class="cx">                 NamedGridLinesMap::AddResult result = namedGridLines.add(namedGridLine, Vector&lt;size_t&gt;());
</span><span class="cx">                 result.iterator-&gt;value.append(currentNamedGridLine);
</span><span class="cx">                 OrderedNamedGridLinesMap::AddResult orderedResult = orderedNamedGridLines.add(currentNamedGridLine, Vector&lt;String&gt;());
</span><span class="lines">@@ -1998,37 +1998,37 @@
</span><span class="cx"> {
</span><span class="cx">     // We accept the specification's grammar:
</span><span class="cx">     // auto | &lt;custom-ident&gt; | [ &lt;integer&gt; &amp;&amp; &lt;custom-ident&gt;? ] | [ span &amp;&amp; [ &lt;integer&gt; || &lt;custom-ident&gt; ] ]
</span><del>-    if (value-&gt;isPrimitiveValue()) {
-        CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
</del><ins>+    if (is&lt;CSSPrimitiveValue&gt;(*value)) {
+        CSSPrimitiveValue&amp; primitiveValue = downcast&lt;CSSPrimitiveValue&gt;(*value);
</ins><span class="cx">         // We translate &lt;ident&gt; to &lt;string&gt; during parsing as it makes handling it simpler.
</span><del>-        if (primitiveValue-&gt;isString()) {
-            position.setNamedGridArea(primitiveValue-&gt;getStringValue());
</del><ins>+        if (primitiveValue.isString()) {
+            position.setNamedGridArea(primitiveValue.getStringValue());
</ins><span class="cx">             return true;
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        ASSERT(primitiveValue-&gt;getValueID() == CSSValueAuto);
</del><ins>+        ASSERT(primitiveValue.getValueID() == CSSValueAuto);
</ins><span class="cx">         return true;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    CSSValueList* values = toCSSValueList(value);
-    ASSERT(values-&gt;length());
</del><ins>+    CSSValueList&amp; values = downcast&lt;CSSValueList&gt;(*value);
+    ASSERT(values.length());
</ins><span class="cx"> 
</span><span class="cx">     bool isSpanPosition = false;
</span><span class="cx">     int gridLineNumber = 0;
</span><span class="cx">     String gridLineName;
</span><span class="cx"> 
</span><del>-    CSSValueListIterator it = values;
-    CSSPrimitiveValue* currentValue = toCSSPrimitiveValue(it.value());
</del><ins>+    CSSValueListIterator it = &amp;values;
+    CSSPrimitiveValue* currentValue = downcast&lt;CSSPrimitiveValue&gt;(it.value());
</ins><span class="cx">     if (currentValue-&gt;getValueID() == CSSValueSpan) {
</span><span class="cx">         isSpanPosition = true;
</span><span class="cx">         it.advance();
</span><del>-        currentValue = it.hasMore() ? toCSSPrimitiveValue(it.value()) : 0;
</del><ins>+        currentValue = it.hasMore() ? downcast&lt;CSSPrimitiveValue&gt;(it.value()) : nullptr;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (currentValue &amp;&amp; currentValue-&gt;isNumber()) {
</span><span class="cx">         gridLineNumber = currentValue-&gt;getIntValue();
</span><span class="cx">         it.advance();
</span><del>-        currentValue = it.hasMore() ? toCSSPrimitiveValue(it.value()) : 0;
</del><ins>+        currentValue = it.hasMore() ? downcast&lt;CSSPrimitiveValue&gt;(it.value()) : nullptr;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (currentValue &amp;&amp; currentValue-&gt;isString()) {
</span><span class="lines">@@ -2055,7 +2055,7 @@
</span><span class="cx"> 
</span><span class="cx"> Length StyleResolver::parseSnapCoordinate(CSSValueList&amp; valueList, unsigned offset)
</span><span class="cx"> {
</span><del>-    return parseSnapCoordinate(toCSSPrimitiveValue(*valueList.item(offset)));
</del><ins>+    return parseSnapCoordinate(downcast&lt;CSSPrimitiveValue&gt;(*valueList.item(offset)));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> LengthSize StyleResolver::parseSnapCoordinatePair(CSSValueList&amp; valueList, unsigned offset)
</span><span class="lines">@@ -2067,14 +2067,14 @@
</span><span class="cx"> {
</span><span class="cx">     ScrollSnapPoints points;
</span><span class="cx"> 
</span><del>-    if (value.isPrimitiveValue() &amp;&amp; toCSSPrimitiveValue(value).getValueID() == CSSValueElements) {
</del><ins>+    if (is&lt;CSSPrimitiveValue&gt;(value) &amp;&amp; downcast&lt;CSSPrimitiveValue&gt;(value).getValueID() == CSSValueElements) {
</ins><span class="cx">         points.usesElements = true;
</span><span class="cx">         return points;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     points.hasRepeat = false;
</span><span class="cx">     for (CSSValueListIterator it(&amp;value); it.hasMore(); it.advance()) {
</span><del>-        auto&amp; itemValue = toCSSPrimitiveValue(*it.value());
</del><ins>+        auto&amp; itemValue = downcast&lt;CSSPrimitiveValue&gt;(*it.value());
</ins><span class="cx">         if (auto* lengthRepeat = itemValue.getLengthRepeatValue()) {
</span><span class="cx">             if (auto* interval = lengthRepeat-&gt;interval()) {
</span><span class="cx">                 points.repeatOffset = parseSnapCoordinate(*interval);
</span><span class="lines">@@ -2127,7 +2127,7 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    CSSPrimitiveValue* primitiveValue = value-&gt;isPrimitiveValue() ? toCSSPrimitiveValue(value) : 0;
</del><ins>+    CSSPrimitiveValue* primitiveValue = is&lt;CSSPrimitiveValue&gt;(*value) ? downcast&lt;CSSPrimitiveValue&gt;(value) : nullptr;
</ins><span class="cx"> 
</span><span class="cx">     // What follows is a list that maps the CSS properties into their corresponding front-end
</span><span class="cx">     // RenderStyle values.
</span><span class="lines">@@ -2150,48 +2150,48 @@
</span><span class="cx">             bool didSet = false;
</span><span class="cx">             for (CSSValueListIterator i = value; i.hasMore(); i.advance()) {
</span><span class="cx">                 CSSValue* item = i.value();
</span><del>-                if (item-&gt;isImageGeneratorValue()) {
-                    if (item-&gt;isGradientValue())
-                        state.style()-&gt;setContent(StyleGeneratedImage::create(*toCSSGradientValue(item)-&gt;gradientWithStylesResolved(this)), didSet);
</del><ins>+                if (is&lt;CSSImageGeneratorValue&gt;(*item)) {
+                    if (is&lt;CSSGradientValue&gt;(*item))
+                        state.style()-&gt;setContent(StyleGeneratedImage::create(*downcast&lt;CSSGradientValue&gt;(*item).gradientWithStylesResolved(this)), didSet);
</ins><span class="cx">                     else
</span><del>-                        state.style()-&gt;setContent(StyleGeneratedImage::create(*toCSSImageGeneratorValue(item)), didSet);
</del><ins>+                        state.style()-&gt;setContent(StyleGeneratedImage::create(downcast&lt;CSSImageGeneratorValue&gt;(*item)), didSet);
</ins><span class="cx">                     didSet = true;
</span><span class="cx"> #if ENABLE(CSS_IMAGE_SET)
</span><del>-                } else if (item-&gt;isImageSetValue()) {
-                    state.style()-&gt;setContent(setOrPendingFromValue(CSSPropertyContent, toCSSImageSetValue(item)), didSet);
</del><ins>+                } else if (is&lt;CSSImageSetValue&gt;(*item)) {
+                    state.style()-&gt;setContent(setOrPendingFromValue(CSSPropertyContent, downcast&lt;CSSImageSetValue&gt;(item)), didSet);
</ins><span class="cx">                     didSet = true;
</span><span class="cx"> #endif
</span><span class="cx">                 }
</span><span class="cx"> 
</span><del>-                if (item-&gt;isImageValue()) {
-                    state.style()-&gt;setContent(cachedOrPendingFromValue(CSSPropertyContent, toCSSImageValue(item)), didSet);
</del><ins>+                if (is&lt;CSSImageValue&gt;(*item)) {
+                    state.style()-&gt;setContent(cachedOrPendingFromValue(CSSPropertyContent, downcast&lt;CSSImageValue&gt;(item)), didSet);
</ins><span class="cx">                     didSet = true;
</span><span class="cx">                     continue;
</span><span class="cx">                 }
</span><span class="cx"> 
</span><del>-                if (!item-&gt;isPrimitiveValue())
</del><ins>+                if (!is&lt;CSSPrimitiveValue&gt;(*item))
</ins><span class="cx">                     continue;
</span><span class="cx"> 
</span><del>-                CSSPrimitiveValue* contentValue = toCSSPrimitiveValue(item);
</del><ins>+                CSSPrimitiveValue&amp; contentValue = downcast&lt;CSSPrimitiveValue&gt;(*item);
</ins><span class="cx"> 
</span><del>-                if (contentValue-&gt;isString()) {
-                    state.style()-&gt;setContent(contentValue-&gt;getStringValue().impl(), didSet);
</del><ins>+                if (contentValue.isString()) {
+                    state.style()-&gt;setContent(contentValue.getStringValue().impl(), didSet);
</ins><span class="cx">                     didSet = true;
</span><del>-                } else if (contentValue-&gt;isAttr()) {
</del><ins>+                } else if (contentValue.isAttr()) {
</ins><span class="cx">                     // FIXME: Can a namespace be specified for an attr(foo)?
</span><span class="cx">                     if (state.style()-&gt;styleType() == NOPSEUDO)
</span><span class="cx">                         state.style()-&gt;setUnique();
</span><span class="cx">                     else
</span><span class="cx">                         state.parentStyle()-&gt;setUnique();
</span><del>-                    QualifiedName attr(nullAtom, contentValue-&gt;getStringValue().impl(), nullAtom);
</del><ins>+                    QualifiedName attr(nullAtom, contentValue.getStringValue().impl(), nullAtom);
</ins><span class="cx">                     const AtomicString&amp; value = state.element()-&gt;getAttribute(attr);
</span><span class="cx">                     state.style()-&gt;setContent(value.isNull() ? emptyAtom : value.impl(), didSet);
</span><span class="cx">                     didSet = true;
</span><span class="cx">                     // Register the fact that the attribute value affects the style.
</span><span class="cx">                     m_ruleSets.features().attributeCanonicalLocalNamesInRules.add(attr.localName().impl());
</span><span class="cx">                     m_ruleSets.features().attributeLocalNamesInRules.add(attr.localName().impl());
</span><del>-                } else if (contentValue-&gt;isCounter()) {
-                    Counter* counterValue = contentValue-&gt;getCounterValue();
</del><ins>+                } else if (contentValue.isCounter()) {
+                    Counter* counterValue = contentValue.getCounterValue();
</ins><span class="cx">                     EListStyleType listStyleType = NoneListStyle;
</span><span class="cx">                     CSSValueID listStyleIdent = counterValue-&gt;listStyleIdent();
</span><span class="cx">                     if (listStyleIdent != CSSValueNone)
</span><span class="lines">@@ -2200,7 +2200,7 @@
</span><span class="cx">                     state.style()-&gt;setContent(WTF::move(counter), didSet);
</span><span class="cx">                     didSet = true;
</span><span class="cx">                 } else {
</span><del>-                    switch (contentValue-&gt;getValueID()) {
</del><ins>+                    switch (contentValue.getValueID()) {
</ins><span class="cx">                     case CSSValueOpenQuote:
</span><span class="cx">                         state.style()-&gt;setContent(OPEN_QUOTE, didSet);
</span><span class="cx">                         didSet = true;
</span><span class="lines">@@ -2258,22 +2258,20 @@
</span><span class="cx">             return;
</span><span class="cx">         }
</span><span class="cx">         if (isInitial) {
</span><del>-            state.style()-&gt;setQuotes(0);
</del><ins>+            state.style()-&gt;setQuotes(nullptr);
</ins><span class="cx">             return;
</span><span class="cx">         }
</span><del>-        if (value-&gt;isValueList()) {
-            CSSValueList* list = toCSSValueList(value);
</del><ins>+        if (is&lt;CSSValueList&gt;(*value)) {
+            CSSValueList&amp; list = downcast&lt;CSSValueList&gt;(*value);
</ins><span class="cx">             Vector&lt;std::pair&lt;String, String&gt;&gt; quotes;
</span><del>-            for (size_t i = 0; i &lt; list-&gt;length(); i += 2) {
-                CSSValue* first = list-&gt;itemWithoutBoundsCheck(i);
</del><ins>+            for (size_t i = 0; i &lt; list.length(); i += 2) {
+                CSSValue* first = list.itemWithoutBoundsCheck(i);
</ins><span class="cx">                 // item() returns null if out of bounds so this is safe.
</span><del>-                CSSValue* second = list-&gt;item(i + 1);
</del><ins>+                CSSValue* second = list.item(i + 1);
</ins><span class="cx">                 if (!second)
</span><span class="cx">                     continue;
</span><del>-                ASSERT_WITH_SECURITY_IMPLICATION(first-&gt;isPrimitiveValue());
-                ASSERT_WITH_SECURITY_IMPLICATION(second-&gt;isPrimitiveValue());
-                String startQuote = toCSSPrimitiveValue(first)-&gt;getStringValue();
-                String endQuote = toCSSPrimitiveValue(second)-&gt;getStringValue();
</del><ins>+                String startQuote = downcast&lt;CSSPrimitiveValue&gt;(*first).getStringValue();
+                String endQuote = downcast&lt;CSSPrimitiveValue&gt;(*second).getStringValue();
</ins><span class="cx">                 quotes.append(std::make_pair(startQuote, endQuote));
</span><span class="cx">             }
</span><span class="cx">             state.style()-&gt;setQuotes(QuotesData::create(quotes));
</span><span class="lines">@@ -2318,24 +2316,24 @@
</span><span class="cx">                 fontDescription.setComputedSize(Style::computedFontSizeFromSpecifiedSize(fontDescription.specifiedSize(), fontDescription.isAbsoluteSize(), useSVGZoomRules(), state.style(), document()));
</span><span class="cx">                 setFontDescription(fontDescription);
</span><span class="cx">             }
</span><del>-        } else if (value-&gt;isFontValue()) {
-            CSSFontValue* font = toCSSFontValue(value);
-            if (!font-&gt;style || !font-&gt;variant || !font-&gt;weight
-                || !font-&gt;size || !font-&gt;lineHeight || !font-&gt;family)
</del><ins>+        } else if (is&lt;CSSFontValue&gt;(*value)) {
+            CSSFontValue&amp; font = downcast&lt;CSSFontValue&gt;(*value);
+            if (!font.style || !font.variant || !font.weight
+                || !font.size || !font.lineHeight || !font.family)
</ins><span class="cx">                 return;
</span><del>-            applyProperty(CSSPropertyFontStyle, font-&gt;style.get());
-            applyProperty(CSSPropertyFontVariant, font-&gt;variant.get());
-            applyProperty(CSSPropertyFontWeight, font-&gt;weight.get());
</del><ins>+            applyProperty(CSSPropertyFontStyle, font.style.get());
+            applyProperty(CSSPropertyFontVariant, font.variant.get());
+            applyProperty(CSSPropertyFontWeight, font.weight.get());
</ins><span class="cx">             // The previous properties can dirty our font but they don't try to read the font's
</span><span class="cx">             // properties back, which is safe. However if font-size is using the 'ex' unit, it will
</span><span class="cx">             // need query the dirtied font's x-height to get the computed size. To be safe in this
</span><span class="cx">             // case, let's just update the font now.
</span><span class="cx">             updateFont();
</span><del>-            applyProperty(CSSPropertyFontSize, font-&gt;size.get());
</del><ins>+            applyProperty(CSSPropertyFontSize, font.size.get());
</ins><span class="cx"> 
</span><del>-            state.setLineHeightValue(font-&gt;lineHeight.get());
</del><ins>+            state.setLineHeightValue(font.lineHeight.get());
</ins><span class="cx"> 
</span><del>-            applyProperty(CSSPropertyFontFamily, font-&gt;family.get());
</del><ins>+            applyProperty(CSSPropertyFontFamily, font.family.get());
</ins><span class="cx">         }
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="lines">@@ -2405,17 +2403,17 @@
</span><span class="cx"> 
</span><span class="cx">         for (CSSValueListIterator i = value; i.hasMore(); i.advance()) {
</span><span class="cx">             CSSValue* currValue = i.value();
</span><del>-            if (!currValue-&gt;isShadowValue())
</del><ins>+            if (!is&lt;CSSShadowValue&gt;(*currValue))
</ins><span class="cx">                 continue;
</span><del>-            CSSShadowValue* item = toCSSShadowValue(currValue);
-            int x = item-&gt;x-&gt;computeLength&lt;int&gt;(state.cssToLengthConversionData());
-            int y = item-&gt;y-&gt;computeLength&lt;int&gt;(state.cssToLengthConversionData());
-            int blur = item-&gt;blur ? item-&gt;blur-&gt;computeLength&lt;int&gt;(state.cssToLengthConversionData()) : 0;
-            int spread = item-&gt;spread ? item-&gt;spread-&gt;computeLength&lt;int&gt;(state.cssToLengthConversionData()) : 0;
-            ShadowStyle shadowStyle = item-&gt;style &amp;&amp; item-&gt;style-&gt;getValueID() == CSSValueInset ? Inset : Normal;
</del><ins>+            CSSShadowValue&amp; item = downcast&lt;CSSShadowValue&gt;(*currValue);
+            int x = item.x-&gt;computeLength&lt;int&gt;(state.cssToLengthConversionData());
+            int y = item.y-&gt;computeLength&lt;int&gt;(state.cssToLengthConversionData());
+            int blur = item.blur ? item.blur-&gt;computeLength&lt;int&gt;(state.cssToLengthConversionData()) : 0;
+            int spread = item.spread ? item.spread-&gt;computeLength&lt;int&gt;(state.cssToLengthConversionData()) : 0;
+            ShadowStyle shadowStyle = item.style &amp;&amp; item.style-&gt;getValueID() == CSSValueInset ? Inset : Normal;
</ins><span class="cx">             Color color;
</span><del>-            if (item-&gt;color)
-                color = colorFromPrimitiveValue(item-&gt;color.get());
</del><ins>+            if (item.color)
+                color = colorFromPrimitiveValue(item.color.get());
</ins><span class="cx">             else if (state.style())
</span><span class="cx">                 color = state.style()-&gt;color();
</span><span class="cx"> 
</span><span class="lines">@@ -2434,17 +2432,17 @@
</span><span class="cx">             return;
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        if (!value-&gt;isReflectValue())
</del><ins>+        if (!is&lt;CSSReflectValue&gt;(*value))
</ins><span class="cx">             return;
</span><span class="cx"> 
</span><del>-        CSSReflectValue* reflectValue = toCSSReflectValue(value);
</del><ins>+        CSSReflectValue&amp; reflectValue = downcast&lt;CSSReflectValue&gt;(*value);
</ins><span class="cx">         RefPtr&lt;StyleReflection&gt; reflection = StyleReflection::create();
</span><del>-        reflection-&gt;setDirection(*reflectValue-&gt;direction());
-        if (reflectValue-&gt;offset())
-            reflection-&gt;setOffset(reflectValue-&gt;offset()-&gt;convertToLength&lt;FixedIntegerConversion | PercentConversion | CalculatedConversion&gt;(state.cssToLengthConversionData()));
</del><ins>+        reflection-&gt;setDirection(*reflectValue.direction());
+        if (reflectValue.offset())
+            reflection-&gt;setOffset(reflectValue.offset()-&gt;convertToLength&lt;FixedIntegerConversion | PercentConversion | CalculatedConversion&gt;(state.cssToLengthConversionData()));
</ins><span class="cx">         NinePieceImage mask;
</span><span class="cx">         mask.setMaskDefaults();
</span><del>-        m_styleMap.mapNinePieceImage(id, reflectValue-&gt;mask(), mask);
</del><ins>+        m_styleMap.mapNinePieceImage(id, reflectValue.mask(), mask);
</ins><span class="cx">         reflection-&gt;setMask(mask);
</span><span class="cx"> 
</span><span class="cx">         state.style()-&gt;setBoxReflect(reflection.release());
</span><span class="lines">@@ -2665,10 +2663,10 @@
</span><span class="cx">             return;
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        if (!value-&gt;isLineBoxContainValue())
</del><ins>+        if (!is&lt;CSSLineBoxContainValue&gt;(*value))
</ins><span class="cx">             return;
</span><span class="cx"> 
</span><del>-        state.style()-&gt;setLineBoxContain(toCSSLineBoxContainValue(value)-&gt;value());
</del><ins>+        state.style()-&gt;setLineBoxContain(downcast&lt;CSSLineBoxContainValue&gt;(*value).value());
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -2679,19 +2677,19 @@
</span><span class="cx">             return;
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        if (!value-&gt;isValueList())
</del><ins>+        if (!is&lt;CSSValueList&gt;(*value))
</ins><span class="cx">             return;
</span><span class="cx"> 
</span><span class="cx">         FontDescription fontDescription = state.style()-&gt;fontDescription();
</span><del>-        CSSValueList* list = toCSSValueList(value);
</del><ins>+        CSSValueList&amp; list = downcast&lt;CSSValueList&gt;(*value);
</ins><span class="cx">         RefPtr&lt;FontFeatureSettings&gt; settings = FontFeatureSettings::create();
</span><del>-        int len = list-&gt;length();
-        for (int i = 0; i &lt; len; ++i) {
-            CSSValue* item = list-&gt;itemWithoutBoundsCheck(i);
-            if (!item-&gt;isFontFeatureValue())
</del><ins>+        int length = list.length();
+        for (int i = 0; i &lt; length; ++i) {
+            CSSValue* item = list.itemWithoutBoundsCheck(i);
+            if (!is&lt;CSSFontFeatureValue&gt;(*item))
</ins><span class="cx">                 continue;
</span><del>-            CSSFontFeatureValue* feature = toCSSFontFeatureValue(item);
-            settings-&gt;append(FontFeature(feature-&gt;tag(), feature-&gt;value()));
</del><ins>+            CSSFontFeatureValue&amp; feature = downcast&lt;CSSFontFeatureValue&gt;(*item);
+            settings-&gt;append(FontFeature(feature.tag(), feature.value()));
</ins><span class="cx">         }
</span><span class="cx">         fontDescription.setFeatureSettings(settings.release());
</span><span class="cx">         setFontDescription(fontDescription);
</span><span class="lines">@@ -2830,8 +2828,8 @@
</span><span class="cx">             return;
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        CSSGridTemplateAreasValue* gridTemplateAreasValue = toCSSGridTemplateAreasValue(value);
-        const NamedGridAreaMap&amp; newNamedGridAreas = gridTemplateAreasValue-&gt;gridAreaMap();
</del><ins>+        CSSGridTemplateAreasValue&amp; gridTemplateAreasValue = downcast&lt;CSSGridTemplateAreasValue&gt;(*value);
+        const NamedGridAreaMap&amp; newNamedGridAreas = gridTemplateAreasValue.gridAreaMap();
</ins><span class="cx"> 
</span><span class="cx">         NamedGridLinesMap namedGridColumnLines = state.style()-&gt;namedGridColumnLines();
</span><span class="cx">         NamedGridLinesMap namedGridRowLines = state.style()-&gt;namedGridRowLines();
</span><span class="lines">@@ -2840,27 +2838,27 @@
</span><span class="cx">         state.style()-&gt;setNamedGridColumnLines(namedGridColumnLines);
</span><span class="cx">         state.style()-&gt;setNamedGridRowLines(namedGridRowLines);
</span><span class="cx"> 
</span><del>-        state.style()-&gt;setNamedGridArea(gridTemplateAreasValue-&gt;gridAreaMap());
-        state.style()-&gt;setNamedGridAreaRowCount(gridTemplateAreasValue-&gt;rowCount());
-        state.style()-&gt;setNamedGridAreaColumnCount(gridTemplateAreasValue-&gt;columnCount());
</del><ins>+        state.style()-&gt;setNamedGridArea(gridTemplateAreasValue.gridAreaMap());
+        state.style()-&gt;setNamedGridAreaRowCount(gridTemplateAreasValue.rowCount());
+        state.style()-&gt;setNamedGridAreaColumnCount(gridTemplateAreasValue.columnCount());
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx">     case CSSPropertyWebkitGridAutoFlow: {
</span><span class="cx">         HANDLE_INHERIT_AND_INITIAL(gridAutoFlow, GridAutoFlow);
</span><del>-        if (!value-&gt;isValueList())
</del><ins>+        if (!is&lt;CSSValueList&gt;(*value))
</ins><span class="cx">             return;
</span><del>-        CSSValueList* list = toCSSValueList(value);
</del><ins>+        CSSValueList&amp; list = downcast&lt;CSSValueList&gt;(*value);
</ins><span class="cx"> 
</span><del>-        if (!list-&gt;length()) {
</del><ins>+        if (!list.length()) {
</ins><span class="cx">             state.style()-&gt;setGridAutoFlow(RenderStyle::initialGridAutoFlow());
</span><span class="cx">             return;
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        CSSPrimitiveValue* first = toCSSPrimitiveValue(list-&gt;item(0));
-        CSSPrimitiveValue* second = list-&gt;length() == 2 ? toCSSPrimitiveValue(list-&gt;item(1)) : nullptr;
</del><ins>+        CSSPrimitiveValue&amp; first = downcast&lt;CSSPrimitiveValue&gt;(*list.item(0));
+        CSSPrimitiveValue* second = list.length() == 2 ? downcast&lt;CSSPrimitiveValue&gt;(list.item(1)) : nullptr;
</ins><span class="cx"> 
</span><span class="cx">         GridAutoFlow autoFlow = RenderStyle::initialGridAutoFlow();
</span><del>-        switch (first-&gt;getValueID()) {
</del><ins>+        switch (first.getValueID()) {
</ins><span class="cx">         case CSSValueRow:
</span><span class="cx">             if (second)
</span><span class="cx">                 autoFlow = second-&gt;getValueID() == CSSValueDense ? AutoFlowRowDense : AutoFlowStackRow;
</span><span class="lines">@@ -2907,12 +2905,12 @@
</span><span class="cx">         break;
</span><span class="cx">     case CSSPropertyWebkitScrollSnapDestination: {
</span><span class="cx">         HANDLE_INHERIT_AND_INITIAL(scrollSnapDestination, ScrollSnapDestination)
</span><del>-        state.style()-&gt;setScrollSnapDestination(parseSnapCoordinatePair(toCSSValueList(*value), 0));
</del><ins>+        state.style()-&gt;setScrollSnapDestination(parseSnapCoordinatePair(downcast&lt;CSSValueList&gt;(*value), 0));
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx">     case CSSPropertyWebkitScrollSnapCoordinate: {
</span><span class="cx">         HANDLE_INHERIT_AND_INITIAL(scrollSnapCoordinates, ScrollSnapCoordinates)
</span><del>-        CSSValueList&amp; valueList = toCSSValueList(*value);
</del><ins>+        CSSValueList&amp; valueList = downcast&lt;CSSValueList&gt;(*value);
</ins><span class="cx">         ASSERT(!(valueList.length() % 2));
</span><span class="cx">         size_t pointCount = valueList.length() / 2;
</span><span class="cx">         Vector&lt;LengthSize&gt; coordinates;
</span><span class="lines">@@ -3220,24 +3218,24 @@
</span><span class="cx"> 
</span><span class="cx"> PassRefPtr&lt;StyleImage&gt; StyleResolver::styleImage(CSSPropertyID property, CSSValue* value)
</span><span class="cx"> {
</span><del>-    if (value-&gt;isImageValue())
-        return cachedOrPendingFromValue(property, toCSSImageValue(value));
</del><ins>+    if (is&lt;CSSImageValue&gt;(*value))
+        return cachedOrPendingFromValue(property, downcast&lt;CSSImageValue&gt;(value));
</ins><span class="cx"> 
</span><del>-    if (value-&gt;isImageGeneratorValue()) {
-        if (value-&gt;isGradientValue())
-            return generatedOrPendingFromValue(property, *toCSSGradientValue(value)-&gt;gradientWithStylesResolved(this));
-        return generatedOrPendingFromValue(property, toCSSImageGeneratorValue(*value));
</del><ins>+    if (is&lt;CSSImageGeneratorValue&gt;(*value)) {
+        if (is&lt;CSSGradientValue&gt;(*value))
+            return generatedOrPendingFromValue(property, *downcast&lt;CSSGradientValue&gt;(*value).gradientWithStylesResolved(this));
+        return generatedOrPendingFromValue(property, downcast&lt;CSSImageGeneratorValue&gt;(*value));
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(CSS_IMAGE_SET)
</span><del>-    if (value-&gt;isImageSetValue())
-        return setOrPendingFromValue(property, toCSSImageSetValue(value));
</del><ins>+    if (is&lt;CSSImageSetValue&gt;(*value))
+        return setOrPendingFromValue(property, downcast&lt;CSSImageSetValue&gt;(value));
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    if (value-&gt;isCursorImageValue())
-        return cursorOrPendingFromValue(property, toCSSCursorImageValue(value));
</del><ins>+    if (is&lt;CSSCursorImageValue&gt;(*value))
+        return cursorOrPendingFromValue(property, downcast&lt;CSSCursorImageValue&gt;(value));
</ins><span class="cx"> 
</span><del>-    return 0;
</del><ins>+    return nullptr;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> PassRefPtr&lt;StyleImage&gt; StyleResolver::cachedOrPendingFromValue(CSSPropertyID property, CSSImageValue* value)
</span><span class="lines">@@ -3250,9 +3248,9 @@
</span><span class="cx"> 
</span><span class="cx"> PassRefPtr&lt;StyleImage&gt; StyleResolver::generatedOrPendingFromValue(CSSPropertyID property, CSSImageGeneratorValue&amp; value)
</span><span class="cx"> {
</span><del>-    if (value.isFilterImageValue()) {
</del><ins>+    if (is&lt;CSSFilterImageValue&gt;(value)) {
</ins><span class="cx">         // FilterImage needs to calculate FilterOperations.
</span><del>-        toCSSFilterImageValue(value).createFilterOperations(this);
</del><ins>+        downcast&lt;CSSFilterImageValue&gt;(value).createFilterOperations(this);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (value.isPending()) {
</span><span class="lines">@@ -3517,9 +3515,9 @@
</span><span class="cx">     if (!inValue)
</span><span class="cx">         return false;
</span><span class="cx">     
</span><del>-    if (inValue-&gt;isPrimitiveValue()) {
-        CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(inValue);
-        if (primitiveValue-&gt;getValueID() == CSSValueNone)
</del><ins>+    if (is&lt;CSSPrimitiveValue&gt;(*inValue)) {
+        CSSPrimitiveValue&amp; primitiveValue = downcast&lt;CSSPrimitiveValue&gt;(*inValue);
+        if (primitiveValue.getValueID() == CSSValueNone)
</ins><span class="cx">             return true;
</span><span class="cx">     }
</span><span class="cx">     
</span><span class="lines">@@ -3529,21 +3527,21 @@
</span><span class="cx">     FilterOperations operations;
</span><span class="cx">     for (CSSValueListIterator i = inValue; i.hasMore(); i.advance()) {
</span><span class="cx">         CSSValue* currValue = i.value();
</span><del>-        if (!currValue-&gt;isWebKitCSSFilterValue())
</del><ins>+        if (!is&lt;WebKitCSSFilterValue&gt;(*currValue))
</ins><span class="cx">             continue;
</span><span class="cx"> 
</span><del>-        WebKitCSSFilterValue* filterValue = toWebKitCSSFilterValue(i.value());
-        FilterOperation::OperationType operationType = filterOperationForType(filterValue-&gt;operationType());
</del><ins>+        WebKitCSSFilterValue&amp; filterValue = downcast&lt;WebKitCSSFilterValue&gt;(*i.value());
+        FilterOperation::OperationType operationType = filterOperationForType(filterValue.operationType());
</ins><span class="cx"> 
</span><span class="cx">         if (operationType == FilterOperation::REFERENCE) {
</span><del>-            if (filterValue-&gt;length() != 1)
</del><ins>+            if (filterValue.length() != 1)
</ins><span class="cx">                 continue;
</span><del>-            CSSValue* argument = filterValue-&gt;itemWithoutBoundsCheck(0);
</del><ins>+            CSSValue&amp; argument = *filterValue.itemWithoutBoundsCheck(0);
</ins><span class="cx"> 
</span><del>-            if (!argument-&gt;isPrimitiveValue())
</del><ins>+            if (!is&lt;CSSPrimitiveValue&gt;(argument))
</ins><span class="cx">                 continue;
</span><span class="cx"> 
</span><del>-            CSSPrimitiveValue&amp; primitiveValue = toCSSPrimitiveValue(*argument);
</del><ins>+            CSSPrimitiveValue&amp; primitiveValue = downcast&lt;CSSPrimitiveValue&gt;(argument);
</ins><span class="cx">             String cssUrl = primitiveValue.getStringValue();
</span><span class="cx">             URL url = m_state.document().completeURL(cssUrl);
</span><span class="cx"> 
</span><span class="lines">@@ -3560,24 +3558,24 @@
</span><span class="cx">         CSSPrimitiveValue* firstValue = nullptr;
</span><span class="cx">         if (operationType != FilterOperation::DROP_SHADOW) {
</span><span class="cx">             bool haveNonPrimitiveValue = false;
</span><del>-            for (unsigned j = 0; j &lt; filterValue-&gt;length(); ++j) {
-                if (!filterValue-&gt;itemWithoutBoundsCheck(j)-&gt;isPrimitiveValue()) {
</del><ins>+            for (unsigned j = 0; j &lt; filterValue.length(); ++j) {
+                if (!is&lt;CSSPrimitiveValue&gt;(*filterValue.itemWithoutBoundsCheck(j))) {
</ins><span class="cx">                     haveNonPrimitiveValue = true;
</span><span class="cx">                     break;
</span><span class="cx">                 }
</span><span class="cx">             }
</span><span class="cx">             if (haveNonPrimitiveValue)
</span><span class="cx">                 continue;
</span><del>-            if (filterValue-&gt;length())
-                firstValue = toCSSPrimitiveValue(filterValue-&gt;itemWithoutBoundsCheck(0));
</del><ins>+            if (filterValue.length())
+                firstValue = downcast&lt;CSSPrimitiveValue&gt;(filterValue.itemWithoutBoundsCheck(0));
</ins><span class="cx">         }
</span><span class="cx"> 
</span><del>-        switch (filterValue-&gt;operationType()) {
</del><ins>+        switch (filterValue.operationType()) {
</ins><span class="cx">         case WebKitCSSFilterValue::GrayscaleFilterOperation:
</span><span class="cx">         case WebKitCSSFilterValue::SepiaFilterOperation:
</span><span class="cx">         case WebKitCSSFilterValue::SaturateFilterOperation: {
</span><span class="cx">             double amount = 1;
</span><del>-            if (filterValue-&gt;length() == 1) {
</del><ins>+            if (filterValue.length() == 1) {
</ins><span class="cx">                 amount = firstValue-&gt;getDoubleValue();
</span><span class="cx">                 if (firstValue-&gt;isPercentage())
</span><span class="cx">                     amount /= 100;
</span><span class="lines">@@ -3588,7 +3586,7 @@
</span><span class="cx">         }
</span><span class="cx">         case WebKitCSSFilterValue::HueRotateFilterOperation: {
</span><span class="cx">             double angle = 0;
</span><del>-            if (filterValue-&gt;length() == 1)
</del><ins>+            if (filterValue.length() == 1)
</ins><span class="cx">                 angle = firstValue-&gt;computeDegrees();
</span><span class="cx"> 
</span><span class="cx">             operations.operations().append(BasicColorMatrixFilterOperation::create(angle, operationType));
</span><span class="lines">@@ -3598,8 +3596,8 @@
</span><span class="cx">         case WebKitCSSFilterValue::BrightnessFilterOperation:
</span><span class="cx">         case WebKitCSSFilterValue::ContrastFilterOperation:
</span><span class="cx">         case WebKitCSSFilterValue::OpacityFilterOperation: {
</span><del>-            double amount = (filterValue-&gt;operationType() == WebKitCSSFilterValue::BrightnessFilterOperation) ? 0 : 1;
-            if (filterValue-&gt;length() == 1) {
</del><ins>+            double amount = (filterValue.operationType() == WebKitCSSFilterValue::BrightnessFilterOperation) ? 0 : 1;
+            if (filterValue.length() == 1) {
</ins><span class="cx">                 amount = firstValue-&gt;getDoubleValue();
</span><span class="cx">                 if (firstValue-&gt;isPercentage())
</span><span class="cx">                     amount /= 100;
</span><span class="lines">@@ -3610,7 +3608,7 @@
</span><span class="cx">         }
</span><span class="cx">         case WebKitCSSFilterValue::BlurFilterOperation: {
</span><span class="cx">             Length stdDeviation = Length(0, Fixed);
</span><del>-            if (filterValue-&gt;length() &gt;= 1)
</del><ins>+            if (filterValue.length() &gt;= 1)
</ins><span class="cx">                 stdDeviation = convertToFloatLength(firstValue, state.cssToLengthConversionData());
</span><span class="cx">             if (stdDeviation.isUndefined())
</span><span class="cx">                 return false;
</span><span class="lines">@@ -3619,21 +3617,21 @@
</span><span class="cx">             break;
</span><span class="cx">         }
</span><span class="cx">         case WebKitCSSFilterValue::DropShadowFilterOperation: {
</span><del>-            if (filterValue-&gt;length() != 1)
</del><ins>+            if (filterValue.length() != 1)
</ins><span class="cx">                 return false;
</span><span class="cx"> 
</span><del>-            CSSValue* cssValue = filterValue-&gt;itemWithoutBoundsCheck(0);
-            if (!cssValue-&gt;isShadowValue())
</del><ins>+            CSSValue&amp; cssValue = *filterValue.itemWithoutBoundsCheck(0);
+            if (!is&lt;CSSShadowValue&gt;(cssValue))
</ins><span class="cx">                 continue;
</span><span class="cx"> 
</span><del>-            CSSShadowValue* item = toCSSShadowValue(cssValue);
-            int x = item-&gt;x-&gt;computeLength&lt;int&gt;(state.cssToLengthConversionData());
-            int y = item-&gt;y-&gt;computeLength&lt;int&gt;(state.cssToLengthConversionData());
</del><ins>+            CSSShadowValue&amp; item = downcast&lt;CSSShadowValue&gt;(cssValue);
+            int x = item.x-&gt;computeLength&lt;int&gt;(state.cssToLengthConversionData());
+            int y = item.y-&gt;computeLength&lt;int&gt;(state.cssToLengthConversionData());
</ins><span class="cx">             IntPoint location(x, y);
</span><del>-            int blur = item-&gt;blur ? item-&gt;blur-&gt;computeLength&lt;int&gt;(state.cssToLengthConversionData()) : 0;
</del><ins>+            int blur = item.blur ? item.blur-&gt;computeLength&lt;int&gt;(state.cssToLengthConversionData()) : 0;
</ins><span class="cx">             Color color;
</span><del>-            if (item-&gt;color)
-                color = colorFromPrimitiveValue(item-&gt;color.get());
</del><ins>+            if (item.color)
+                color = colorFromPrimitiveValue(item.color.get());
</ins><span class="cx"> 
</span><span class="cx">             operations.operations().append(DropShadowFilterOperation::create(location, blur, color.isValid() ? color : Color::transparent));
</span><span class="cx">             break;
</span></span></pre></div>
<a id="trunkSourceWebCorecssTransformFunctionscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/TransformFunctions.cpp (174299 => 174300)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/TransformFunctions.cpp        2014-10-03 23:05:07 UTC (rev 174299)
+++ trunk/Source/WebCore/css/TransformFunctions.cpp        2014-10-03 23:17:00 UTC (rev 174300)
</span><span class="lines">@@ -90,18 +90,18 @@
</span><span class="cx"> 
</span><span class="cx">     TransformOperations operations;
</span><span class="cx">     for (CSSValueListIterator i = value; i.hasMore(); i.advance()) {
</span><del>-        CSSValue* currValue = i.value();
</del><ins>+        CSSValue&amp; currValue = *i.value();
</ins><span class="cx"> 
</span><del>-        if (!currValue-&gt;isWebKitCSSTransformValue())
</del><ins>+        if (!is&lt;WebKitCSSTransformValue&gt;(currValue))
</ins><span class="cx">             continue;
</span><span class="cx"> 
</span><del>-        WebKitCSSTransformValue* transformValue = toWebKitCSSTransformValue(i.value());
-        if (!transformValue-&gt;length())
</del><ins>+        WebKitCSSTransformValue&amp; transformValue = downcast&lt;WebKitCSSTransformValue&gt;(currValue);
+        if (!transformValue.length())
</ins><span class="cx">             continue;
</span><span class="cx"> 
</span><span class="cx">         bool haveNonPrimitiveValue = false;
</span><del>-        for (unsigned j = 0; j &lt; transformValue-&gt;length(); ++j) {
-            if (!transformValue-&gt;itemWithoutBoundsCheck(j)-&gt;isPrimitiveValue()) {
</del><ins>+        for (unsigned j = 0; j &lt; transformValue.length(); ++j) {
+            if (!is&lt;CSSPrimitiveValue&gt;(*transformValue.itemWithoutBoundsCheck(j))) {
</ins><span class="cx">                 haveNonPrimitiveValue = true;
</span><span class="cx">                 break;
</span><span class="cx">             }
</span><span class="lines">@@ -109,27 +109,27 @@
</span><span class="cx">         if (haveNonPrimitiveValue)
</span><span class="cx">             continue;
</span><span class="cx"> 
</span><del>-        CSSPrimitiveValue* firstValue = toCSSPrimitiveValue(transformValue-&gt;itemWithoutBoundsCheck(0));
</del><ins>+        CSSPrimitiveValue&amp; firstValue = downcast&lt;CSSPrimitiveValue&gt;(*transformValue.itemWithoutBoundsCheck(0));
</ins><span class="cx"> 
</span><del>-        switch (transformValue-&gt;operationType()) {
</del><ins>+        switch (transformValue.operationType()) {
</ins><span class="cx">         case WebKitCSSTransformValue::ScaleTransformOperation:
</span><span class="cx">         case WebKitCSSTransformValue::ScaleXTransformOperation:
</span><span class="cx">         case WebKitCSSTransformValue::ScaleYTransformOperation: {
</span><span class="cx">             double sx = 1.0;
</span><span class="cx">             double sy = 1.0;
</span><del>-            if (transformValue-&gt;operationType() == WebKitCSSTransformValue::ScaleYTransformOperation)
-                sy = firstValue-&gt;getDoubleValue();
</del><ins>+            if (transformValue.operationType() == WebKitCSSTransformValue::ScaleYTransformOperation)
+                sy = firstValue.getDoubleValue();
</ins><span class="cx">             else {
</span><del>-                sx = firstValue-&gt;getDoubleValue();
-                if (transformValue-&gt;operationType() != WebKitCSSTransformValue::ScaleXTransformOperation) {
-                    if (transformValue-&gt;length() &gt; 1) {
-                        CSSPrimitiveValue* secondValue = toCSSPrimitiveValue(transformValue-&gt;itemWithoutBoundsCheck(1));
-                        sy = secondValue-&gt;getDoubleValue();
</del><ins>+                sx = firstValue.getDoubleValue();
+                if (transformValue.operationType() != WebKitCSSTransformValue::ScaleXTransformOperation) {
+                    if (transformValue.length() &gt; 1) {
+                        CSSPrimitiveValue&amp; secondValue = downcast&lt;CSSPrimitiveValue&gt;(*transformValue.itemWithoutBoundsCheck(1));
+                        sy = secondValue.getDoubleValue();
</ins><span class="cx">                     } else
</span><span class="cx">                         sy = sx;
</span><span class="cx">                 }
</span><span class="cx">             }
</span><del>-            operations.operations().append(ScaleTransformOperation::create(sx, sy, 1.0, transformOperationType(transformValue-&gt;operationType())));
</del><ins>+            operations.operations().append(ScaleTransformOperation::create(sx, sy, 1.0, transformOperationType(transformValue.operationType())));
</ins><span class="cx">             break;
</span><span class="cx">         }
</span><span class="cx">         case WebKitCSSTransformValue::ScaleZTransformOperation:
</span><span class="lines">@@ -137,25 +137,25 @@
</span><span class="cx">             double sx = 1.0;
</span><span class="cx">             double sy = 1.0;
</span><span class="cx">             double sz = 1.0;
</span><del>-            if (transformValue-&gt;operationType() == WebKitCSSTransformValue::ScaleZTransformOperation)
-                sz = firstValue-&gt;getDoubleValue();
-            else if (transformValue-&gt;operationType() == WebKitCSSTransformValue::ScaleYTransformOperation)
-                sy = firstValue-&gt;getDoubleValue();
</del><ins>+            if (transformValue.operationType() == WebKitCSSTransformValue::ScaleZTransformOperation)
+                sz = firstValue.getDoubleValue();
+            else if (transformValue.operationType() == WebKitCSSTransformValue::ScaleYTransformOperation)
+                sy = firstValue.getDoubleValue();
</ins><span class="cx">             else {
</span><del>-                sx = firstValue-&gt;getDoubleValue();
-                if (transformValue-&gt;operationType() != WebKitCSSTransformValue::ScaleXTransformOperation) {
-                    if (transformValue-&gt;length() &gt; 2) {
-                        CSSPrimitiveValue* thirdValue = toCSSPrimitiveValue(transformValue-&gt;itemWithoutBoundsCheck(2));
-                        sz = thirdValue-&gt;getDoubleValue();
</del><ins>+                sx = firstValue.getDoubleValue();
+                if (transformValue.operationType() != WebKitCSSTransformValue::ScaleXTransformOperation) {
+                    if (transformValue.length() &gt; 2) {
+                        CSSPrimitiveValue&amp; thirdValue = downcast&lt;CSSPrimitiveValue&gt;(*transformValue.itemWithoutBoundsCheck(2));
+                        sz = thirdValue.getDoubleValue();
</ins><span class="cx">                     }
</span><del>-                    if (transformValue-&gt;length() &gt; 1) {
-                        CSSPrimitiveValue* secondValue = toCSSPrimitiveValue(transformValue-&gt;itemWithoutBoundsCheck(1));
-                        sy = secondValue-&gt;getDoubleValue();
</del><ins>+                    if (transformValue.length() &gt; 1) {
+                        CSSPrimitiveValue&amp; secondValue = downcast&lt;CSSPrimitiveValue&gt;(*transformValue.itemWithoutBoundsCheck(1));
+                        sy = secondValue.getDoubleValue();
</ins><span class="cx">                     } else
</span><span class="cx">                         sy = sx;
</span><span class="cx">                 }
</span><span class="cx">             }
</span><del>-            operations.operations().append(ScaleTransformOperation::create(sx, sy, sz, transformOperationType(transformValue-&gt;operationType())));
</del><ins>+            operations.operations().append(ScaleTransformOperation::create(sx, sy, sz, transformOperationType(transformValue.operationType())));
</ins><span class="cx">             break;
</span><span class="cx">         }
</span><span class="cx">         case WebKitCSSTransformValue::TranslateTransformOperation:
</span><span class="lines">@@ -163,14 +163,14 @@
</span><span class="cx">         case WebKitCSSTransformValue::TranslateYTransformOperation: {
</span><span class="cx">             Length tx = Length(0, Fixed);
</span><span class="cx">             Length ty = Length(0, Fixed);
</span><del>-            if (transformValue-&gt;operationType() == WebKitCSSTransformValue::TranslateYTransformOperation)
-                ty = convertToFloatLength(firstValue, conversionData);
</del><ins>+            if (transformValue.operationType() == WebKitCSSTransformValue::TranslateYTransformOperation)
+                ty = convertToFloatLength(&amp;firstValue, conversionData);
</ins><span class="cx">             else {
</span><del>-                tx = convertToFloatLength(firstValue, conversionData);
-                if (transformValue-&gt;operationType() != WebKitCSSTransformValue::TranslateXTransformOperation) {
-                    if (transformValue-&gt;length() &gt; 1) {
-                        CSSPrimitiveValue* secondValue = toCSSPrimitiveValue(transformValue-&gt;itemWithoutBoundsCheck(1));
-                        ty = convertToFloatLength(secondValue, conversionData);
</del><ins>+                tx = convertToFloatLength(&amp;firstValue, conversionData);
+                if (transformValue.operationType() != WebKitCSSTransformValue::TranslateXTransformOperation) {
+                    if (transformValue.length() &gt; 1) {
+                        CSSPrimitiveValue&amp; secondValue = downcast&lt;CSSPrimitiveValue&gt;(*transformValue.itemWithoutBoundsCheck(1));
+                        ty = convertToFloatLength(&amp;secondValue, conversionData);
</ins><span class="cx">                     }
</span><span class="cx">                 }
</span><span class="cx">             }
</span><span class="lines">@@ -178,7 +178,7 @@
</span><span class="cx">             if (tx.isUndefined() || ty.isUndefined())
</span><span class="cx">                 return false;
</span><span class="cx"> 
</span><del>-            operations.operations().append(TranslateTransformOperation::create(tx, ty, Length(0, Fixed), transformOperationType(transformValue-&gt;operationType())));
</del><ins>+            operations.operations().append(TranslateTransformOperation::create(tx, ty, Length(0, Fixed), transformOperationType(transformValue.operationType())));
</ins><span class="cx">             break;
</span><span class="cx">         }
</span><span class="cx">         case WebKitCSSTransformValue::TranslateZTransformOperation:
</span><span class="lines">@@ -186,20 +186,20 @@
</span><span class="cx">             Length tx = Length(0, Fixed);
</span><span class="cx">             Length ty = Length(0, Fixed);
</span><span class="cx">             Length tz = Length(0, Fixed);
</span><del>-            if (transformValue-&gt;operationType() == WebKitCSSTransformValue::TranslateZTransformOperation)
-                tz = convertToFloatLength(firstValue, conversionData);
-            else if (transformValue-&gt;operationType() == WebKitCSSTransformValue::TranslateYTransformOperation)
-                ty = convertToFloatLength(firstValue, conversionData);
</del><ins>+            if (transformValue.operationType() == WebKitCSSTransformValue::TranslateZTransformOperation)
+                tz = convertToFloatLength(&amp;firstValue, conversionData);
+            else if (transformValue.operationType() == WebKitCSSTransformValue::TranslateYTransformOperation)
+                ty = convertToFloatLength(&amp;firstValue, conversionData);
</ins><span class="cx">             else {
</span><del>-                tx = convertToFloatLength(firstValue, conversionData);
-                if (transformValue-&gt;operationType() != WebKitCSSTransformValue::TranslateXTransformOperation) {
-                    if (transformValue-&gt;length() &gt; 2) {
-                        CSSPrimitiveValue* thirdValue = toCSSPrimitiveValue(transformValue-&gt;itemWithoutBoundsCheck(2));
-                        tz = convertToFloatLength(thirdValue, conversionData);
</del><ins>+                tx = convertToFloatLength(&amp;firstValue, conversionData);
+                if (transformValue.operationType() != WebKitCSSTransformValue::TranslateXTransformOperation) {
+                    if (transformValue.length() &gt; 2) {
+                        CSSPrimitiveValue&amp; thirdValue = downcast&lt;CSSPrimitiveValue&gt;(*transformValue.itemWithoutBoundsCheck(2));
+                        tz = convertToFloatLength(&amp;thirdValue, conversionData);
</ins><span class="cx">                     }
</span><del>-                    if (transformValue-&gt;length() &gt; 1) {
-                        CSSPrimitiveValue* secondValue = toCSSPrimitiveValue(transformValue-&gt;itemWithoutBoundsCheck(1));
-                        ty = convertToFloatLength(secondValue, conversionData);
</del><ins>+                    if (transformValue.length() &gt; 1) {
+                        CSSPrimitiveValue&amp; secondValue = downcast&lt;CSSPrimitiveValue&gt;(*transformValue.itemWithoutBoundsCheck(1));
+                        ty = convertToFloatLength(&amp;secondValue, conversionData);
</ins><span class="cx">                     }
</span><span class="cx">                 }
</span><span class="cx">             }
</span><span class="lines">@@ -207,12 +207,12 @@
</span><span class="cx">             if (tx.isUndefined() || ty.isUndefined() || tz.isUndefined())
</span><span class="cx">                 return false;
</span><span class="cx"> 
</span><del>-            operations.operations().append(TranslateTransformOperation::create(tx, ty, tz, transformOperationType(transformValue-&gt;operationType())));
</del><ins>+            operations.operations().append(TranslateTransformOperation::create(tx, ty, tz, transformOperationType(transformValue.operationType())));
</ins><span class="cx">             break;
</span><span class="cx">         }
</span><span class="cx">         case WebKitCSSTransformValue::RotateTransformOperation: {
</span><del>-            double angle = firstValue-&gt;computeDegrees();
-            operations.operations().append(RotateTransformOperation::create(0, 0, 1, angle, transformOperationType(transformValue-&gt;operationType())));
</del><ins>+            double angle = firstValue.computeDegrees();
+            operations.operations().append(RotateTransformOperation::create(0, 0, 1, angle, transformOperationType(transformValue.operationType())));
</ins><span class="cx">             break;
</span><span class="cx">         }
</span><span class="cx">         case WebKitCSSTransformValue::RotateXTransformOperation:
</span><span class="lines">@@ -221,28 +221,28 @@
</span><span class="cx">             double x = 0;
</span><span class="cx">             double y = 0;
</span><span class="cx">             double z = 0;
</span><del>-            double angle = firstValue-&gt;computeDegrees();
</del><ins>+            double angle = firstValue.computeDegrees();
</ins><span class="cx"> 
</span><del>-            if (transformValue-&gt;operationType() == WebKitCSSTransformValue::RotateXTransformOperation)
</del><ins>+            if (transformValue.operationType() == WebKitCSSTransformValue::RotateXTransformOperation)
</ins><span class="cx">                 x = 1;
</span><del>-            else if (transformValue-&gt;operationType() == WebKitCSSTransformValue::RotateYTransformOperation)
</del><ins>+            else if (transformValue.operationType() == WebKitCSSTransformValue::RotateYTransformOperation)
</ins><span class="cx">                 y = 1;
</span><span class="cx">             else
</span><span class="cx">                 z = 1;
</span><del>-            operations.operations().append(RotateTransformOperation::create(x, y, z, angle, transformOperationType(transformValue-&gt;operationType())));
</del><ins>+            operations.operations().append(RotateTransformOperation::create(x, y, z, angle, transformOperationType(transformValue.operationType())));
</ins><span class="cx">             break;
</span><span class="cx">         }
</span><span class="cx">         case WebKitCSSTransformValue::Rotate3DTransformOperation: {
</span><del>-            if (transformValue-&gt;length() &lt; 4)
</del><ins>+            if (transformValue.length() &lt; 4)
</ins><span class="cx">                 break;
</span><del>-            CSSPrimitiveValue* secondValue = toCSSPrimitiveValue(transformValue-&gt;itemWithoutBoundsCheck(1));
-            CSSPrimitiveValue* thirdValue = toCSSPrimitiveValue(transformValue-&gt;itemWithoutBoundsCheck(2));
-            CSSPrimitiveValue* fourthValue = toCSSPrimitiveValue(transformValue-&gt;itemWithoutBoundsCheck(3));
-            double x = firstValue-&gt;getDoubleValue();
-            double y = secondValue-&gt;getDoubleValue();
-            double z = thirdValue-&gt;getDoubleValue();
-            double angle = fourthValue-&gt;computeDegrees();
-            operations.operations().append(RotateTransformOperation::create(x, y, z, angle, transformOperationType(transformValue-&gt;operationType())));
</del><ins>+            CSSPrimitiveValue&amp; secondValue = downcast&lt;CSSPrimitiveValue&gt;(*transformValue.itemWithoutBoundsCheck(1));
+            CSSPrimitiveValue&amp; thirdValue = downcast&lt;CSSPrimitiveValue&gt;(*transformValue.itemWithoutBoundsCheck(2));
+            CSSPrimitiveValue&amp; fourthValue = downcast&lt;CSSPrimitiveValue&gt;(*transformValue.itemWithoutBoundsCheck(3));
+            double x = firstValue.getDoubleValue();
+            double y = secondValue.getDoubleValue();
+            double z = thirdValue.getDoubleValue();
+            double angle = fourthValue.computeDegrees();
+            operations.operations().append(RotateTransformOperation::create(x, y, z, angle, transformOperationType(transformValue.operationType())));
</ins><span class="cx">             break;
</span><span class="cx">         }
</span><span class="cx">         case WebKitCSSTransformValue::SkewTransformOperation:
</span><span class="lines">@@ -250,62 +250,62 @@
</span><span class="cx">         case WebKitCSSTransformValue::SkewYTransformOperation: {
</span><span class="cx">             double angleX = 0;
</span><span class="cx">             double angleY = 0;
</span><del>-            double angle = firstValue-&gt;computeDegrees();
-            if (transformValue-&gt;operationType() == WebKitCSSTransformValue::SkewYTransformOperation)
</del><ins>+            double angle = firstValue.computeDegrees();
+            if (transformValue.operationType() == WebKitCSSTransformValue::SkewYTransformOperation)
</ins><span class="cx">                 angleY = angle;
</span><span class="cx">             else {
</span><span class="cx">                 angleX = angle;
</span><del>-                if (transformValue-&gt;operationType() == WebKitCSSTransformValue::SkewTransformOperation) {
-                    if (transformValue-&gt;length() &gt; 1) {
-                        CSSPrimitiveValue* secondValue = toCSSPrimitiveValue(transformValue-&gt;itemWithoutBoundsCheck(1));
-                        angleY = secondValue-&gt;computeDegrees();
</del><ins>+                if (transformValue.operationType() == WebKitCSSTransformValue::SkewTransformOperation) {
+                    if (transformValue.length() &gt; 1) {
+                        CSSPrimitiveValue&amp; secondValue = downcast&lt;CSSPrimitiveValue&gt;(*transformValue.itemWithoutBoundsCheck(1));
+                        angleY = secondValue.computeDegrees();
</ins><span class="cx">                     }
</span><span class="cx">                 }
</span><span class="cx">             }
</span><del>-            operations.operations().append(SkewTransformOperation::create(angleX, angleY, transformOperationType(transformValue-&gt;operationType())));
</del><ins>+            operations.operations().append(SkewTransformOperation::create(angleX, angleY, transformOperationType(transformValue.operationType())));
</ins><span class="cx">             break;
</span><span class="cx">         }
</span><span class="cx">         case WebKitCSSTransformValue::MatrixTransformOperation: {
</span><del>-            if (transformValue-&gt;length() &lt; 6)
</del><ins>+            if (transformValue.length() &lt; 6)
</ins><span class="cx">                 break;
</span><del>-            double a = firstValue-&gt;getDoubleValue();
-            double b = toCSSPrimitiveValue(transformValue-&gt;itemWithoutBoundsCheck(1))-&gt;getDoubleValue();
-            double c = toCSSPrimitiveValue(transformValue-&gt;itemWithoutBoundsCheck(2))-&gt;getDoubleValue();
-            double d = toCSSPrimitiveValue(transformValue-&gt;itemWithoutBoundsCheck(3))-&gt;getDoubleValue();
-            double e = conversionData.zoom() * toCSSPrimitiveValue(transformValue-&gt;itemWithoutBoundsCheck(4))-&gt;getDoubleValue();
-            double f = conversionData.zoom() * toCSSPrimitiveValue(transformValue-&gt;itemWithoutBoundsCheck(5))-&gt;getDoubleValue();
</del><ins>+            double a = firstValue.getDoubleValue();
+            double b = downcast&lt;CSSPrimitiveValue&gt;(*transformValue.itemWithoutBoundsCheck(1)).getDoubleValue();
+            double c = downcast&lt;CSSPrimitiveValue&gt;(*transformValue.itemWithoutBoundsCheck(2)).getDoubleValue();
+            double d = downcast&lt;CSSPrimitiveValue&gt;(*transformValue.itemWithoutBoundsCheck(3)).getDoubleValue();
+            double e = conversionData.zoom() * downcast&lt;CSSPrimitiveValue&gt;(*transformValue.itemWithoutBoundsCheck(4)).getDoubleValue();
+            double f = conversionData.zoom() * downcast&lt;CSSPrimitiveValue&gt;(*transformValue.itemWithoutBoundsCheck(5)).getDoubleValue();
</ins><span class="cx">             operations.operations().append(MatrixTransformOperation::create(a, b, c, d, e, f));
</span><span class="cx">             break;
</span><span class="cx">         }
</span><span class="cx">         case WebKitCSSTransformValue::Matrix3DTransformOperation: {
</span><del>-            if (transformValue-&gt;length() &lt; 16)
</del><ins>+            if (transformValue.length() &lt; 16)
</ins><span class="cx">                 break;
</span><del>-            TransformationMatrix matrix(toCSSPrimitiveValue(transformValue-&gt;itemWithoutBoundsCheck(0))-&gt;getDoubleValue(),
-                toCSSPrimitiveValue(transformValue-&gt;itemWithoutBoundsCheck(1))-&gt;getDoubleValue(),
-                toCSSPrimitiveValue(transformValue-&gt;itemWithoutBoundsCheck(2))-&gt;getDoubleValue(),
-                toCSSPrimitiveValue(transformValue-&gt;itemWithoutBoundsCheck(3))-&gt;getDoubleValue(),
-                toCSSPrimitiveValue(transformValue-&gt;itemWithoutBoundsCheck(4))-&gt;getDoubleValue(),
-                toCSSPrimitiveValue(transformValue-&gt;itemWithoutBoundsCheck(5))-&gt;getDoubleValue(),
-                toCSSPrimitiveValue(transformValue-&gt;itemWithoutBoundsCheck(6))-&gt;getDoubleValue(),
-                toCSSPrimitiveValue(transformValue-&gt;itemWithoutBoundsCheck(7))-&gt;getDoubleValue(),
-                toCSSPrimitiveValue(transformValue-&gt;itemWithoutBoundsCheck(8))-&gt;getDoubleValue(),
-                toCSSPrimitiveValue(transformValue-&gt;itemWithoutBoundsCheck(9))-&gt;getDoubleValue(),
-                toCSSPrimitiveValue(transformValue-&gt;itemWithoutBoundsCheck(10))-&gt;getDoubleValue(),
-                toCSSPrimitiveValue(transformValue-&gt;itemWithoutBoundsCheck(11))-&gt;getDoubleValue(),
-                conversionData.zoom() * toCSSPrimitiveValue(transformValue-&gt;itemWithoutBoundsCheck(12))-&gt;getDoubleValue(),
-                conversionData.zoom() * toCSSPrimitiveValue(transformValue-&gt;itemWithoutBoundsCheck(13))-&gt;getDoubleValue(),
-                toCSSPrimitiveValue(transformValue-&gt;itemWithoutBoundsCheck(14))-&gt;getDoubleValue(),
-                toCSSPrimitiveValue(transformValue-&gt;itemWithoutBoundsCheck(15))-&gt;getDoubleValue());
</del><ins>+            TransformationMatrix matrix(downcast&lt;CSSPrimitiveValue&gt;(*transformValue.itemWithoutBoundsCheck(0)).getDoubleValue(),
+                downcast&lt;CSSPrimitiveValue&gt;(*transformValue.itemWithoutBoundsCheck(1)).getDoubleValue(),
+                downcast&lt;CSSPrimitiveValue&gt;(*transformValue.itemWithoutBoundsCheck(2)).getDoubleValue(),
+                downcast&lt;CSSPrimitiveValue&gt;(*transformValue.itemWithoutBoundsCheck(3)).getDoubleValue(),
+                downcast&lt;CSSPrimitiveValue&gt;(*transformValue.itemWithoutBoundsCheck(4)).getDoubleValue(),
+                downcast&lt;CSSPrimitiveValue&gt;(*transformValue.itemWithoutBoundsCheck(5)).getDoubleValue(),
+                downcast&lt;CSSPrimitiveValue&gt;(*transformValue.itemWithoutBoundsCheck(6)).getDoubleValue(),
+                downcast&lt;CSSPrimitiveValue&gt;(*transformValue.itemWithoutBoundsCheck(7)).getDoubleValue(),
+                downcast&lt;CSSPrimitiveValue&gt;(*transformValue.itemWithoutBoundsCheck(8)).getDoubleValue(),
+                downcast&lt;CSSPrimitiveValue&gt;(*transformValue.itemWithoutBoundsCheck(9)).getDoubleValue(),
+                downcast&lt;CSSPrimitiveValue&gt;(*transformValue.itemWithoutBoundsCheck(10)).getDoubleValue(),
+                downcast&lt;CSSPrimitiveValue&gt;(*transformValue.itemWithoutBoundsCheck(11)).getDoubleValue(),
+                conversionData.zoom() * downcast&lt;CSSPrimitiveValue&gt;(*transformValue.itemWithoutBoundsCheck(12)).getDoubleValue(),
+                conversionData.zoom() * downcast&lt;CSSPrimitiveValue&gt;(*transformValue.itemWithoutBoundsCheck(13)).getDoubleValue(),
+                downcast&lt;CSSPrimitiveValue&gt;(*transformValue.itemWithoutBoundsCheck(14)).getDoubleValue(),
+                downcast&lt;CSSPrimitiveValue&gt;(*transformValue.itemWithoutBoundsCheck(15)).getDoubleValue());
</ins><span class="cx">             operations.operations().append(Matrix3DTransformOperation::create(matrix));
</span><span class="cx">             break;
</span><span class="cx">         }
</span><span class="cx">         case WebKitCSSTransformValue::PerspectiveTransformOperation: {
</span><span class="cx">             Length p = Length(0, Fixed);
</span><del>-            if (firstValue-&gt;isLength())
-                p = convertToFloatLength(firstValue, conversionData);
</del><ins>+            if (firstValue.isLength())
+                p = convertToFloatLength(&amp;firstValue, conversionData);
</ins><span class="cx">             else {
</span><span class="cx">                 // This is a quirk that should go away when 3d transforms are finalized.
</span><del>-                double val = firstValue-&gt;getDoubleValue();
</del><ins>+                double val = firstValue.getDoubleValue();
</ins><span class="cx">                 p = val &gt;= 0 ? Length(clampToPositiveInteger(val), Fixed) : Length(Undefined);
</span><span class="cx">             }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorecssViewportStyleResolvercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/ViewportStyleResolver.cpp (174299 => 174300)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/ViewportStyleResolver.cpp        2014-10-03 23:05:07 UTC (rev 174299)
+++ trunk/Source/WebCore/css/ViewportStyleResolver.cpp        2014-10-03 23:17:00 UTC (rev 174300)
</span><span class="lines">@@ -108,19 +108,19 @@
</span><span class="cx">         defaultValue = 1;
</span><span class="cx"> 
</span><span class="cx">     RefPtr&lt;CSSValue&gt; value = m_propertySet-&gt;getPropertyCSSValue(id);
</span><del>-    if (!value || !value-&gt;isPrimitiveValue())
</del><ins>+    if (!is&lt;CSSPrimitiveValue&gt;(value.get()))
</ins><span class="cx">         return defaultValue;
</span><span class="cx"> 
</span><del>-    CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value.get());
</del><ins>+    CSSPrimitiveValue&amp; primitiveValue = downcast&lt;CSSPrimitiveValue&gt;(*value);
</ins><span class="cx"> 
</span><del>-    if (primitiveValue-&gt;isNumber() || primitiveValue-&gt;isPx())
-        return primitiveValue-&gt;getFloatValue();
</del><ins>+    if (primitiveValue.isNumber() || primitiveValue.isPx())
+        return primitiveValue.getFloatValue();
</ins><span class="cx"> 
</span><del>-    if (primitiveValue-&gt;isFontRelativeLength())
-        return primitiveValue-&gt;getFloatValue() * m_document-&gt;documentElement()-&gt;renderStyle()-&gt;fontDescription().computedSize();
</del><ins>+    if (primitiveValue.isFontRelativeLength())
+        return primitiveValue.getFloatValue() * m_document-&gt;documentElement()-&gt;renderStyle()-&gt;fontDescription().computedSize();
</ins><span class="cx"> 
</span><del>-    if (primitiveValue-&gt;isPercentage()) {
-        float percentValue = primitiveValue-&gt;getFloatValue() / 100.0f;
</del><ins>+    if (primitiveValue.isPercentage()) {
+        float percentValue = primitiveValue.getFloatValue() / 100.0f;
</ins><span class="cx">         switch (id) {
</span><span class="cx">         case CSSPropertyMaxHeight:
</span><span class="cx">         case CSSPropertyMinHeight:
</span><span class="lines">@@ -140,7 +140,7 @@
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    switch (primitiveValue-&gt;getValueID()) {
</del><ins>+    switch (primitiveValue.getValueID()) {
</ins><span class="cx">     case CSSValueAuto:
</span><span class="cx">         return defaultValue;
</span><span class="cx">     case CSSValueDeviceHeight:
</span></span></pre></div>
<a id="trunkSourceWebCorecssWebKitCSSFilterValueh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/WebKitCSSFilterValue.h (174299 => 174300)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/WebKitCSSFilterValue.h        2014-10-03 23:05:07 UTC (rev 174299)
+++ trunk/Source/WebCore/css/WebKitCSSFilterValue.h        2014-10-03 23:17:00 UTC (rev 174300)
</span><span class="lines">@@ -70,8 +70,8 @@
</span><span class="cx">     FilterOperationType m_type;
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-CSS_VALUE_TYPE_CASTS(WebKitCSSFilterValue, isWebKitCSSFilterValue())
</del><ins>+} // namespace WebCore
</ins><span class="cx"> 
</span><del>-}
</del><ins>+SPECIALIZE_TYPE_TRAITS_CSS_VALUE(WebKitCSSFilterValue, isWebKitCSSFilterValue())
</ins><span class="cx"> 
</span><del>-#endif
</del><ins>+#endif // WebKitCSSFilterValue_h
</ins></span></pre></div>
<a id="trunkSourceWebCorecssWebKitCSSMatrixcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/WebKitCSSMatrix.cpp (174299 => 174300)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/WebKitCSSMatrix.cpp        2014-10-03 23:05:07 UTC (rev 174299)
+++ trunk/Source/WebCore/css/WebKitCSSMatrix.cpp        2014-10-03 23:17:00 UTC (rev 174300)
</span><span class="lines">@@ -63,7 +63,7 @@
</span><span class="cx">         RefPtr&lt;CSSValue&gt; value = styleDeclaration-&gt;getPropertyCSSValue(CSSPropertyWebkitTransform);
</span><span class="cx"> 
</span><span class="cx">         // Check for a &quot;none&quot; or empty transform. In these cases we can use the default identity matrix.
</span><del>-        if (!value || (value-&gt;isPrimitiveValue() &amp;&amp; (toCSSPrimitiveValue(value.get()))-&gt;getValueID() == CSSValueNone))
</del><ins>+        if (!value || (is&lt;CSSPrimitiveValue&gt;(*value) &amp;&amp; downcast&lt;CSSPrimitiveValue&gt;(*value).getValueID() == CSSValueNone))
</ins><span class="cx">             return;
</span><span class="cx"> 
</span><span class="cx">         TransformOperations operations;
</span></span></pre></div>
<a id="trunkSourceWebCorecssWebKitCSSTransformValueh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/WebKitCSSTransformValue.h (174299 => 174300)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/WebKitCSSTransformValue.h        2014-10-03 23:05:07 UTC (rev 174299)
+++ trunk/Source/WebCore/css/WebKitCSSTransformValue.h        2014-10-03 23:17:00 UTC (rev 174300)
</span><span class="lines">@@ -79,18 +79,8 @@
</span><span class="cx">     TransformOperationType m_type;
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-inline WebKitCSSTransformValue* toWebKitCSSTransformValue(CSSValue* value)
-{
-    ASSERT_WITH_SECURITY_IMPLICATION(!value || value-&gt;isWebKitCSSTransformValue());
-    return static_cast&lt;WebKitCSSTransformValue*&gt;(value);
-}
</del><ins>+} // namespace WebCore
</ins><span class="cx"> 
</span><del>-inline const WebKitCSSTransformValue* toWebKitCSSTransformValue(const CSSValue* value)
-{
-    ASSERT_WITH_SECURITY_IMPLICATION(!value || value-&gt;isWebKitCSSTransformValue());
-    return static_cast&lt;const WebKitCSSTransformValue*&gt;(value);
-}
</del><ins>+SPECIALIZE_TYPE_TRAITS_CSS_VALUE(WebKitCSSTransformValue, isWebKitCSSTransformValue())
</ins><span class="cx"> 
</span><del>-}
-
</del><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingApplyStyleCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/ApplyStyleCommand.cpp (174299 => 174300)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/ApplyStyleCommand.cpp        2014-10-03 23:05:07 UTC (rev 174299)
+++ trunk/Source/WebCore/editing/ApplyStyleCommand.cpp        2014-10-03 23:17:00 UTC (rev 174300)
</span><span class="lines">@@ -1510,8 +1510,7 @@
</span><span class="cx">         return 0;
</span><span class="cx"> 
</span><span class="cx">     RefPtr&lt;CSSValue&gt; value = ComputedStyleExtractor(node).propertyValue(CSSPropertyFontSize);
</span><del>-    ASSERT(value &amp;&amp; value-&gt;isPrimitiveValue());
-    return toCSSPrimitiveValue(value.get())-&gt;getFloatValue(CSSPrimitiveValue::CSS_PX);
</del><ins>+    return downcast&lt;CSSPrimitiveValue&gt;(*value).getFloatValue(CSSPrimitiveValue::CSS_PX);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void ApplyStyleCommand::joinChildTextNodes(Node* node, const Position&amp; start, const Position&amp; end)
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingEditingStylecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/EditingStyle.cpp (174299 => 174300)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/EditingStyle.cpp        2014-10-03 23:05:07 UTC (rev 174299)
+++ trunk/Source/WebCore/editing/EditingStyle.cpp        2014-10-03 23:17:00 UTC (rev 174300)
</span><span class="lines">@@ -142,9 +142,9 @@
</span><span class="cx"> int identifierForStyleProperty(T* style, CSSPropertyID propertyID)
</span><span class="cx"> {
</span><span class="cx">     RefPtr&lt;CSSValue&gt; value = extractPropertyValue(style, propertyID);
</span><del>-    if (!value || !value-&gt;isPrimitiveValue())
</del><ins>+    if (!is&lt;CSSPrimitiveValue&gt;(value.get()))
</ins><span class="cx">         return 0;
</span><del>-    return toCSSPrimitiveValue(value.get())-&gt;getValueID();
</del><ins>+    return downcast&lt;CSSPrimitiveValue&gt;(*value).getValueID();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> template&lt;typename T&gt; PassRefPtr&lt;MutableStyleProperties&gt; getPropertiesNotIn(StyleProperties* styleWithRedundantProperties, T* baseStyle);
</span><span class="lines">@@ -197,7 +197,7 @@
</span><span class="cx"> bool HTMLElementEquivalent::valueIsPresentInStyle(Element* element, StyleProperties* style) const
</span><span class="cx"> {
</span><span class="cx">     RefPtr&lt;CSSValue&gt; value = style-&gt;getPropertyCSSValue(m_propertyID);
</span><del>-    return matches(element) &amp;&amp; value &amp;&amp; value-&gt;isPrimitiveValue() &amp;&amp; toCSSPrimitiveValue(value.get())-&gt;getValueID() == m_primitiveValue-&gt;getValueID();
</del><ins>+    return matches(element) &amp;&amp; is&lt;CSSPrimitiveValue&gt;(value.get()) &amp;&amp; downcast&lt;CSSPrimitiveValue&gt;(*value).getValueID() == m_primitiveValue-&gt;getValueID();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void HTMLElementEquivalent::addToStyle(Element*, EditingStyle* style) const
</span><span class="lines">@@ -229,7 +229,7 @@
</span><span class="cx">     RefPtr&lt;CSSValue&gt; styleValue = style-&gt;getPropertyCSSValue(CSSPropertyWebkitTextDecorationsInEffect);
</span><span class="cx">     if (!styleValue)
</span><span class="cx">         styleValue = style-&gt;getPropertyCSSValue(CSSPropertyTextDecoration);
</span><del>-    return matches(element) &amp;&amp; styleValue &amp;&amp; styleValue-&gt;isValueList() &amp;&amp; toCSSValueList(styleValue.get())-&gt;hasValue(m_primitiveValue.get());
</del><ins>+    return matches(element) &amp;&amp; is&lt;CSSValueList&gt;(styleValue.get()) &amp;&amp; downcast&lt;CSSValueList&gt;(*styleValue).hasValue(m_primitiveValue.get());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> class HTMLAttributeEquivalent : public HTMLElementEquivalent {
</span><span class="lines">@@ -356,12 +356,12 @@
</span><span class="cx"> 
</span><span class="cx"> static RGBA32 cssValueToRGBA(CSSValue* colorValue)
</span><span class="cx"> {
</span><del>-    if (!colorValue || !colorValue-&gt;isPrimitiveValue())
</del><ins>+    if (!is&lt;CSSPrimitiveValue&gt;(colorValue))
</ins><span class="cx">         return Color::transparent;
</span><span class="cx">     
</span><del>-    CSSPrimitiveValue* primitiveColor = toCSSPrimitiveValue(colorValue);
-    if (primitiveColor-&gt;isRGBColor())
-        return primitiveColor-&gt;getRGBA32Value();
</del><ins>+    CSSPrimitiveValue&amp; primitiveColor = downcast&lt;CSSPrimitiveValue&gt;(*colorValue);
+    if (primitiveColor.isRGBColor())
+        return primitiveColor.getRGBA32Value();
</ins><span class="cx">     
</span><span class="cx">     RGBA32 rgba = 0;
</span><span class="cx">     CSSParser::parseColor(rgba, colorValue-&gt;cssText());
</span><span class="lines">@@ -476,17 +476,17 @@
</span><span class="cx"> 
</span><span class="cx">     // Get the adjustment amount out of the style.
</span><span class="cx">     RefPtr&lt;CSSValue&gt; value = m_mutableStyle-&gt;getPropertyCSSValue(CSSPropertyWebkitFontSizeDelta);
</span><del>-    if (!value || !value-&gt;isPrimitiveValue())
</del><ins>+    if (!is&lt;CSSPrimitiveValue&gt;(value.get()))
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value.get());
</del><ins>+    CSSPrimitiveValue&amp; primitiveValue = downcast&lt;CSSPrimitiveValue&gt;(*value);
</ins><span class="cx"> 
</span><span class="cx">     // Only PX handled now. If we handle more types in the future, perhaps
</span><span class="cx">     // a switch statement here would be more appropriate.
</span><del>-    if (!primitiveValue-&gt;isPx())
</del><ins>+    if (!primitiveValue.isPx())
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    m_fontSizeDelta = primitiveValue-&gt;getFloatValue();
</del><ins>+    m_fontSizeDelta = primitiveValue.getFloatValue();
</ins><span class="cx">     m_mutableStyle-&gt;removeProperty(CSSPropertyWebkitFontSizeDelta);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -501,16 +501,16 @@
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     RefPtr&lt;CSSValue&gt; unicodeBidi = m_mutableStyle-&gt;getPropertyCSSValue(CSSPropertyUnicodeBidi);
</span><del>-    if (!unicodeBidi || !unicodeBidi-&gt;isPrimitiveValue())
</del><ins>+    if (!is&lt;CSSPrimitiveValue&gt;(unicodeBidi.get()))
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    CSSValueID unicodeBidiValue = toCSSPrimitiveValue(unicodeBidi.get())-&gt;getValueID();
</del><ins>+    CSSValueID unicodeBidiValue = downcast&lt;CSSPrimitiveValue&gt;(*unicodeBidi).getValueID();
</ins><span class="cx">     if (unicodeBidiValue == CSSValueEmbed) {
</span><span class="cx">         RefPtr&lt;CSSValue&gt; direction = m_mutableStyle-&gt;getPropertyCSSValue(CSSPropertyDirection);
</span><del>-        if (!direction || !direction-&gt;isPrimitiveValue())
</del><ins>+        if (!is&lt;CSSPrimitiveValue&gt;(direction.get()))
</ins><span class="cx">             return false;
</span><span class="cx"> 
</span><del>-        writingDirection = toCSSPrimitiveValue(direction.get())-&gt;getValueID() == CSSValueLtr ? LeftToRightWritingDirection : RightToLeftWritingDirection;
</del><ins>+        writingDirection = downcast&lt;CSSPrimitiveValue&gt;(*direction).getValueID() == CSSValueLtr ? LeftToRightWritingDirection : RightToLeftWritingDirection;
</ins><span class="cx"> 
</span><span class="cx">         return true;
</span><span class="cx">     }
</span><span class="lines">@@ -930,10 +930,10 @@
</span><span class="cx">         || cssValueToRGBA(m_mutableStyle-&gt;getPropertyCSSValue(CSSPropertyBackgroundColor).get()) == rgbaBackgroundColorInEffect(position.containerNode()))
</span><span class="cx">         m_mutableStyle-&gt;removeProperty(CSSPropertyBackgroundColor);
</span><span class="cx"> 
</span><del>-    if (unicodeBidi &amp;&amp; unicodeBidi-&gt;isPrimitiveValue()) {
-        m_mutableStyle-&gt;setProperty(CSSPropertyUnicodeBidi, static_cast&lt;CSSValueID&gt;(toCSSPrimitiveValue(unicodeBidi.get())-&gt;getValueID()));
-        if (direction &amp;&amp; direction-&gt;isPrimitiveValue())
-            m_mutableStyle-&gt;setProperty(CSSPropertyDirection, static_cast&lt;CSSValueID&gt;(toCSSPrimitiveValue(direction.get())-&gt;getValueID()));
</del><ins>+    if (is&lt;CSSPrimitiveValue&gt;(unicodeBidi.get())) {
+        m_mutableStyle-&gt;setProperty(CSSPropertyUnicodeBidi, static_cast&lt;CSSValueID&gt;(downcast&lt;CSSPrimitiveValue&gt;(*unicodeBidi).getValueID()));
+        if (is&lt;CSSPrimitiveValue&gt;(direction.get()))
+            m_mutableStyle-&gt;setProperty(CSSPropertyDirection, static_cast&lt;CSSValueID&gt;(downcast&lt;CSSPrimitiveValue&gt;(*direction).getValueID()));
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1073,13 +1073,13 @@
</span><span class="cx">         StyleProperties::PropertyReference property = style-&gt;propertyAt(i);
</span><span class="cx">         RefPtr&lt;CSSValue&gt; value = m_mutableStyle-&gt;getPropertyCSSValue(property.id());
</span><span class="cx"> 
</span><del>-        // text decorations never override values
</del><ins>+        // text decorations never override values.
</ins><span class="cx">         if ((property.id() == CSSPropertyTextDecoration || property.id() == CSSPropertyWebkitTextDecorationsInEffect) &amp;&amp; property.value()-&gt;isValueList() &amp;&amp; value) {
</span><del>-            if (value-&gt;isValueList()) {
-                mergeTextDecorationValues(toCSSValueList(value.get()), toCSSValueList(property.value()));
</del><ins>+            if (is&lt;CSSValueList&gt;(*value)) {
+                mergeTextDecorationValues(downcast&lt;CSSValueList&gt;(value.get()), downcast&lt;CSSValueList&gt;(property.value()));
</ins><span class="cx">                 continue;
</span><span class="cx">             }
</span><del>-            value = 0; // text-decoration: none is equivalent to not having the property
</del><ins>+            value = nullptr; // text-decoration: none is equivalent to not having the property.
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         if (mode == OverrideValues || (mode == DoNotOverrideValues &amp;&amp; !value))
</span><span class="lines">@@ -1131,9 +1131,9 @@
</span><span class="cx">         for (unsigned i = 0; i &lt; propertyCount; ++i) {
</span><span class="cx">             StyleProperties::PropertyReference property = m_mutableStyle-&gt;propertyAt(i);
</span><span class="cx">             CSSValue* value = property.value();
</span><del>-            if (!value-&gt;isPrimitiveValue())
</del><ins>+            if (!is&lt;CSSPrimitiveValue&gt;(*value))
</ins><span class="cx">                 continue;
</span><del>-            if (toCSSPrimitiveValue(value)-&gt;isPercentage()) {
</del><ins>+            if (downcast&lt;CSSPrimitiveValue&gt;(*value).isPercentage()) {
</ins><span class="cx">                 if (RefPtr&lt;CSSValue&gt; computedPropertyValue = computedStyle.propertyValue(property.id()))
</span><span class="cx">                     fromComputedStyle-&gt;addParsedProperty(CSSProperty(property.id(), computedPropertyValue.release()));
</span><span class="cx">             }
</span><span class="lines">@@ -1245,9 +1245,9 @@
</span><span class="cx"> int EditingStyle::legacyFontSize(Document* document) const
</span><span class="cx"> {
</span><span class="cx">     RefPtr&lt;CSSValue&gt; cssValue = m_mutableStyle-&gt;getPropertyCSSValue(CSSPropertyFontSize);
</span><del>-    if (!cssValue || !cssValue-&gt;isPrimitiveValue())
</del><ins>+    if (!is&lt;CSSPrimitiveValue&gt;(cssValue.get()))
</ins><span class="cx">         return 0;
</span><del>-    return legacyFontSizeFromCSSValue(document, toCSSPrimitiveValue(cssValue.get()),
</del><ins>+    return legacyFontSizeFromCSSValue(document, downcast&lt;CSSPrimitiveValue&gt;(cssValue.get()),
</ins><span class="cx">         m_shouldUseFixedDefaultFontSize, AlwaysUseLegacyFontSize);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1308,10 +1308,10 @@
</span><span class="cx">                 continue;
</span><span class="cx"> 
</span><span class="cx">             RefPtr&lt;CSSValue&gt; unicodeBidi = ComputedStyleExtractor(n).propertyValue(CSSPropertyUnicodeBidi);
</span><del>-            if (!unicodeBidi || !unicodeBidi-&gt;isPrimitiveValue())
</del><ins>+            if (!is&lt;CSSPrimitiveValue&gt;(unicodeBidi.get()))
</ins><span class="cx">                 continue;
</span><span class="cx"> 
</span><del>-            CSSValueID unicodeBidiValue = toCSSPrimitiveValue(unicodeBidi.get())-&gt;getValueID();
</del><ins>+            CSSValueID unicodeBidiValue = downcast&lt;CSSPrimitiveValue&gt;(*unicodeBidi).getValueID();
</ins><span class="cx">             if (unicodeBidiValue == CSSValueEmbed || unicodeBidiValue == CSSValueBidiOverride)
</span><span class="cx">                 return NaturalWritingDirection;
</span><span class="cx">         }
</span><span class="lines">@@ -1337,10 +1337,10 @@
</span><span class="cx"> 
</span><span class="cx">         ComputedStyleExtractor computedStyle(node);
</span><span class="cx">         RefPtr&lt;CSSValue&gt; unicodeBidi = computedStyle.propertyValue(CSSPropertyUnicodeBidi);
</span><del>-        if (!unicodeBidi || !unicodeBidi-&gt;isPrimitiveValue())
</del><ins>+        if (!is&lt;CSSPrimitiveValue&gt;(unicodeBidi.get()))
</ins><span class="cx">             continue;
</span><span class="cx"> 
</span><del>-        CSSValueID unicodeBidiValue = toCSSPrimitiveValue(unicodeBidi.get())-&gt;getValueID();
</del><ins>+        CSSValueID unicodeBidiValue = downcast&lt;CSSPrimitiveValue&gt;(*unicodeBidi).getValueID();
</ins><span class="cx">         if (unicodeBidiValue == CSSValueNormal)
</span><span class="cx">             continue;
</span><span class="cx"> 
</span><span class="lines">@@ -1349,10 +1349,10 @@
</span><span class="cx"> 
</span><span class="cx">         ASSERT(unicodeBidiValue == CSSValueEmbed);
</span><span class="cx">         RefPtr&lt;CSSValue&gt; direction = computedStyle.propertyValue(CSSPropertyDirection);
</span><del>-        if (!direction || !direction-&gt;isPrimitiveValue())
</del><ins>+        if (!is&lt;CSSPrimitiveValue&gt;(direction.get()))
</ins><span class="cx">             continue;
</span><span class="cx"> 
</span><del>-        CSSValueID directionValue = toCSSPrimitiveValue(direction.get())-&gt;getValueID();
</del><ins>+        CSSValueID directionValue = downcast&lt;CSSPrimitiveValue&gt;(*direction).getValueID();
</ins><span class="cx">         if (directionValue != CSSValueLtr &amp;&amp; directionValue != CSSValueRtl)
</span><span class="cx">             continue;
</span><span class="cx"> 
</span><span class="lines">@@ -1452,11 +1452,11 @@
</span><span class="cx">     // Assuming reconcileTextDecorationProperties has been called, there should not be -webkit-text-decorations-in-effect
</span><span class="cx">     // Furthermore, text-decoration: none has been trimmed so that text-decoration property is always a CSSValueList.
</span><span class="cx">     RefPtr&lt;CSSValue&gt; textDecoration = style-&gt;getPropertyCSSValue(CSSPropertyTextDecoration);
</span><del>-    if (textDecoration &amp;&amp; textDecoration-&gt;isValueList()) {
</del><ins>+    if (is&lt;CSSValueList&gt;(textDecoration.get())) {
</ins><span class="cx">         RefPtr&lt;CSSPrimitiveValue&gt; underline = cssValuePool().createIdentifierValue(CSSValueUnderline);
</span><span class="cx">         RefPtr&lt;CSSPrimitiveValue&gt; lineThrough = cssValuePool().createIdentifierValue(CSSValueLineThrough);
</span><span class="cx"> 
</span><del>-        RefPtr&lt;CSSValueList&gt; newTextDecoration = toCSSValueList(textDecoration.get())-&gt;copy();
</del><ins>+        RefPtr&lt;CSSValueList&gt; newTextDecoration = downcast&lt;CSSValueList&gt;(*textDecoration).copy();
</ins><span class="cx">         if (newTextDecoration-&gt;removeAll(underline.get()))
</span><span class="cx">             m_applyUnderline = true;
</span><span class="cx">         if (newTextDecoration-&gt;removeAll(lineThrough.get()))
</span><span class="lines">@@ -1489,9 +1489,9 @@
</span><span class="cx">     style-&gt;removeProperty(CSSPropertyFontFamily);
</span><span class="cx"> 
</span><span class="cx">     if (RefPtr&lt;CSSValue&gt; fontSize = style-&gt;getPropertyCSSValue(CSSPropertyFontSize)) {
</span><del>-        if (!fontSize-&gt;isPrimitiveValue())
</del><ins>+        if (!is&lt;CSSPrimitiveValue&gt;(*fontSize))
</ins><span class="cx">             style-&gt;removeProperty(CSSPropertyFontSize); // Can't make sense of the number. Put no font size.
</span><del>-        else if (int legacyFontSize = legacyFontSizeFromCSSValue(document, toCSSPrimitiveValue(fontSize.get()),
</del><ins>+        else if (int legacyFontSize = legacyFontSizeFromCSSValue(document, downcast&lt;CSSPrimitiveValue&gt;(fontSize.get()),
</ins><span class="cx">                 shouldUseFixedFontDefaultSize, UseLegacyFontSizeOnlyIfPixelValuesMatch)) {
</span><span class="cx">             m_applyFontSize = String::number(legacyFontSize);
</span><span class="cx">             style-&gt;removeProperty(CSSPropertyFontSize);
</span><span class="lines">@@ -1502,28 +1502,26 @@
</span><span class="cx"> static void diffTextDecorations(MutableStyleProperties* style, CSSPropertyID propertID, CSSValue* refTextDecoration)
</span><span class="cx"> {
</span><span class="cx">     RefPtr&lt;CSSValue&gt; textDecoration = style-&gt;getPropertyCSSValue(propertID);
</span><del>-    if (!textDecoration || !textDecoration-&gt;isValueList() || !refTextDecoration || !refTextDecoration-&gt;isValueList())
</del><ins>+    if (!is&lt;CSSValueList&gt;(textDecoration.get()) || !is&lt;CSSValueList&gt;(refTextDecoration))
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    RefPtr&lt;CSSValueList&gt; newTextDecoration = toCSSValueList(textDecoration.get())-&gt;copy();
-    CSSValueList* valuesInRefTextDecoration = toCSSValueList(refTextDecoration);
</del><ins>+    RefPtr&lt;CSSValueList&gt; newTextDecoration = downcast&lt;CSSValueList&gt;(*textDecoration).copy();
+    CSSValueList&amp; valuesInRefTextDecoration = downcast&lt;CSSValueList&gt;(*refTextDecoration);
</ins><span class="cx"> 
</span><del>-    for (size_t i = 0; i &lt; valuesInRefTextDecoration-&gt;length(); i++)
-        newTextDecoration-&gt;removeAll(valuesInRefTextDecoration-&gt;item(i));
</del><ins>+    for (size_t i = 0; i &lt; valuesInRefTextDecoration.length(); ++i)
+        newTextDecoration-&gt;removeAll(valuesInRefTextDecoration.item(i));
</ins><span class="cx"> 
</span><span class="cx">     setTextDecorationProperty(style, newTextDecoration.get(), propertID);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static bool fontWeightIsBold(CSSValue* fontWeight)
</span><span class="cx"> {
</span><del>-    if (!fontWeight)
</del><ins>+    if (!is&lt;CSSPrimitiveValue&gt;(fontWeight))
</ins><span class="cx">         return false;
</span><del>-    if (!fontWeight-&gt;isPrimitiveValue())
-        return false;
</del><span class="cx"> 
</span><span class="cx">     // Because b tag can only bold text, there are only two states in plain html: bold and not bold.
</span><span class="cx">     // Collapse all other values to either one of these two states for editing purposes.
</span><del>-    switch (toCSSPrimitiveValue(fontWeight)-&gt;getValueID()) {
</del><ins>+    switch (downcast&lt;CSSPrimitiveValue&gt;(*fontWeight).getValueID()) {
</ins><span class="cx">         case CSSValue100:
</span><span class="cx">         case CSSValue200:
</span><span class="cx">         case CSSValue300:
</span><span class="lines">@@ -1615,12 +1613,12 @@
</span><span class="cx"> {
</span><span class="cx">     if (!cssValue)
</span><span class="cx">         return true;
</span><del>-    if (!cssValue-&gt;isPrimitiveValue())
</del><ins>+    if (!is&lt;CSSPrimitiveValue&gt;(*cssValue))
</ins><span class="cx">         return false;
</span><del>-    CSSPrimitiveValue* value = toCSSPrimitiveValue(cssValue);    
-    if (value-&gt;isRGBColor())
-        return !alphaChannel(value-&gt;getRGBA32Value());    
-    return value-&gt;getValueID() == CSSValueTransparent;
</del><ins>+    CSSPrimitiveValue&amp; value = downcast&lt;CSSPrimitiveValue&gt;(*cssValue);
+    if (value.isRGBColor())
+        return !alphaChannel(value.getRGBA32Value());
+    return value.getValueID() == CSSValueTransparent;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool hasTransparentBackgroundColor(StyleProperties* style)
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingEditorCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/EditorCommand.cpp (174299 => 174300)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/EditorCommand.cpp        2014-10-03 23:05:07 UTC (rev 174299)
+++ trunk/Source/WebCore/editing/EditorCommand.cpp        2014-10-03 23:17:00 UTC (rev 174300)
</span><span class="lines">@@ -139,8 +139,8 @@
</span><span class="cx"> 
</span><span class="cx">     RefPtr&lt;CSSValue&gt; selectedCSSValue = selectionStyle-&gt;style()-&gt;getPropertyCSSValue(propertyID);
</span><span class="cx">     String newStyle = ASCIILiteral(&quot;none&quot;);
</span><del>-    if (selectedCSSValue-&gt;isValueList()) {
-        RefPtr&lt;CSSValueList&gt; selectedCSSValueList = toCSSValueList(selectedCSSValue.get());
</del><ins>+    if (is&lt;CSSValueList&gt;(*selectedCSSValue)) {
+        RefPtr&lt;CSSValueList&gt; selectedCSSValueList = downcast&lt;CSSValueList&gt;(selectedCSSValue.get());
</ins><span class="cx">         if (!selectedCSSValueList-&gt;removeAll(value))
</span><span class="cx">             selectedCSSValueList-&gt;append(*value);
</span><span class="cx">         if (selectedCSSValueList-&gt;length())
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingcocoaHTMLConvertermm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/cocoa/HTMLConverter.mm (174299 => 174300)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/cocoa/HTMLConverter.mm        2014-10-03 23:05:07 UTC (rev 174299)
+++ trunk/Source/WebCore/editing/cocoa/HTMLConverter.mm        2014-10-03 23:17:00 UTC (rev 174300)
</span><span class="lines">@@ -720,8 +720,8 @@
</span><span class="cx"> 
</span><span class="cx"> static bool stringFromCSSValue(CSSValue&amp; value, String&amp; result)
</span><span class="cx"> {
</span><del>-    if (value.isPrimitiveValue()) {
-        unsigned short primitiveType = toCSSPrimitiveValue(value).primitiveType();
</del><ins>+    if (is&lt;CSSPrimitiveValue&gt;(value)) {
+        unsigned short primitiveType = downcast&lt;CSSPrimitiveValue&gt;(value).primitiveType();
</ins><span class="cx">         if (primitiveType == CSSPrimitiveValue::CSS_STRING || primitiveType == CSSPrimitiveValue::CSS_URI ||
</span><span class="cx">             primitiveType == CSSPrimitiveValue::CSS_IDENT || primitiveType == CSSPrimitiveValue::CSS_ATTR) {
</span><span class="cx">             String stringValue = value.cssText();
</span><span class="lines">@@ -892,13 +892,13 @@
</span><span class="cx"> 
</span><span class="cx">     Element&amp; element = downcast&lt;Element&gt;(node);
</span><span class="cx">     if (RefPtr&lt;CSSValue&gt; value = computedStylePropertyForElement(element, propertyId)) {
</span><del>-        if (value-&gt;isPrimitiveValue() &amp;&amp; floatValueFromPrimitiveValue(toCSSPrimitiveValue(*value), result))
</del><ins>+        if (is&lt;CSSPrimitiveValue&gt;(*value) &amp;&amp; floatValueFromPrimitiveValue(downcast&lt;CSSPrimitiveValue&gt;(*value), result))
</ins><span class="cx">             return true;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     bool inherit = false;
</span><span class="cx">     if (RefPtr&lt;CSSValue&gt; value = inlineStylePropertyForElement(element, propertyId)) {
</span><del>-        if (value-&gt;isPrimitiveValue() &amp;&amp; floatValueFromPrimitiveValue(toCSSPrimitiveValue(*value), result))
</del><ins>+        if (is&lt;CSSPrimitiveValue&gt;(*value) &amp;&amp; floatValueFromPrimitiveValue(downcast&lt;CSSPrimitiveValue&gt;(*value), result))
</ins><span class="cx">             return true;
</span><span class="cx">         if (value-&gt;isInheritedValue())
</span><span class="cx">             inherit = true;
</span><span class="lines">@@ -1061,14 +1061,14 @@
</span><span class="cx"> 
</span><span class="cx">     Element&amp; element = downcast&lt;Element&gt;(node);
</span><span class="cx">     if (RefPtr&lt;CSSValue&gt; value = computedStylePropertyForElement(element, propertyId)) {
</span><del>-        if (value-&gt;isPrimitiveValue() &amp;&amp; toCSSPrimitiveValue(*value).isRGBColor())
-            return normalizedColor(Color(toCSSPrimitiveValue(*value).getRGBA32Value()), propertyId == CSSPropertyColor);
</del><ins>+        if (is&lt;CSSPrimitiveValue&gt;(*value) &amp;&amp; downcast&lt;CSSPrimitiveValue&gt;(*value).isRGBColor())
+            return normalizedColor(Color(downcast&lt;CSSPrimitiveValue&gt;(*value).getRGBA32Value()), propertyId == CSSPropertyColor);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     bool inherit = false;
</span><span class="cx">     if (RefPtr&lt;CSSValue&gt; value = inlineStylePropertyForElement(element, propertyId)) {
</span><del>-        if (value-&gt;isPrimitiveValue() &amp;&amp; toCSSPrimitiveValue(*value).isRGBColor())
-            return normalizedColor(Color(toCSSPrimitiveValue(*value).getRGBA32Value()), propertyId == CSSPropertyColor);
</del><ins>+        if (is&lt;CSSPrimitiveValue&gt;(*value) &amp;&amp; downcast&lt;CSSPrimitiveValue&gt;(*value).isRGBColor())
+            return normalizedColor(Color(downcast&lt;CSSPrimitiveValue&gt;(*value).getRGBA32Value()), propertyId == CSSPropertyColor);
</ins><span class="cx">         if (value-&gt;isInheritedValue())
</span><span class="cx">             inherit = true;
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingmarkupcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/markup.cpp (174299 => 174300)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/markup.cpp        2014-10-03 23:05:07 UTC (rev 174299)
+++ trunk/Source/WebCore/editing/markup.cpp        2014-10-03 23:17:00 UTC (rev 174300)
</span><span class="lines">@@ -476,9 +476,9 @@
</span><span class="cx">     RefPtr&lt;CSSValue&gt; value = style-&gt;getPropertyCSSValue(propertyID);
</span><span class="cx">     if (!value)
</span><span class="cx">         return true;
</span><del>-    if (!value-&gt;isPrimitiveValue())
</del><ins>+    if (!is&lt;CSSPrimitiveValue&gt;(*value))
</ins><span class="cx">         return false;
</span><del>-    return toCSSPrimitiveValue(value.get())-&gt;getValueID() == CSSValueNone;
</del><ins>+    return downcast&lt;CSSPrimitiveValue&gt;(*value).getValueID() == CSSValueNone;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static bool needInterchangeNewlineAfter(const VisiblePosition&amp; v)
</span></span></pre></div>
<a id="trunkSourceWebCorepagePageSerializercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/PageSerializer.cpp (174299 => 174300)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/PageSerializer.cpp        2014-10-03 23:05:07 UTC (rev 174299)
+++ trunk/Source/WebCore/page/PageSerializer.cpp        2014-10-03 23:17:00 UTC (rev 174300)
</span><span class="lines">@@ -328,10 +328,10 @@
</span><span class="cx">     unsigned propertyCount = styleDeclaration-&gt;propertyCount();
</span><span class="cx">     for (unsigned i = 0; i &lt; propertyCount; ++i) {
</span><span class="cx">         RefPtr&lt;CSSValue&gt; cssValue = styleDeclaration-&gt;propertyAt(i).value();
</span><del>-        if (!cssValue-&gt;isImageValue())
</del><ins>+        if (!is&lt;CSSImageValue&gt;(*cssValue))
</ins><span class="cx">             continue;
</span><span class="cx"> 
</span><del>-        StyleImage* styleImage = toCSSImageValue(cssValue.get())-&gt;cachedOrPendingImage();
</del><ins>+        StyleImage* styleImage = downcast&lt;CSSImageValue&gt;(*cssValue).cachedOrPendingImage();
</ins><span class="cx">         // Non cached-images are just place-holders and do not contain data.
</span><span class="cx">         if (!styleImage || !styleImage-&gt;isCachedImage())
</span><span class="cx">             continue;
</span></span></pre></div>
<a id="trunkSourceWebCorepageanimationCSSPropertyAnimationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/animation/CSSPropertyAnimation.cpp (174299 => 174300)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/animation/CSSPropertyAnimation.cpp        2014-10-03 23:05:07 UTC (rev 174299)
+++ trunk/Source/WebCore/page/animation/CSSPropertyAnimation.cpp        2014-10-03 23:17:00 UTC (rev 174300)
</span><span class="lines">@@ -297,18 +297,18 @@
</span><span class="cx">         CSSImageGeneratorValue&amp; fromGenerated = toStyleGeneratedImage(from)-&gt;imageValue();
</span><span class="cx">         CSSImageGeneratorValue&amp; toGenerated = toStyleGeneratedImage(to)-&gt;imageValue();
</span><span class="cx"> 
</span><del>-        if (fromGenerated.isFilterImageValue() &amp;&amp; toGenerated.isFilterImageValue()) {
</del><ins>+        if (is&lt;CSSFilterImageValue&gt;(fromGenerated) &amp;&amp; is&lt;CSSFilterImageValue&gt;(toGenerated)) {
</ins><span class="cx">             // Animation of generated images just possible if input images are equal.
</span><span class="cx">             // Otherwise fall back to cross fade animation.
</span><del>-            CSSFilterImageValue&amp; fromFilter = toCSSFilterImageValue(fromGenerated);
-            CSSFilterImageValue&amp; toFilter = toCSSFilterImageValue(toGenerated);
</del><ins>+            CSSFilterImageValue&amp; fromFilter = downcast&lt;CSSFilterImageValue&gt;(fromGenerated);
+            CSSFilterImageValue&amp; toFilter = downcast&lt;CSSFilterImageValue&gt;(toGenerated);
</ins><span class="cx">             if (fromFilter.equalInputImages(toFilter) &amp;&amp; fromFilter.cachedImage())
</span><span class="cx">                 return blendFilter(anim, fromFilter.cachedImage(), fromFilter.filterOperations(), toFilter.filterOperations(), progress);
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        if (fromGenerated.isCrossfadeValue() &amp;&amp; toGenerated.isCrossfadeValue()) {
-            CSSCrossfadeValue&amp; fromCrossfade = toCSSCrossfadeValue(fromGenerated);
-            CSSCrossfadeValue&amp; toCrossfade = toCSSCrossfadeValue(toGenerated);
</del><ins>+        if (is&lt;CSSCrossfadeValue&gt;(fromGenerated) &amp;&amp; is&lt;CSSCrossfadeValue&gt;(toGenerated)) {
+            CSSCrossfadeValue&amp; fromCrossfade = downcast&lt;CSSCrossfadeValue&gt;(fromGenerated);
+            CSSCrossfadeValue&amp; toCrossfade = downcast&lt;CSSCrossfadeValue&gt;(toGenerated);
</ins><span class="cx">             if (fromCrossfade.equalInputImages(toCrossfade))
</span><span class="cx">                 return StyleGeneratedImage::create(*toCrossfade.blend(fromCrossfade, progress));
</span><span class="cx">         }
</span><span class="lines">@@ -317,16 +317,16 @@
</span><span class="cx">         // https://bugs.webkit.org/show_bug.cgi?id=119956
</span><span class="cx">     } else if (from-&gt;isGeneratedImage() &amp;&amp; to-&gt;isCachedImage()) {
</span><span class="cx">         CSSImageGeneratorValue&amp; fromGenerated = toStyleGeneratedImage(from)-&gt;imageValue();
</span><del>-        if (fromGenerated.isFilterImageValue()) {
-            CSSFilterImageValue&amp; fromFilter = toCSSFilterImageValue(fromGenerated);
</del><ins>+        if (is&lt;CSSFilterImageValue&gt;(fromGenerated)) {
+            CSSFilterImageValue&amp; fromFilter = downcast&lt;CSSFilterImageValue&gt;(fromGenerated);
</ins><span class="cx">             if (fromFilter.cachedImage() &amp;&amp; toStyleCachedImage(to)-&gt;cachedImage() == fromFilter.cachedImage())
</span><span class="cx">                 return blendFilter(anim, fromFilter.cachedImage(), fromFilter.filterOperations(), FilterOperations(), progress);
</span><span class="cx">         }
</span><span class="cx">         // FIXME: Add interpolation between cross-fade and image source.
</span><span class="cx">     } else if (from-&gt;isCachedImage() &amp;&amp; to-&gt;isGeneratedImage()) {
</span><span class="cx">         CSSImageGeneratorValue&amp; toGenerated = toStyleGeneratedImage(to)-&gt;imageValue();
</span><del>-        if (toGenerated.isFilterImageValue()) {
-            CSSFilterImageValue&amp; toFilter = toCSSFilterImageValue(toGenerated);
</del><ins>+        if (is&lt;CSSFilterImageValue&gt;(toGenerated)) {
+            CSSFilterImageValue&amp; toFilter = downcast&lt;CSSFilterImageValue&gt;(toGenerated);
</ins><span class="cx">             if (toFilter.cachedImage() &amp;&amp; toStyleCachedImage(from)-&gt;cachedImage() == toFilter.cachedImage())     
</span><span class="cx">                 return blendFilter(anim, toFilter.cachedImage(), FilterOperations(), toFilter.filterOperations(), progress);
</span><span class="cx">         }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderTextControlcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderTextControl.cpp (174299 => 174300)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderTextControl.cpp        2014-10-03 23:05:07 UTC (rev 174299)
+++ trunk/Source/WebCore/rendering/RenderTextControl.cpp        2014-10-03 23:17:00 UTC (rev 174300)
</span><span class="lines">@@ -84,8 +84,8 @@
</span><span class="cx">     if (HTMLElement* innerText = control.innerTextElement()) {
</span><span class="cx">         if (const StyleProperties* properties = innerText-&gt;presentationAttributeStyle()) {
</span><span class="cx">             RefPtr&lt;CSSValue&gt; value = properties-&gt;getPropertyCSSValue(CSSPropertyWebkitUserModify);
</span><del>-            if (value &amp;&amp; value-&gt;isPrimitiveValue())
-                textBlockStyle-&gt;setUserModify(toCSSPrimitiveValue(*value));
</del><ins>+            if (is&lt;CSSPrimitiveValue&gt;(value.get()))
+                textBlockStyle-&gt;setUserModify(downcast&lt;CSSPrimitiveValue&gt;(*value));
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingstyleStylePendingImageh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/style/StylePendingImage.h (174299 => 174300)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/style/StylePendingImage.h        2014-10-03 23:05:07 UTC (rev 174299)
+++ trunk/Source/WebCore/rendering/style/StylePendingImage.h        2014-10-03 23:17:00 UTC (rev 174300)
</span><span class="lines">@@ -45,12 +45,12 @@
</span><span class="cx"> public:
</span><span class="cx">     static PassRefPtr&lt;StylePendingImage&gt; create(CSSValue* value) { return adoptRef(new StylePendingImage(value)); }
</span><span class="cx"> 
</span><del>-    CSSImageValue* cssImageValue() const { return m_value &amp;&amp; m_value-&gt;isImageValue() ? toCSSImageValue(m_value) : nullptr; }
</del><ins>+    CSSImageValue* cssImageValue() const { return is&lt;CSSImageValue&gt;(m_value) ? downcast&lt;CSSImageValue&gt;(m_value) : nullptr; }
</ins><span class="cx">     CSSImageGeneratorValue* cssImageGeneratorValue() const { return m_value &amp;&amp; m_value-&gt;isImageGeneratorValue() ? static_cast&lt;CSSImageGeneratorValue*&gt;(m_value) : nullptr; }
</span><del>-    CSSCursorImageValue* cssCursorImageValue() const { return m_value &amp;&amp; m_value-&gt;isCursorImageValue() ? toCSSCursorImageValue(m_value) : nullptr; }
</del><ins>+    CSSCursorImageValue* cssCursorImageValue() const { return is&lt;CSSCursorImageValue&gt;(m_value) ? downcast&lt;CSSCursorImageValue&gt;(m_value) : nullptr; }
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(CSS_IMAGE_SET)
</span><del>-    CSSImageSetValue* cssImageSetValue() const { return m_value &amp;&amp; m_value-&gt;isImageSetValue() ? toCSSImageSetValue(m_value) : nullptr; }
</del><ins>+    CSSImageSetValue* cssImageSetValue() const { return is&lt;CSSImageSetValue&gt;(m_value) ? downcast&lt;CSSImageSetValue&gt;(m_value) : nullptr; }
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     void detachFromCSSValue() { m_value = nullptr; }
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGColorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGColor.h (174299 => 174300)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGColor.h        2014-10-03 23:05:07 UTC (rev 174299)
+++ trunk/Source/WebCore/svg/SVGColor.h        2014-10-03 23:17:00 UTC (rev 174300)
</span><span class="lines">@@ -92,8 +92,8 @@
</span><span class="cx">     SVGColorType m_colorType;
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-CSS_VALUE_TYPE_CASTS(SVGColor, isSVGColor());
-
</del><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><ins>+SPECIALIZE_TYPE_TRAITS_CSS_VALUE(SVGColor, isSVGColor())
+
</ins><span class="cx"> #endif // SVGColor_h
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGFontFaceElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGFontFaceElement.cpp (174299 => 174300)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGFontFaceElement.cpp        2014-10-03 23:05:07 UTC (rev 174299)
+++ trunk/Source/WebCore/svg/SVGFontFaceElement.cpp        2014-10-03 23:17:00 UTC (rev 174300)
</span><span class="lines">@@ -253,11 +253,11 @@
</span><span class="cx">     if (describesParentFont) {    
</span><span class="cx">         // Traverse parsed CSS values and associate CSSFontFaceSrcValue elements with ourselves.
</span><span class="cx">         RefPtr&lt;CSSValue&gt; src = m_fontFaceRule-&gt;properties().getPropertyCSSValue(CSSPropertySrc);
</span><del>-        CSSValueList* srcList = toCSSValueList(src.get());
</del><ins>+        CSSValueList* srcList = downcast&lt;CSSValueList&gt;(src.get());
</ins><span class="cx"> 
</span><span class="cx">         unsigned srcLength = srcList ? srcList-&gt;length() : 0;
</span><del>-        for (unsigned i = 0; i &lt; srcLength; i++) {
-            if (CSSFontFaceSrcValue* item = toCSSFontFaceSrcValue(srcList-&gt;itemWithoutBoundsCheck(i)))
</del><ins>+        for (unsigned i = 0; i &lt; srcLength; ++i) {
+            if (CSSFontFaceSrcValue* item = downcast&lt;CSSFontFaceSrcValue&gt;(srcList-&gt;itemWithoutBoundsCheck(i)))
</ins><span class="cx">                 item-&gt;setSVGFontFaceElement(this);
</span><span class="cx">         }
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGPainth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGPaint.h (174299 => 174300)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGPaint.h        2014-10-03 23:05:07 UTC (rev 174299)
+++ trunk/Source/WebCore/svg/SVGPaint.h        2014-10-03 23:17:00 UTC (rev 174300)
</span><span class="lines">@@ -112,8 +112,8 @@
</span><span class="cx">     String m_uri;
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-CSS_VALUE_TYPE_CASTS(SVGPaint, isSVGPaint());
-
</del><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><ins>+SPECIALIZE_TYPE_TRAITS_CSS_VALUE(SVGPaint, isSVGPaint())
+
</ins><span class="cx"> #endif // SVGPaint_h
</span></span></pre>
</div>
</div>

</body>
</html>