Ignore:
Timestamp:
Feb 18, 2014, 11:10:38 AM (11 years ago)
Author:
[email protected]
Message:

Add type-checked casts for StyleImage and subclasses
<http://webkit.org/b/128915>

Reviewed by Oliver Hunt.

  • css/CSSCursorImageValue.cpp:

(WebCore::CSSCursorImageValue::detachPendingImage):
(WebCore::CSSCursorImageValue::cachedImage):
(WebCore::CSSCursorImageValue::cachedImageURL):

  • css/CSSImageSetValue.cpp:

(WebCore::CSSImageSetValue::detachPendingImage):
(WebCore::CSSImageSetValue::~CSSImageSetValue):
(WebCore::CSSImageSetValue::cachedImageSet):
(WebCore::CSSImageSetValue::hasFailedOrCanceledSubresources):

  • css/CSSImageValue.cpp:

(WebCore::CSSImageValue::detachPendingImage):
(WebCore::CSSImageValue::cachedImage):
(WebCore::CSSImageValue::hasFailedOrCanceledSubresources):

  • css/StyleResolver.cpp:

(WebCore::StyleResolver::loadPendingShapeImage):
(WebCore::StyleResolver::loadPendingImages):

  • page/PageSerializer.cpp:

(WebCore::PageSerializer::retrieveResourcesForProperties):

  • page/animation/CSSPropertyAnimation.cpp:

(WebCore::blendFunc):

  • Switch from static_cast<>() operators to toTypeName() methods.
  • Replace 0 with nullptr where convenient.
  • rendering/style/StyleCachedImage.h:
  • rendering/style/StyleCachedImageSet.h:
  • rendering/style/StyleGeneratedImage.h:
  • rendering/style/StyleImage.h:
  • rendering/style/StylePendingImage.h:
  • Define type-checked cast macros.
File:
1 edited

Legend:

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

    r161980 r164298  
    5454{
    5555    if (m_imageSet && m_imageSet->isPendingImage())
    56         static_cast<StylePendingImage&>(*m_imageSet).detachFromCSSValue();
     56        toStylePendingImage(*m_imageSet).detachFromCSSValue();
    5757}
    5858
     
    6262
    6363    if (m_imageSet && m_imageSet->isCachedImageSet())
    64         static_cast<StyleCachedImageSet*>(m_imageSet.get())->clearImageSetValue();
     64        toStyleCachedImageSet(m_imageSet.get())->clearImageSetValue();
    6565}
    6666
     
    131131    }
    132132
    133     return (m_imageSet && m_imageSet->isCachedImageSet()) ? static_cast<StyleCachedImageSet*>(m_imageSet.get()) : 0;
     133    return (m_imageSet && m_imageSet->isCachedImageSet()) ? toStyleCachedImageSet(m_imageSet.get()) : nullptr;
    134134}
    135135
     
    192192    if (!m_imageSet || !m_imageSet->isCachedImageSet())
    193193        return false;
    194     CachedResource* cachedResource = static_cast<StyleCachedImageSet*>(m_imageSet.get())->cachedImage();
     194    CachedResource* cachedResource = toStyleCachedImageSet(m_imageSet.get())->cachedImage();
    195195    if (!cachedResource)
    196196        return true;
Note: See TracChangeset for help on using the changeset viewer.