Ignore:
Timestamp:
Oct 3, 2014, 4:17:00 PM (11 years ago)
Author:
Chris Dumez
Message:

Use is<>() / downcast<>() for CSSValue subclasses
https://bugs.webkit.org/show_bug.cgi?id=137381

Reviewed by Benjamin Poulain.

Use is<>() / downcast<>() 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:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/css/CSSGradientValue.cpp

    r174222 r174300  
    4747{
    4848    if (size.isEmpty())
    49         return 0;
     49        return nullptr;
    5050
    5151    bool cacheable = isCacheable();
    5252    if (cacheable) {
    5353        if (!clients().contains(renderer))
    54             return 0;
     54            return nullptr;
    5555
    5656        Image* result = cachedImageForSize(size);
     
    6161    RefPtr<Gradient> gradient;
    6262
    63     if (isLinearGradientValue())
    64         gradient = toCSSLinearGradientValue(this)->createGradient(*renderer, size);
     63    if (is<CSSLinearGradientValue>(*this))
     64        gradient = downcast<CSSLinearGradientValue>(*this).createGradient(*renderer, size);
    6565    else
    66         gradient = toCSSRadialGradientValue(this)->createGradient(*renderer, size);
     66        gradient = downcast<CSSRadialGradientValue>(*this).createGradient(*renderer, size);
    6767
    6868    RefPtr<GradientImage> newImage = GradientImage::create(gradient, size);
     
    119119    if (!derived)
    120120        result = this;
    121     else if (isLinearGradientValue())
    122         result = toCSSLinearGradientValue(this)->clone();
    123     else if (isRadialGradientValue())
    124         result = toCSSRadialGradientValue(this)->clone();
     121    else if (is<CSSLinearGradientValue>(*this))
     122        result = downcast<CSSLinearGradientValue>(*this).clone();
     123    else if (is<CSSRadialGradientValue>(*this))
     124        result = downcast<CSSRadialGradientValue>(*this).clone();
    125125    else {
    126126        ASSERT_NOT_REACHED();
    127         return 0;
     127        return nullptr;
    128128    }
    129129
Note: See TracChangeset for help on using the changeset viewer.