Index: Source/core/rendering/style/ContentData.h |
diff --git a/Source/core/rendering/style/ContentData.h b/Source/core/rendering/style/ContentData.h |
index 1bf4bf6ef317a6783b6314065af8f5437e81bc70..531091fe06681c8cbbaec8fe1b6bbdfb7ffc913b 100644 |
--- a/Source/core/rendering/style/ContentData.h |
+++ b/Source/core/rendering/style/ContentData.h |
@@ -66,6 +66,9 @@ private: |
OwnPtr<ContentData> m_next; |
}; |
+#define DEFINE_CONTENT_DATA_TYPE_CASTS(typeName) \ |
+ DEFINE_TYPE_CASTS(typeName##ContentData, ContentData, content, content->is##typeName(), content.is##typeName()) |
+ |
class ImageContentData FINAL : public ContentData { |
friend class ContentData; |
public: |
@@ -98,6 +101,8 @@ private: |
RefPtr<StyleImage> m_image; |
}; |
+DEFINE_CONTENT_DATA_TYPE_CASTS(Image); |
+ |
class TextContentData FINAL : public ContentData { |
friend class ContentData; |
public: |
@@ -125,6 +130,8 @@ private: |
String m_text; |
}; |
+DEFINE_CONTENT_DATA_TYPE_CASTS(Text); |
+ |
class CounterContentData FINAL : public ContentData { |
friend class ContentData; |
public: |
@@ -156,6 +163,8 @@ private: |
OwnPtr<CounterContent> m_counter; |
}; |
+DEFINE_CONTENT_DATA_TYPE_CASTS(Counter); |
+ |
class QuoteContentData FINAL : public ContentData { |
friend class ContentData; |
public: |
@@ -183,6 +192,8 @@ private: |
QuoteType m_quote; |
}; |
+DEFINE_CONTENT_DATA_TYPE_CASTS(Quote); |
+ |
inline bool operator==(const ContentData& a, const ContentData& b) |
{ |
return a.equals(b); |