Index: Source/core/rendering/svg/RenderSVGResourceContainer.h |
diff --git a/Source/core/rendering/svg/RenderSVGResourceContainer.h b/Source/core/rendering/svg/RenderSVGResourceContainer.h |
index 9489a6f8a2db7e93ba08436a8be96925b2ee0dc5..3965093b00889038116a7714f7edc08cb920944a 100644 |
--- a/Source/core/rendering/svg/RenderSVGResourceContainer.h |
+++ b/Source/core/rendering/svg/RenderSVGResourceContainer.h |
@@ -37,7 +37,6 @@ public: |
virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle) OVERRIDE FINAL; |
virtual bool isSVGResourceContainer() const OVERRIDE FINAL { return true; } |
- virtual RenderSVGResourceContainer* toRenderSVGResourceContainer() OVERRIDE FINAL { return this; } |
static bool shouldTransformOnTextPainting(RenderObject*, AffineTransform&); |
static AffineTransform transformOnNonScalingStroke(RenderObject*, const AffineTransform& resourceTransform); |
@@ -97,6 +96,21 @@ Renderer* getRenderSVGResourceById(Document& document, const AtomicString& id) |
return 0; |
} |
+inline RenderSVGResourceContainer* toRenderSVGResourceContainer(RenderObject* object) |
+{ |
+ ASSERT_WITH_SECURITY_IMPLICATION(!object || object->isSVGResourceContainer()); |
+ return static_cast<RenderSVGResourceContainer*>(object); |
+} |
+ |
+inline const RenderSVGResourceContainer* toRenderSVGResourceContainer(const RenderObject* object) |
+{ |
+ ASSERT_WITH_SECURITY_IMPLICATION(!object || object->isSVGResourceContainer()); |
+ return static_cast<const RenderSVGResourceContainer*>(object); |
+} |
+ |
+// This will catch anyone doing an unnecessary cast. |
+void toRenderSVGResourceContainer(const RenderSVGResourceContainer*); |
+ |
} |
#endif |