SVGResourcesCache::clientDestroyed() should take a RenderElement&.
authorakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 25 Oct 2013 14:42:22 +0000 (14:42 +0000)
committerakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 25 Oct 2013 14:42:22 +0000 (14:42 +0000)
<https://webkit.org/b/123339>

This function is always called with an object, and that object
is guaranteed to never be a text renderer.

Reviewed by Antti Koivisto.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@158011 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/rendering/svg/RenderSVGBlock.cpp
Source/WebCore/rendering/svg/RenderSVGInline.cpp
Source/WebCore/rendering/svg/RenderSVGModelObject.cpp
Source/WebCore/rendering/svg/RenderSVGRoot.cpp
Source/WebCore/rendering/svg/SVGResourcesCache.cpp
Source/WebCore/rendering/svg/SVGResourcesCache.h

index afde653..030c69d 100644 (file)
@@ -1,5 +1,15 @@
 2013-10-25  Andreas Kling  <akling@apple.com>
 
+        SVGResourcesCache::clientDestroyed() should take a RenderElement&.
+        <https://webkit.org/b/123339>
+
+        This function is always called with an object, and that object
+        is guaranteed to never be a text renderer.
+
+        Reviewed by Antti Koivisto.
+
+2013-10-25  Andreas Kling  <akling@apple.com>
+
         SVGResourcesCache::clientLayoutChanged() should take a RenderElement&.
         <https://webkit.org/b/123336>
 
index 4797cf3..6de3e81 100644 (file)
@@ -90,7 +90,7 @@ void RenderSVGBlock::absoluteRects(Vector<IntRect>&, const LayoutPoint&) const
 
 void RenderSVGBlock::willBeDestroyed()
 {
-    SVGResourcesCache::clientDestroyed(this);
+    SVGResourcesCache::clientDestroyed(*this);
     RenderBlockFlow::willBeDestroyed();
 }
 
index 62a667d..6c4a56a 100644 (file)
@@ -102,7 +102,7 @@ void RenderSVGInline::absoluteQuads(Vector<FloatQuad>& quads, bool* wasFixed) co
 
 void RenderSVGInline::willBeDestroyed()
 {
-    SVGResourcesCache::clientDestroyed(this);
+    SVGResourcesCache::clientDestroyed(*this);
     RenderInline::willBeDestroyed();
 }
 
index d082f17..ceb4958 100644 (file)
@@ -94,7 +94,7 @@ void RenderSVGModelObject::absoluteQuads(Vector<FloatQuad>& quads, bool* wasFixe
 
 void RenderSVGModelObject::willBeDestroyed()
 {
-    SVGResourcesCache::clientDestroyed(this);
+    SVGResourcesCache::clientDestroyed(*this);
     RenderElement::willBeDestroyed();
 }
 
index 56b28f8..a5ece26 100644 (file)
@@ -309,7 +309,7 @@ void RenderSVGRoot::willBeDestroyed()
 {
     RenderBlock::removePercentHeightDescendant(const_cast<RenderSVGRoot&>(*this));
 
-    SVGResourcesCache::clientDestroyed(this);
+    SVGResourcesCache::clientDestroyed(*this);
     RenderReplaced::willBeDestroyed();
 }
 
index 1a20199..8c584de 100644 (file)
@@ -167,16 +167,14 @@ void SVGResourcesCache::clientWillBeRemovedFromTree(RenderObject* renderer)
     cache->removeResourcesFromRenderObject(renderer);
 }
 
-void SVGResourcesCache::clientDestroyed(RenderObject* renderer)
+void SVGResourcesCache::clientDestroyed(RenderElement& renderer)
 {
-    ASSERT(renderer);
-
-    SVGResources* resources = SVGResourcesCache::cachedResourcesForRenderObject(renderer);
+    SVGResources* resources = SVGResourcesCache::cachedResourcesForRenderObject(&renderer);
     if (resources)
-        resources->removeClientFromCache(renderer);
+        resources->removeClientFromCache(&renderer);
 
-    SVGResourcesCache* cache = resourcesCacheFromRenderObject(renderer);
-    cache->removeResourcesFromRenderObject(renderer);
+    SVGResourcesCache* cache = resourcesCacheFromRenderObject(&renderer);
+    cache->removeResourcesFromRenderObject(&renderer);
 }
 
 void SVGResourcesCache::resourceDestroyed(RenderSVGResourceContainer* resource)
index 3c2cf47..7180d41 100644 (file)
@@ -48,7 +48,7 @@ public:
     static void clientWillBeRemovedFromTree(RenderObject*);
 
     // Called from all SVG renderers destroy() methods - except for RenderSVGResourceContainer.
-    static void clientDestroyed(RenderObject*);
+    static void clientDestroyed(RenderElement&);
 
     // Called from all SVG renderers layout() methods.
     static void clientLayoutChanged(RenderElement&);