Index: Source/core/dom/ElementData.cpp |
diff --git a/Source/core/dom/ElementData.cpp b/Source/core/dom/ElementData.cpp |
index 87bc696327833f69e9bf045727815d42b9f6ebf8..2922961534e2fe08005d222aac804c9fb6b50cc1 100644 |
--- a/Source/core/dom/ElementData.cpp |
+++ b/Source/core/dom/ElementData.cpp |
@@ -83,25 +83,25 @@ ElementData::ElementData(const ElementData& other, bool isUnique) |
void ElementData::finalizeGarbageCollectedObject() |
{ |
if (m_isUnique) |
- static_cast<UniqueElementData*>(this)->~UniqueElementData(); |
+ toUniqueElementData(this)->~UniqueElementData(); |
else |
- static_cast<ShareableElementData*>(this)->~ShareableElementData(); |
+ toShareableElementData(this)->~ShareableElementData(); |
} |
#else |
void ElementData::destroy() |
{ |
if (m_isUnique) |
- delete static_cast<UniqueElementData*>(this); |
+ delete toUniqueElementData(this); |
else |
- delete static_cast<ShareableElementData*>(this); |
+ delete toShareableElementData(this); |
} |
#endif |
PassRefPtrWillBeRawPtr<UniqueElementData> ElementData::makeUniqueCopy() const |
{ |
if (isUnique()) |
- return adoptRefWillBeNoop(new UniqueElementData(static_cast<const UniqueElementData&>(*this))); |
- return adoptRefWillBeNoop(new UniqueElementData(static_cast<const ShareableElementData&>(*this))); |
+ return adoptRefWillBeNoop(new UniqueElementData(toUniqueElementData(*this))); |
+ return adoptRefWillBeNoop(new UniqueElementData(toShareableElementData(*this))); |
} |
bool ElementData::isEquivalent(const ElementData* other) const |
@@ -126,9 +126,9 @@ bool ElementData::isEquivalent(const ElementData* other) const |
void ElementData::trace(Visitor* visitor) |
{ |
if (m_isUnique) |
- static_cast<UniqueElementData*>(this)->traceAfterDispatch(visitor); |
+ toUniqueElementData(this)->traceAfterDispatch(visitor); |
else |
- static_cast<ShareableElementData*>(this)->traceAfterDispatch(visitor); |
+ toShareableElementData(this)->traceAfterDispatch(visitor); |
} |
void ElementData::traceAfterDispatch(Visitor* visitor) |