Ignore:
Timestamp:
Sep 2, 2014, 9:06:23 AM (11 years ago)
Author:
[email protected]
Message:

Introduce CSS_BASIC_TYPE_CASTS, and use it
https://bugs.webkit.org/show_bug.cgi?id=136403

Reviewed by Darin Adler.

toCSSBasicFoo() will help to detect wrong type casting. So this patch generates it, and use it
instead of static_cast<const CSSBasicFoo*>().

No new tests no behavior changes.

  • css/BasicShapeFunctions.cpp:

(WebCore::basicShapeForValue):

  • css/CSSBasicShapes.cpp:

(WebCore::CSSBasicShapeCircle::equals):
(WebCore::CSSBasicShapeEllipse::equals):
(WebCore::CSSBasicShapePolygon::equals):
(WebCore::CSSBasicShapeInset::equals):

  • css/CSSBasicShapes.h:
File:
1 edited

Legend:

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

    r169406 r173175  
    129129        return false;
    130130
    131     const CSSBasicShapeCircle& other = static_cast<const CSSBasicShapeCircle&>(shape);
     131    const CSSBasicShapeCircle& other = toCSSBasicShapeCircle(shape);
    132132    return compareCSSValuePtr(m_centerX, other.m_centerX)
    133133        && compareCSSValuePtr(m_centerY, other.m_centerY)
     
    202202        return false;
    203203
    204     const CSSBasicShapeEllipse& other = static_cast<const CSSBasicShapeEllipse&>(shape);
     204    const CSSBasicShapeEllipse& other = toCSSBasicShapeEllipse(shape);
    205205    return compareCSSValuePtr(m_centerX, other.m_centerX)
    206206        && compareCSSValuePtr(m_centerY, other.m_centerY)
     
    273273        return false;
    274274
    275     const CSSBasicShapePolygon& rhs = static_cast<const CSSBasicShapePolygon&>(shape);
     275    const CSSBasicShapePolygon& rhs = toCSSBasicShapePolygon(shape);
    276276    return compareCSSValuePtr(m_referenceBox, rhs.m_referenceBox)
    277277        && compareCSSValueVector<CSSPrimitiveValue>(m_values, rhs.m_values);
     
    408408        return false;
    409409
    410     const CSSBasicShapeInset& other = static_cast<const CSSBasicShapeInset&>(shape);
     410    const CSSBasicShapeInset& other = toCSSBasicShapeInset(shape);
    411411    return compareCSSValuePtr(m_top, other.m_top)
    412412        && compareCSSValuePtr(m_right, other.m_right)
Note: See TracChangeset for help on using the changeset viewer.