CTTE: Convert more of SVG to use references
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 16 Dec 2013 19:23:24 +0000 (19:23 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 16 Dec 2013 19:23:24 +0000 (19:23 +0000)
https://bugs.webkit.org/show_bug.cgi?id=125762

Patch by Sam Weinig <sam@webkit.org> on 2013-12-16
Reviewed by Darin Adler.

* rendering/svg/RenderSVGImage.cpp:
(WebCore::RenderSVGImage::imageChanged):
* rendering/svg/RenderSVGResource.cpp:
(WebCore::removeFromCacheAndInvalidateDependencies):
(WebCore::RenderSVGResource::markForLayoutAndParentResourceInvalidation):
* rendering/svg/RenderSVGResource.h:
* rendering/svg/RenderSVGResourceClipper.cpp:
(WebCore::RenderSVGResourceClipper::removeClientFromCache):
* rendering/svg/RenderSVGResourceClipper.h:
* rendering/svg/RenderSVGResourceContainer.cpp:
(WebCore::RenderSVGResourceContainer::markAllClientsForInvalidation):
(WebCore::RenderSVGResourceContainer::markAllClientLayersForInvalidation):
(WebCore::RenderSVGResourceContainer::markClientForInvalidation):
(WebCore::RenderSVGResourceContainer::removeClient):
* rendering/svg/RenderSVGResourceContainer.h:
* rendering/svg/RenderSVGResourceFilter.cpp:
(WebCore::RenderSVGResourceFilter::removeClientFromCache):
(WebCore::RenderSVGResourceFilter::postApplyResource):
(WebCore::RenderSVGResourceFilter::primitiveAttributeChanged):
* rendering/svg/RenderSVGResourceFilter.h:
* rendering/svg/RenderSVGResourceGradient.cpp:
(WebCore::RenderSVGResourceGradient::removeClientFromCache):
* rendering/svg/RenderSVGResourceGradient.h:
* rendering/svg/RenderSVGResourceMarker.cpp:
(WebCore::RenderSVGResourceMarker::removeClientFromCache):
* rendering/svg/RenderSVGResourceMarker.h:
* rendering/svg/RenderSVGResourceMasker.cpp:
(WebCore::RenderSVGResourceMasker::removeClientFromCache):
* rendering/svg/RenderSVGResourceMasker.h:
* rendering/svg/RenderSVGResourcePattern.cpp:
(WebCore::RenderSVGResourcePattern::removeClientFromCache):
* rendering/svg/RenderSVGResourcePattern.h:
* rendering/svg/RenderSVGResourceSolidColor.h:
(WebCore::RenderSVGResourceSolidColor::removeClientFromCache):
* rendering/svg/SVGRenderSupport.cpp:
(WebCore::invalidateResourcesOfChildren):
* rendering/svg/SVGResources.cpp:
(WebCore::SVGResources::removeClientFromCache):
* rendering/svg/SVGResources.h:
* rendering/svg/SVGResourcesCache.cpp:
(WebCore::SVGResourcesCache::clientLayoutChanged):
(WebCore::SVGResourcesCache::clientStyleChanged):
(WebCore::SVGResourcesCache::clientWasAddedToTree):
(WebCore::SVGResourcesCache::clientWillBeRemovedFromTree):
(WebCore::SVGResourcesCache::clientDestroyed):
* svg/SVGAnimateMotionElement.cpp:
(WebCore::SVGAnimateMotionElement::applyResultsToTarget):
* svg/SVGCircleElement.cpp:
(WebCore::SVGCircleElement::svgAttributeChanged):
* svg/SVGEllipseElement.cpp:
(WebCore::SVGEllipseElement::svgAttributeChanged):
* svg/SVGFEImageElement.cpp:
(WebCore::SVGFEImageElement::notifyFinished):
* svg/SVGFELightElement.cpp:
(WebCore::SVGFELightElement::childrenChanged):
* svg/SVGFilterPrimitiveStandardAttributes.cpp:
(WebCore::invalidateFilterPrimitiveParent):
* svg/SVGFilterPrimitiveStandardAttributes.h:
(WebCore::SVGFilterPrimitiveStandardAttributes::invalidate):
(WebCore::SVGFilterPrimitiveStandardAttributes::primitiveAttributeChanged):
* svg/SVGForeignObjectElement.cpp:
(WebCore::SVGForeignObjectElement::svgAttributeChanged):
* svg/SVGGElement.cpp:
(WebCore::SVGGElement::svgAttributeChanged):
* svg/SVGGraphicsElement.cpp:
(WebCore::SVGGraphicsElement::svgAttributeChanged):
* svg/SVGImageElement.cpp:
(WebCore::SVGImageElement::svgAttributeChanged):
* svg/SVGLineElement.cpp:
(WebCore::SVGLineElement::svgAttributeChanged):
* svg/SVGPathElement.cpp:
(WebCore::SVGPathElement::svgAttributeChanged):
(WebCore::SVGPathElement::invalidateMPathDependencies):
(WebCore::SVGPathElement::pathSegListChanged):
* svg/SVGPolyElement.cpp:
(WebCore::SVGPolyElement::svgAttributeChanged):
* svg/SVGRectElement.cpp:
(WebCore::SVGRectElement::svgAttributeChanged):
* svg/SVGSVGElement.cpp:
(WebCore::SVGSVGElement::svgAttributeChanged):
(WebCore::SVGSVGElement::setupInitialView):
* svg/SVGStopElement.cpp:
(WebCore::SVGStopElement::svgAttributeChanged):
* svg/SVGTRefElement.cpp:
(WebCore::SVGTRefElement::svgAttributeChanged):
* svg/SVGTextContentElement.cpp:
(WebCore::SVGTextContentElement::svgAttributeChanged):
* svg/SVGTextPathElement.cpp:
(WebCore::SVGTextPathElement::svgAttributeChanged):
* svg/SVGTextPositioningElement.cpp:
(WebCore::SVGTextPositioningElement::svgAttributeChanged):
* svg/SVGUseElement.cpp:
(WebCore::SVGUseElement::svgAttributeChanged):

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

45 files changed:
Source/WebCore/ChangeLog
Source/WebCore/rendering/svg/RenderSVGImage.cpp
Source/WebCore/rendering/svg/RenderSVGResource.cpp
Source/WebCore/rendering/svg/RenderSVGResource.h
Source/WebCore/rendering/svg/RenderSVGResourceClipper.cpp
Source/WebCore/rendering/svg/RenderSVGResourceClipper.h
Source/WebCore/rendering/svg/RenderSVGResourceContainer.cpp
Source/WebCore/rendering/svg/RenderSVGResourceContainer.h
Source/WebCore/rendering/svg/RenderSVGResourceFilter.cpp
Source/WebCore/rendering/svg/RenderSVGResourceFilter.h
Source/WebCore/rendering/svg/RenderSVGResourceGradient.cpp
Source/WebCore/rendering/svg/RenderSVGResourceGradient.h
Source/WebCore/rendering/svg/RenderSVGResourceMarker.cpp
Source/WebCore/rendering/svg/RenderSVGResourceMarker.h
Source/WebCore/rendering/svg/RenderSVGResourceMasker.cpp
Source/WebCore/rendering/svg/RenderSVGResourceMasker.h
Source/WebCore/rendering/svg/RenderSVGResourcePattern.cpp
Source/WebCore/rendering/svg/RenderSVGResourcePattern.h
Source/WebCore/rendering/svg/RenderSVGResourceSolidColor.h
Source/WebCore/rendering/svg/SVGRenderSupport.cpp
Source/WebCore/rendering/svg/SVGResources.cpp
Source/WebCore/rendering/svg/SVGResources.h
Source/WebCore/rendering/svg/SVGResourcesCache.cpp
Source/WebCore/svg/SVGAnimateMotionElement.cpp
Source/WebCore/svg/SVGCircleElement.cpp
Source/WebCore/svg/SVGEllipseElement.cpp
Source/WebCore/svg/SVGFEImageElement.cpp
Source/WebCore/svg/SVGFELightElement.cpp
Source/WebCore/svg/SVGFilterPrimitiveStandardAttributes.cpp
Source/WebCore/svg/SVGFilterPrimitiveStandardAttributes.h
Source/WebCore/svg/SVGForeignObjectElement.cpp
Source/WebCore/svg/SVGGElement.cpp
Source/WebCore/svg/SVGGraphicsElement.cpp
Source/WebCore/svg/SVGImageElement.cpp
Source/WebCore/svg/SVGLineElement.cpp
Source/WebCore/svg/SVGPathElement.cpp
Source/WebCore/svg/SVGPolyElement.cpp
Source/WebCore/svg/SVGRectElement.cpp
Source/WebCore/svg/SVGSVGElement.cpp
Source/WebCore/svg/SVGStopElement.cpp
Source/WebCore/svg/SVGTRefElement.cpp
Source/WebCore/svg/SVGTextContentElement.cpp
Source/WebCore/svg/SVGTextPathElement.cpp
Source/WebCore/svg/SVGTextPositioningElement.cpp
Source/WebCore/svg/SVGUseElement.cpp

index 29192e1..8aa75c4 100644 (file)
@@ -1,3 +1,104 @@
+2013-12-16  Sam Weinig  <sam@webkit.org>
+
+        CTTE: Convert more of SVG to use references
+        https://bugs.webkit.org/show_bug.cgi?id=125762
+
+        Reviewed by Darin Adler.
+
+        * rendering/svg/RenderSVGImage.cpp:
+        (WebCore::RenderSVGImage::imageChanged):
+        * rendering/svg/RenderSVGResource.cpp:
+        (WebCore::removeFromCacheAndInvalidateDependencies):
+        (WebCore::RenderSVGResource::markForLayoutAndParentResourceInvalidation):
+        * rendering/svg/RenderSVGResource.h:
+        * rendering/svg/RenderSVGResourceClipper.cpp:
+        (WebCore::RenderSVGResourceClipper::removeClientFromCache):
+        * rendering/svg/RenderSVGResourceClipper.h:
+        * rendering/svg/RenderSVGResourceContainer.cpp:
+        (WebCore::RenderSVGResourceContainer::markAllClientsForInvalidation):
+        (WebCore::RenderSVGResourceContainer::markAllClientLayersForInvalidation):
+        (WebCore::RenderSVGResourceContainer::markClientForInvalidation):
+        (WebCore::RenderSVGResourceContainer::removeClient):
+        * rendering/svg/RenderSVGResourceContainer.h:
+        * rendering/svg/RenderSVGResourceFilter.cpp:
+        (WebCore::RenderSVGResourceFilter::removeClientFromCache):
+        (WebCore::RenderSVGResourceFilter::postApplyResource):
+        (WebCore::RenderSVGResourceFilter::primitiveAttributeChanged):
+        * rendering/svg/RenderSVGResourceFilter.h:
+        * rendering/svg/RenderSVGResourceGradient.cpp:
+        (WebCore::RenderSVGResourceGradient::removeClientFromCache):
+        * rendering/svg/RenderSVGResourceGradient.h:
+        * rendering/svg/RenderSVGResourceMarker.cpp:
+        (WebCore::RenderSVGResourceMarker::removeClientFromCache):
+        * rendering/svg/RenderSVGResourceMarker.h:
+        * rendering/svg/RenderSVGResourceMasker.cpp:
+        (WebCore::RenderSVGResourceMasker::removeClientFromCache):
+        * rendering/svg/RenderSVGResourceMasker.h:
+        * rendering/svg/RenderSVGResourcePattern.cpp:
+        (WebCore::RenderSVGResourcePattern::removeClientFromCache):
+        * rendering/svg/RenderSVGResourcePattern.h:
+        * rendering/svg/RenderSVGResourceSolidColor.h:
+        (WebCore::RenderSVGResourceSolidColor::removeClientFromCache):
+        * rendering/svg/SVGRenderSupport.cpp:
+        (WebCore::invalidateResourcesOfChildren):
+        * rendering/svg/SVGResources.cpp:
+        (WebCore::SVGResources::removeClientFromCache):
+        * rendering/svg/SVGResources.h:
+        * rendering/svg/SVGResourcesCache.cpp:
+        (WebCore::SVGResourcesCache::clientLayoutChanged):
+        (WebCore::SVGResourcesCache::clientStyleChanged):
+        (WebCore::SVGResourcesCache::clientWasAddedToTree):
+        (WebCore::SVGResourcesCache::clientWillBeRemovedFromTree):
+        (WebCore::SVGResourcesCache::clientDestroyed):
+        * svg/SVGAnimateMotionElement.cpp:
+        (WebCore::SVGAnimateMotionElement::applyResultsToTarget):
+        * svg/SVGCircleElement.cpp:
+        (WebCore::SVGCircleElement::svgAttributeChanged):
+        * svg/SVGEllipseElement.cpp:
+        (WebCore::SVGEllipseElement::svgAttributeChanged):
+        * svg/SVGFEImageElement.cpp:
+        (WebCore::SVGFEImageElement::notifyFinished):
+        * svg/SVGFELightElement.cpp:
+        (WebCore::SVGFELightElement::childrenChanged):
+        * svg/SVGFilterPrimitiveStandardAttributes.cpp:
+        (WebCore::invalidateFilterPrimitiveParent):
+        * svg/SVGFilterPrimitiveStandardAttributes.h:
+        (WebCore::SVGFilterPrimitiveStandardAttributes::invalidate):
+        (WebCore::SVGFilterPrimitiveStandardAttributes::primitiveAttributeChanged):
+        * svg/SVGForeignObjectElement.cpp:
+        (WebCore::SVGForeignObjectElement::svgAttributeChanged):
+        * svg/SVGGElement.cpp:
+        (WebCore::SVGGElement::svgAttributeChanged):
+        * svg/SVGGraphicsElement.cpp:
+        (WebCore::SVGGraphicsElement::svgAttributeChanged):
+        * svg/SVGImageElement.cpp:
+        (WebCore::SVGImageElement::svgAttributeChanged):
+        * svg/SVGLineElement.cpp:
+        (WebCore::SVGLineElement::svgAttributeChanged):
+        * svg/SVGPathElement.cpp:
+        (WebCore::SVGPathElement::svgAttributeChanged):
+        (WebCore::SVGPathElement::invalidateMPathDependencies):
+        (WebCore::SVGPathElement::pathSegListChanged):
+        * svg/SVGPolyElement.cpp:
+        (WebCore::SVGPolyElement::svgAttributeChanged):
+        * svg/SVGRectElement.cpp:
+        (WebCore::SVGRectElement::svgAttributeChanged):
+        * svg/SVGSVGElement.cpp:
+        (WebCore::SVGSVGElement::svgAttributeChanged):
+        (WebCore::SVGSVGElement::setupInitialView):
+        * svg/SVGStopElement.cpp:
+        (WebCore::SVGStopElement::svgAttributeChanged):
+        * svg/SVGTRefElement.cpp:
+        (WebCore::SVGTRefElement::svgAttributeChanged):
+        * svg/SVGTextContentElement.cpp:
+        (WebCore::SVGTextContentElement::svgAttributeChanged):
+        * svg/SVGTextPathElement.cpp:
+        (WebCore::SVGTextPathElement::svgAttributeChanged):
+        * svg/SVGTextPositioningElement.cpp:
+        (WebCore::SVGTextPositioningElement::svgAttributeChanged):
+        * svg/SVGUseElement.cpp:
+        (WebCore::SVGUseElement::svgAttributeChanged):
+
 2013-12-16  Hans Muller  <hmuller@adobe.com>
 
         [CSS Shapes] Add support for the computing the included intervals for a BoxShape
index c4ea14a..e277d04 100644 (file)
@@ -195,10 +195,10 @@ void RenderSVGImage::imageChanged(WrappedImagePtr, const IntRect*)
     // The image resource defaults to nullImage until the resource arrives.
     // This empty image may be cached by SVG resources which must be invalidated.
     if (SVGResources* resources = SVGResourcesCache::cachedResourcesForRenderObject(*this))
-        resources->removeClientFromCache(this);
+        resources->removeClientFromCache(*this);
 
     // Eventually notify parent resources, that we've changed.
-    RenderSVGResource::markForLayoutAndParentResourceInvalidation(this, false);
+    RenderSVGResource::markForLayoutAndParentResourceInvalidation(*this, false);
 
     // Update the SVGImageCache sizeAndScales entry in case image loading finished after layout.
     // (https://bugs.webkit.org/show_bug.cgi?id=99489)
index 408f481..12b9f42 100644 (file)
@@ -161,13 +161,13 @@ static inline void removeFromCacheAndInvalidateDependencies(RenderObject& object
     if (SVGResources* resources = SVGResourcesCache::cachedResourcesForRenderObject(object)) {
 #if ENABLE(FILTERS)
         if (RenderSVGResourceFilter* filter = resources->filter())
-            filter->removeClientFromCache(&object);
+            filter->removeClientFromCache(object);
 #endif
         if (RenderSVGResourceMasker* masker = resources->masker())
-            masker->removeClientFromCache(&object);
+            masker->removeClientFromCache(object);
 
         if (RenderSVGResourceClipper* clipper = resources->clipper())
-            clipper->removeClientFromCache(&object);
+            clipper->removeClientFromCache(object);
     }
 
     if (!object.node() || !object.node()->isSVGElement())
@@ -176,23 +176,22 @@ static inline void removeFromCacheAndInvalidateDependencies(RenderObject& object
     if (!dependencies)
         return;
     for (auto element : *dependencies) {
-        if (RenderObject* renderer = element->renderer())
-            RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer, needsLayout);
+        if (auto renderer = element->renderer())
+            RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer, needsLayout);
     }
 }
 
-void RenderSVGResource::markForLayoutAndParentResourceInvalidation(RenderObject* object, bool needsLayout)
+void RenderSVGResource::markForLayoutAndParentResourceInvalidation(RenderObject& object, bool needsLayout)
 {
-    ASSERT(object);
-    ASSERT(object->node());
+    ASSERT(object.node());
 
-    if (needsLayout && !object->documentBeingDestroyed())
-        object->setNeedsLayout();
+    if (needsLayout && !object.documentBeingDestroyed())
+        object.setNeedsLayout();
 
-    removeFromCacheAndInvalidateDependencies(*object, needsLayout);
+    removeFromCacheAndInvalidateDependencies(object, needsLayout);
 
     // Invalidate resources in ancestor chain, if needed.
-    RenderObject* current = object->parent();
+    RenderObject* current = object.parent();
     while (current) {
         removeFromCacheAndInvalidateDependencies(*current, needsLayout);
 
index fae3af2..2c66ffa 100644 (file)
@@ -60,7 +60,7 @@ public:
     virtual ~RenderSVGResource() { }
 
     virtual void removeAllClientsFromCache(bool markForInvalidation = true) = 0;
-    virtual void removeClientFromCache(RenderObject*, bool markForInvalidation = true) = 0;
+    virtual void removeClientFromCache(RenderObject&, bool markForInvalidation = true) = 0;
 
     virtual bool applyResource(RenderElement&, const RenderStyle&, GraphicsContext*&, unsigned short resourceMode) = 0;
     virtual void postApplyResource(RenderElement&, GraphicsContext*&, unsigned short, const Path*, const RenderSVGShape*) { }
@@ -82,7 +82,7 @@ public:
     static RenderSVGResource* strokePaintingResource(RenderElement&, const RenderStyle&, Color& fallbackColor);
     static RenderSVGResourceSolidColor* sharedSolidPaintingResource();
 
-    static void markForLayoutAndParentResourceInvalidation(RenderObject*, bool needsLayout = true);
+    static void markForLayoutAndParentResourceInvalidation(RenderObject&, bool needsLayout = true);
 };
 
 }
index 936ad79..4d34935 100644 (file)
@@ -71,10 +71,9 @@ void RenderSVGResourceClipper::removeAllClientsFromCache(bool markForInvalidatio
     markAllClientsForInvalidation(markForInvalidation ? LayoutAndBoundariesInvalidation : ParentOnlyInvalidation);
 }
 
-void RenderSVGResourceClipper::removeClientFromCache(RenderObject* client, bool markForInvalidation)
+void RenderSVGResourceClipper::removeClientFromCache(RenderObject& client, bool markForInvalidation)
 {
-    ASSERT(client);
-    m_clipper.remove(client);
+    m_clipper.remove(&client);
 
     markClientForInvalidation(client, markForInvalidation ? BoundariesInvalidation : ParentOnlyInvalidation);
 }
index 5c9426a..5a35487 100644 (file)
@@ -48,7 +48,7 @@ public:
     SVGClipPathElement& clipPathElement() const { return toSVGClipPathElement(nodeForNonAnonymous()); }
 
     virtual void removeAllClientsFromCache(bool markForInvalidation = true);
-    virtual void removeClientFromCache(RenderObject*, bool markForInvalidation = true);
+    virtual void removeClientFromCache(RenderObject&, bool markForInvalidation = true);
 
     virtual bool applyResource(RenderElement&, const RenderStyle&, GraphicsContext*&, unsigned short resourceMode) OVERRIDE;
     // clipPath can be clipped too, but don't have a boundingBox or repaintRect. So we can't call
index 99c5e1a..be7a1f2 100644 (file)
@@ -99,18 +99,16 @@ void RenderSVGResourceContainer::markAllClientsForInvalidation(InvalidationMode
     bool needsLayout = mode == LayoutAndBoundariesInvalidation;
     bool markForInvalidation = mode != ParentOnlyInvalidation;
 
-    HashSet<RenderObject*>::iterator end = m_clients.end();
-    for (HashSet<RenderObject*>::iterator it = m_clients.begin(); it != end; ++it) {
-        RenderObject* client = *it;
+    for (auto client : m_clients) {
         if (client->isSVGResourceContainer()) {
             client->toRenderSVGResourceContainer()->removeAllClientsFromCache(markForInvalidation);
             continue;
         }
 
         if (markForInvalidation)
-            markClientForInvalidation(client, mode);
+            markClientForInvalidation(*client, mode);
 
-        RenderSVGResource::markForLayoutAndParentResourceInvalidation(client, needsLayout);
+        RenderSVGResource::markForLayoutAndParentResourceInvalidation(*client, needsLayout);
     }
 
     markAllClientLayersForInvalidation();
@@ -121,25 +119,23 @@ void RenderSVGResourceContainer::markAllClientsForInvalidation(InvalidationMode
 void RenderSVGResourceContainer::markAllClientLayersForInvalidation()
 {
 #if ENABLE(CSS_FILTERS)
-    HashSet<RenderLayer*>::iterator layerEnd = m_clientLayers.end();
-    for (HashSet<RenderLayer*>::iterator it = m_clientLayers.begin(); it != layerEnd; ++it)
-        (*it)->filterNeedsRepaint();
+    for (auto clientLayer : m_clientLayers)
+        clientLayer->filterNeedsRepaint();
 #endif
 }
 
-void RenderSVGResourceContainer::markClientForInvalidation(RenderObject* client, InvalidationMode mode)
+void RenderSVGResourceContainer::markClientForInvalidation(RenderObject& client, InvalidationMode mode)
 {
-    ASSERT(client);
     ASSERT(!m_clients.isEmpty());
 
     switch (mode) {
     case LayoutAndBoundariesInvalidation:
     case BoundariesInvalidation:
-        client->setNeedsBoundariesUpdate();
+        client.setNeedsBoundariesUpdate();
         break;
     case RepaintInvalidation:
-        if (!client->documentBeingDestroyed())
-            client->repaint();
+        if (!client.documentBeingDestroyed())
+            client.repaint();
         break;
     case ParentOnlyInvalidation:
         break;
@@ -155,7 +151,7 @@ void RenderSVGResourceContainer::addClient(RenderObject* client)
 void RenderSVGResourceContainer::removeClient(RenderObject* client)
 {
     ASSERT(client);
-    removeClientFromCache(client, false);
+    removeClientFromCache(*client, false);
     m_clients.remove(client);
 }
 
index 1ad0561..0ddac6d 100644 (file)
@@ -59,7 +59,7 @@ protected:
     // Used from the invalidateClient/invalidateClients methods from classes, inheriting from us.
     void markAllClientsForInvalidation(InvalidationMode);
     void markAllClientLayersForInvalidation();
-    void markClientForInvalidation(RenderObject*, InvalidationMode);
+    void markClientForInvalidation(RenderObject&, InvalidationMode);
 
 private:
     friend class SVGResourcesCache;
index 0493745..d6d0bba 100644 (file)
@@ -73,15 +73,13 @@ void RenderSVGResourceFilter::removeAllClientsFromCache(bool markForInvalidation
     markAllClientsForInvalidation(markForInvalidation ? LayoutAndBoundariesInvalidation : ParentOnlyInvalidation);
 }
 
-void RenderSVGResourceFilter::removeClientFromCache(RenderObject* client, bool markForInvalidation)
+void RenderSVGResourceFilter::removeClientFromCache(RenderObject& client, bool markForInvalidation)
 {
-    ASSERT(client);
-
-    if (FilterData* filterData = m_filter.get(client)) {
+    if (FilterData* filterData = m_filter.get(&client)) {
         if (filterData->savedContext)
             filterData->state = FilterData::MarkedForRemoval;
         else
-            m_filter.remove(client);
+            m_filter.remove(&client);
     }
 
     markClientForInvalidation(client, markForInvalidation ? BoundariesInvalidation : ParentOnlyInvalidation);
@@ -263,7 +261,7 @@ void RenderSVGResourceFilter::postApplyResource(RenderElement& renderer, Graphic
 
     case FilterData::PaintingSource:
         if (!filterData->savedContext) {
-            removeClientFromCache(&renderer);
+            removeClientFromCache(renderer);
             return;
         }
 
@@ -315,8 +313,8 @@ void RenderSVGResourceFilter::primitiveAttributeChanged(RenderObject* object, co
 {
     SVGFilterPrimitiveStandardAttributes* primitve = static_cast<SVGFilterPrimitiveStandardAttributes*>(object->node());
 
-    for (auto it = m_filter.begin(), end = m_filter.end(); it != end; ++it) {
-        const auto &filterData = it->value;
+    for (const auto& objectFilterDataPair : m_filter) {
+        const auto& filterData = objectFilterDataPair.value;
         if (filterData->state != FilterData::Built)
             continue;
 
@@ -331,7 +329,7 @@ void RenderSVGResourceFilter::primitiveAttributeChanged(RenderObject* object, co
         builder->clearResultsRecursive(effect);
 
         // Repaint the image on the screen.
-        markClientForInvalidation(it->key, RepaintInvalidation);
+        markClientForInvalidation(*objectFilterDataPair.key, RepaintInvalidation);
     }
     markAllClientLayersForInvalidation();
 }
index fed4878..89b54ea 100644 (file)
@@ -70,7 +70,7 @@ public:
     SVGFilterElement& filterElement() const { return toSVGFilterElement(RenderSVGResourceContainer::element()); }
 
     virtual void removeAllClientsFromCache(bool markForInvalidation = true);
-    virtual void removeClientFromCache(RenderObject*, bool markForInvalidation = true);
+    virtual void removeClientFromCache(RenderObject&, bool markForInvalidation = true);
 
     virtual bool applyResource(RenderElement&, const RenderStyle&, GraphicsContext*&, unsigned short resourceMode) OVERRIDE;
     virtual void postApplyResource(RenderElement&, GraphicsContext*&, unsigned short resourceMode, const Path*, const RenderSVGShape*) OVERRIDE;
index 7188e65..e6b4e3c 100644 (file)
@@ -50,10 +50,9 @@ void RenderSVGResourceGradient::removeAllClientsFromCache(bool markForInvalidati
     markAllClientsForInvalidation(markForInvalidation ? RepaintInvalidation : ParentOnlyInvalidation);
 }
 
-void RenderSVGResourceGradient::removeClientFromCache(RenderObject* client, bool markForInvalidation)
+void RenderSVGResourceGradient::removeClientFromCache(RenderObject& client, bool markForInvalidation)
 {
-    ASSERT(client);
-    m_gradientMap.remove(client);
+    m_gradientMap.remove(&client);
     markClientForInvalidation(client, markForInvalidation ? RepaintInvalidation : ParentOnlyInvalidation);
 }
 
index 4bf9d09..8c5a339 100644 (file)
@@ -48,7 +48,7 @@ public:
     SVGGradientElement& gradientElement() const { return static_cast<SVGGradientElement&>(RenderSVGResourceContainer::element()); }
 
     virtual void removeAllClientsFromCache(bool markForInvalidation = true) OVERRIDE FINAL;
-    virtual void removeClientFromCache(RenderObject*, bool markForInvalidation = true) OVERRIDE FINAL;
+    virtual void removeClientFromCache(RenderObject&, bool markForInvalidation = true) OVERRIDE FINAL;
 
     virtual bool applyResource(RenderElement&, const RenderStyle&, GraphicsContext*&, unsigned short resourceMode) OVERRIDE FINAL;
     virtual void postApplyResource(RenderElement&, GraphicsContext*&, unsigned short resourceMode, const Path*, const RenderSVGShape*) OVERRIDE FINAL;
index 50d4c17..bdd0bdb 100644 (file)
@@ -64,9 +64,8 @@ void RenderSVGResourceMarker::removeAllClientsFromCache(bool markForInvalidation
     markAllClientsForInvalidation(markForInvalidation ? LayoutAndBoundariesInvalidation : ParentOnlyInvalidation);
 }
 
-void RenderSVGResourceMarker::removeClientFromCache(RenderObject* client, bool markForInvalidation)
+void RenderSVGResourceMarker::removeClientFromCache(RenderObject& client, bool markForInvalidation)
 {
-    ASSERT(client);
     markClientForInvalidation(client, markForInvalidation ? BoundariesInvalidation : ParentOnlyInvalidation);
 }
 
index 1e0a93e..512c029 100644 (file)
@@ -41,7 +41,7 @@ public:
     SVGMarkerElement& markerElement() const { return toSVGMarkerElement(RenderSVGResourceContainer::element()); }
 
     virtual void removeAllClientsFromCache(bool markForInvalidation = true);
-    virtual void removeClientFromCache(RenderObject*, bool markForInvalidation = true);
+    virtual void removeClientFromCache(RenderObject&, bool markForInvalidation = true);
 
     void draw(PaintInfo&, const AffineTransform&);
 
index 0c5a298..a27ff1d 100644 (file)
@@ -59,10 +59,9 @@ void RenderSVGResourceMasker::removeAllClientsFromCache(bool markForInvalidation
     markAllClientsForInvalidation(markForInvalidation ? LayoutAndBoundariesInvalidation : ParentOnlyInvalidation);
 }
 
-void RenderSVGResourceMasker::removeClientFromCache(RenderObject* client, bool markForInvalidation)
+void RenderSVGResourceMasker::removeClientFromCache(RenderObject& client, bool markForInvalidation)
 {
-    ASSERT(client);
-    m_masker.remove(client);
+    m_masker.remove(&client);
 
     markClientForInvalidation(client, markForInvalidation ? BoundariesInvalidation : ParentOnlyInvalidation);
 }
index 52b1557..71d4c6a 100644 (file)
@@ -45,7 +45,7 @@ public:
     SVGMaskElement& maskElement() const { return toSVGMaskElement(RenderSVGResourceContainer::element()); }
 
     virtual void removeAllClientsFromCache(bool markForInvalidation = true);
-    virtual void removeClientFromCache(RenderObject*, bool markForInvalidation = true);
+    virtual void removeClientFromCache(RenderObject&, bool markForInvalidation = true);
     virtual bool applyResource(RenderElement&, const RenderStyle&, GraphicsContext*&, unsigned short resourceMode) OVERRIDE;
     virtual FloatRect resourceBoundingBox(const RenderObject&) OVERRIDE;
 
index 3025a75..5b46a68 100644 (file)
@@ -54,10 +54,9 @@ void RenderSVGResourcePattern::removeAllClientsFromCache(bool markForInvalidatio
     markAllClientsForInvalidation(markForInvalidation ? RepaintInvalidation : ParentOnlyInvalidation);
 }
 
-void RenderSVGResourcePattern::removeClientFromCache(RenderObject* client, bool markForInvalidation)
+void RenderSVGResourcePattern::removeClientFromCache(RenderObject& client, bool markForInvalidation)
 {
-    ASSERT(client);
-    m_patternMap.remove(client);
+    m_patternMap.remove(&client);
     markClientForInvalidation(client, markForInvalidation ? RepaintInvalidation : ParentOnlyInvalidation);
 }
 
index b890d22..6bd89a8 100644 (file)
@@ -49,7 +49,7 @@ public:
     SVGPatternElement& patternElement() const;
 
     virtual void removeAllClientsFromCache(bool markForInvalidation = true);
-    virtual void removeClientFromCache(RenderObject*, bool markForInvalidation = true);
+    virtual void removeClientFromCache(RenderObject&, bool markForInvalidation = true);
 
     virtual bool applyResource(RenderElement&, const RenderStyle&, GraphicsContext*&, unsigned short resourceMode) OVERRIDE;
     virtual void postApplyResource(RenderElement&, GraphicsContext*&, unsigned short resourceMode, const Path*, const RenderSVGShape*) OVERRIDE;
index 904ff94..14b320c 100644 (file)
@@ -33,7 +33,7 @@ public:
     virtual ~RenderSVGResourceSolidColor();
 
     virtual void removeAllClientsFromCache(bool = true) { }
-    virtual void removeClientFromCache(RenderObject*, bool = true) { }
+    virtual void removeClientFromCache(RenderObject&, bool = true) { }
 
     virtual bool applyResource(RenderElement&, const RenderStyle&, GraphicsContext*&, unsigned short resourceMode) OVERRIDE;
     virtual void postApplyResource(RenderElement&, GraphicsContext*&, unsigned short resourceMode, const Path*, const RenderSVGShape*) OVERRIDE;
index a6e8868..1d3f471 100644 (file)
@@ -194,7 +194,7 @@ static inline void invalidateResourcesOfChildren(RenderObject& start)
 {
     ASSERT(!start.needsLayout());
     if (SVGResources* resources = SVGResourcesCache::cachedResourcesForRenderObject(start))
-        resources->removeClientFromCache(&start, false);
+        resources->removeClientFromCache(start, false);
 
     for (RenderObject* child = start.firstChildSlow(); child; child = child->nextSibling())
         invalidateResourcesOfChildren(*child);
index 9c45050..1b964f7 100644 (file)
@@ -280,7 +280,7 @@ bool SVGResources::buildCachedResources(const RenderElement& renderer, const SVG
     return foundResources;
 }
 
-void SVGResources::removeClientFromCache(RenderObject* object, bool markForInvalidation) const
+void SVGResources::removeClientFromCache(RenderObject& object, bool markForInvalidation) const
 {
     if (!m_clipperFilterMaskerData && !m_markerData && !m_fillStrokeData && !m_linkedResource)
         return;
index 0da50d2..240276a 100644 (file)
@@ -72,7 +72,7 @@ public:
     void buildSetOfResources(HashSet<RenderSVGResourceContainer*>&);
 
     // Methods operating on all cached resources
-    void removeClientFromCache(RenderObject*, bool markForInvalidation = true) const;
+    void removeClientFromCache(RenderObject&, bool markForInvalidation = true) const;
     void resourceDestroyed(RenderSVGResourceContainer&);
 
 #ifndef NDEBUG
index 8f2f864..b6d7fa7 100644 (file)
@@ -103,7 +103,7 @@ void SVGResourcesCache::clientLayoutChanged(RenderElement& renderer)
     // Invalidate the resources if either the RenderElement itself changed,
     // or we have filter resources, which could depend on the layout of children.
     if (renderer.selfNeedsLayout())
-        resources->removeClientFromCache(&renderer);
+        resources->removeClientFromCache(renderer);
 }
 
 static inline bool rendererCanHaveResources(RenderObject& renderer)
@@ -129,7 +129,7 @@ void SVGResourcesCache::clientStyleChanged(RenderElement& renderer, StyleDiffere
         cache->addResourcesFromRenderer(renderer, newStyle);
     }
 
-    RenderSVGResource::markForLayoutAndParentResourceInvalidation(&renderer, false);
+    RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer, false);
 
     if (renderer.element() && !renderer.element()->isSVGElement())
         renderer.element()->setNeedsStyleRecalc(SyntheticStyleChange);
@@ -140,7 +140,7 @@ void SVGResourcesCache::clientWasAddedToTree(RenderObject& renderer)
     if (renderer.isAnonymous())
         return;
 
-    RenderSVGResource::markForLayoutAndParentResourceInvalidation(&renderer, false);
+    RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer, false);
 
     if (!rendererCanHaveResources(renderer))
         return;
@@ -154,7 +154,7 @@ void SVGResourcesCache::clientWillBeRemovedFromTree(RenderObject& renderer)
     if (renderer.isAnonymous())
         return;
 
-    RenderSVGResource::markForLayoutAndParentResourceInvalidation(&renderer, false);
+    RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer, false);
 
     if (!rendererCanHaveResources(renderer))
         return;
@@ -167,7 +167,7 @@ void SVGResourcesCache::clientDestroyed(RenderElement& renderer)
 {
     SVGResources* resources = SVGResourcesCache::cachedResourcesForRenderObject(renderer);
     if (resources)
-        resources->removeClientFromCache(&renderer);
+        resources->removeClientFromCache(renderer);
 
     SVGResourcesCache* cache = resourcesCacheFromRenderObject(renderer);
     cache->removeResourcesFromRenderer(renderer);
index 474faa9..d0d0b99 100644 (file)
@@ -289,26 +289,24 @@ void SVGAnimateMotionElement::applyResultsToTarget()
     if (!targetElement)
         return;
 
-    if (RenderObject* renderer = targetElement->renderer())
-        RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer);
+    if (RenderElement* renderer = targetElement->renderer())
+        RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer);
 
     AffineTransform* t = targetElement->supplementalTransform();
     if (!t)
         return;
 
     // ...except in case where we have additional instances in <use> trees.
-    const HashSet<SVGElementInstance*>& instances = targetElement->instancesForElement();
-    const HashSet<SVGElementInstance*>::const_iterator end = instances.end();
-    for (HashSet<SVGElementInstance*>::const_iterator it = instances.begin(); it != end; ++it) {
-        SVGElement* shadowTreeElement = (*it)->shadowTreeElement();
+    for (auto instance : targetElement->instancesForElement()) {
+        SVGElement* shadowTreeElement = instance->shadowTreeElement();
         ASSERT(shadowTreeElement);
         AffineTransform* transform = shadowTreeElement->supplementalTransform();
         if (!transform)
             continue;
         transform->setMatrix(t->a(), t->b(), t->c(), t->d(), t->e(), t->f());
-        if (RenderObject* renderer = shadowTreeElement->renderer()) {
+        if (RenderElement* renderer = shadowTreeElement->renderer()) {
             renderer->setNeedsTransformUpdate();
-            RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer);
+            RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer);
         }
     }
 }
index f6c790c..9c2d81f 100644 (file)
@@ -120,12 +120,12 @@ void SVGCircleElement::svgAttributeChanged(const QualifiedName& attrName)
 
     if (isLengthAttribute) {
         renderer->setNeedsShapeUpdate();
-        RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer);
+        RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer);
         return;
     }
 
     if (SVGLangSpace::isKnownAttribute(attrName) || SVGExternalResourcesRequired::isKnownAttribute(attrName)) {
-        RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer);
+        RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer);
         return;
     }
 
index 667824f..a8e7bee 100644 (file)
@@ -125,12 +125,12 @@ void SVGEllipseElement::svgAttributeChanged(const QualifiedName& attrName)
 
     if (isLengthAttribute) {
         renderer->setNeedsShapeUpdate();
-        RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer);
+        RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer);
         return;
     }
 
     if (SVGLangSpace::isKnownAttribute(attrName) || SVGExternalResourcesRequired::isKnownAttribute(attrName)) {
-        RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer);
+        RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer);
         return;
     }
 
index 3b7bc11..2078fe5 100644 (file)
@@ -196,10 +196,14 @@ void SVGFEImageElement::notifyFinished(CachedResource*)
     Element* parent = parentElement();
     ASSERT(parent);
 
-    if (!parent->hasTagName(SVGNames::filterTag) || !parent->renderer())
+    if (!parent->hasTagName(SVGNames::filterTag))
         return;
 
-    RenderSVGResource::markForLayoutAndParentResourceInvalidation(parent->renderer());
+    RenderElement* parentRenderer = parent->renderer();
+    if (!parentRenderer)
+        return;
+
+    RenderSVGResource::markForLayoutAndParentResourceInvalidation(*parentRenderer);
 }
 
 PassRefPtr<FilterEffect> SVGFEImageElement::build(SVGFilterBuilder*, Filter* filter)
index 31b2989..dc56f36 100644 (file)
@@ -214,9 +214,9 @@ void SVGFELightElement::childrenChanged(const ChildChange& change)
     ContainerNode* parent = parentNode();
     if (!parent)
         return;
-    RenderObject* renderer = parent->renderer();
+    RenderElement* renderer = parent->renderer();
     if (renderer && renderer->isSVGResourceFilterPrimitive())
-        RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer);
+        RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer);
 }
 
 }
index d3039f1..19f8227 100644 (file)
@@ -165,11 +165,11 @@ void invalidateFilterPrimitiveParent(SVGElement* element)
     if (!parent)
         return;
 
-    RenderObject* renderer = parent->renderer();
+    RenderElement* renderer = parent->renderer();
     if (!renderer || !renderer->isSVGResourceFilterPrimitive())
         return;
 
-    RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer, false);
+    RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer, false);
 }
 
 }
index 1da30cd..6c46362 100644 (file)
@@ -55,13 +55,13 @@ protected:
 
     inline void invalidate()
     {
-        if (RenderObject* primitiveRenderer = renderer())
-            RenderSVGResource::markForLayoutAndParentResourceInvalidation(primitiveRenderer);
+        if (RenderElement* primitiveRenderer = renderer())
+            RenderSVGResource::markForLayoutAndParentResourceInvalidation(*primitiveRenderer);
     }
 
     inline void primitiveAttributeChanged(const QualifiedName& attribute)
     {
-        if (RenderObject* primitiveRenderer = renderer())
+        if (RenderElement* primitiveRenderer = renderer())
             static_cast<RenderSVGResourceFilterPrimitive*>(primitiveRenderer)->primitiveAttributeChanged(attribute);
     }
 
index f3dd53b..3e10699 100644 (file)
@@ -122,8 +122,8 @@ void SVGForeignObjectElement::svgAttributeChanged(const QualifiedName& attrName)
     if (isLengthAttribute)
         updateRelativeLengthsInformation();
 
-    if (RenderObject* renderer = this->renderer())
-        RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer);
+    if (auto renderer = this->renderer())
+        RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer);
 }
 
 RenderElement* SVGForeignObjectElement::createRenderer(PassRef<RenderStyle> style)
index 17b39ff..e5fa7ff 100644 (file)
@@ -85,8 +85,8 @@ void SVGGElement::svgAttributeChanged(const QualifiedName& attrName)
 
     SVGElementInstance::InvalidationGuard invalidationGuard(this);
 
-    if (RenderObject* renderer = this->renderer())
-        RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer);
+    if (auto renderer = this->renderer())
+        RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer);
 }
 
 RenderElement* SVGGElement::createRenderer(PassRef<RenderStyle> style)
index 890dd2a..349ca5d 100644 (file)
@@ -134,13 +134,13 @@ void SVGGraphicsElement::svgAttributeChanged(const QualifiedName& attrName)
     if (SVGTests::handleAttributeChange(this, attrName))
         return;
 
-    RenderObject* object = renderer();
-    if (!object)
+    auto renderer = this->renderer();
+    if (!renderer)
         return;
 
     if (attrName == SVGNames::transformAttr) {
-        object->setNeedsTransformUpdate();
-        RenderSVGResource::markForLayoutAndParentResourceInvalidation(object);
+        renderer->setNeedsTransformUpdate();
+        RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer);
         return;
     }
 
index 32bb637..059a23d 100644 (file)
@@ -154,20 +154,20 @@ void SVGImageElement::svgAttributeChanged(const QualifiedName& attrName)
         return;
     }
 
-    RenderObject* renderer = this->renderer();
+    auto renderer = this->renderer();
     if (!renderer)
         return;
 
     if (isLengthAttribute) {
         if (toRenderSVGImage(renderer)->updateImageViewport())
-            RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer);
+            RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer);
         return;
     }
 
     if (attrName == SVGNames::preserveAspectRatioAttr
         || SVGLangSpace::isKnownAttribute(attrName)
         || SVGExternalResourcesRequired::isKnownAttribute(attrName)) {
-        RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer);
+        RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer);
         return;
     }
 
index aad5289..00d07e5 100644 (file)
@@ -124,12 +124,12 @@ void SVGLineElement::svgAttributeChanged(const QualifiedName& attrName)
 
     if (isLengthAttribute) {
         renderer->setNeedsShapeUpdate();
-        RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer);
+        RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer);
         return;
     }
 
     if (SVGLangSpace::isKnownAttribute(attrName) || SVGExternalResourcesRequired::isKnownAttribute(attrName)) {
-        RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer);
+        RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer);
         return;
     }
 
index fc21bf7..bc27b88 100644 (file)
@@ -278,7 +278,7 @@ void SVGPathElement::svgAttributeChanged(const QualifiedName& attrName)
     }
 
     if (renderer)
-        RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer);
+        RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer);
 }
 
 void SVGPathElement::invalidateMPathDependencies()
@@ -286,10 +286,9 @@ void SVGPathElement::invalidateMPathDependencies()
     // <mpath> can only reference <path> but this dependency is not handled in
     // markForLayoutAndParentResourceInvalidation so we update any mpath dependencies manually.
     if (HashSet<SVGElement*>* dependencies = document().accessSVGExtensions()->setOfElementsReferencingTarget(this)) {
-        HashSet<SVGElement*>::iterator end = dependencies->end();
-        for (HashSet<SVGElement*>::iterator it = dependencies->begin(); it != end; ++it) {
-            if ((*it)->hasTagName(SVGNames::mpathTag))
-                toSVGMPathElement(*it)->targetPathChanged();
+        for (auto element : *dependencies) {
+            if (element->hasTagName(SVGNames::mpathTag))
+                toSVGMPathElement(element)->targetPathChanged();
         }
     }
 }
@@ -388,7 +387,7 @@ void SVGPathElement::pathSegListChanged(SVGPathSegRole role, ListModification li
         return;
 
     renderer->setNeedsShapeUpdate();
-    RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer);
+    RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer);
 }
 
 FloatRect SVGPathElement::getBBox(StyleUpdateStrategy styleUpdateStrategy)
index 4df3c6c..56c90d9 100644 (file)
@@ -118,12 +118,12 @@ void SVGPolyElement::svgAttributeChanged(const QualifiedName& attrName)
 
     if (attrName == SVGNames::pointsAttr) {
         renderer->setNeedsShapeUpdate();
-        RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer);
+        RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer);
         return;
     }
 
     if (SVGLangSpace::isKnownAttribute(attrName) || SVGExternalResourcesRequired::isKnownAttribute(attrName)) {
-        RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer);
+        RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer);
         return;
     }
 
index 0d680ef..06fda46 100644 (file)
@@ -138,12 +138,12 @@ void SVGRectElement::svgAttributeChanged(const QualifiedName& attrName)
 
     if (isLengthAttribute) {
         renderer->setNeedsShapeUpdate();
-        RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer);
+        RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer);
         return;
     }
 
     if (SVGLangSpace::isKnownAttribute(attrName) || SVGExternalResourcesRequired::isKnownAttribute(attrName)) {
-        RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer);
+        RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer);
         return;
     }
 
index b3424d5..38dc9e2 100644 (file)
@@ -304,8 +304,8 @@ void SVGSVGElement::svgAttributeChanged(const QualifiedName& attrName)
         || SVGLangSpace::isKnownAttribute(attrName)
         || SVGExternalResourcesRequired::isKnownAttribute(attrName)
         || SVGZoomAndPan::isKnownAttribute(attrName)) {
-        if (renderer())
-            RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer());
+        if (auto renderer = this->renderer())
+            RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer);
         return;
     }
 
@@ -683,7 +683,7 @@ AffineTransform SVGSVGElement::viewBoxToViewTransform(float viewWidth, float vie
 
 void SVGSVGElement::setupInitialView(const String& fragmentIdentifier, Element* anchorNode)
 {
-    RenderObject* renderer = this->renderer();
+    auto renderer = this->renderer();
     SVGViewSpec* view = m_viewSpec.get();
     if (view)
         view->reset();
@@ -694,7 +694,7 @@ void SVGSVGElement::setupInitialView(const String& fragmentIdentifier, Element*
     if (fragmentIdentifier.startsWith("xpointer(")) {
         // FIXME: XPointer references are ignored (https://bugs.webkit.org/show_bug.cgi?id=17491)
         if (renderer && hadUseCurrentView)
-            RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer);
+            RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer);
         return;
     }
 
@@ -708,7 +708,7 @@ void SVGSVGElement::setupInitialView(const String& fragmentIdentifier, Element*
             view->reset();
 
         if (renderer && (hadUseCurrentView || m_useCurrentView))
-            RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer);
+            RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer);
         return;
     }
 
@@ -723,8 +723,8 @@ void SVGSVGElement::setupInitialView(const String& fragmentIdentifier, Element*
                 SVGSVGElement* svg = static_cast<SVGSVGElement*>(element);
                 svg->inheritViewAttributes(viewElement);
 
-                if (RenderObject* renderer = svg->renderer())
-                    RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer);
+                if (RenderElement* renderer = svg->renderer())
+                    RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer);
             }
         }
         return;
index 8e24425..73f687f 100644 (file)
@@ -89,11 +89,9 @@ void SVGStopElement::svgAttributeChanged(const QualifiedName& attrName)
 
     SVGElementInstance::InvalidationGuard invalidationGuard(this);
 
-    if (!renderer())
-        return;
-
     if (attrName == SVGNames::offsetAttr) {
-        RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer());
+        if (auto renderer = this->renderer())
+            RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer);
         return;
     }
 
index 777703c..b672016 100644 (file)
@@ -212,8 +212,8 @@ void SVGTRefElement::svgAttributeChanged(const QualifiedName& attrName)
 
     if (SVGURIReference::isKnownAttribute(attrName)) {
         buildPendingResource();
-        if (RenderObject* renderer = this->renderer())
-            RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer);
+        if (auto renderer = this->renderer())
+            RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer);
         return;
     }
 
index c1904ed..ef9920e 100644 (file)
@@ -274,8 +274,8 @@ void SVGTextContentElement::svgAttributeChanged(const QualifiedName& attrName)
     if (attrName == SVGNames::textLengthAttr)
         m_specifiedTextLength = m_textLength.value;
 
-    if (RenderObject* renderer = this->renderer())
-        RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer);
+    if (auto renderer = this->renderer())
+        RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer);
 }
 
 bool SVGTextContentElement::selfHasRelativeLengths() const
index 40d2b57..e9ee005 100644 (file)
@@ -123,8 +123,8 @@ void SVGTextPathElement::svgAttributeChanged(const QualifiedName& attrName)
     if (attrName == SVGNames::startOffsetAttr)
         updateRelativeLengthsInformation();
 
-    if (RenderObject* object = renderer())
-        RenderSVGResource::markForLayoutAndParentResourceInvalidation(object);
+    if (auto renderer = this->renderer())
+        RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer);
 }
 
 RenderElement* SVGTextPathElement::createRenderer(PassRef<RenderStyle> style)
index 830f586..82e7063 100644 (file)
@@ -135,14 +135,14 @@ void SVGTextPositioningElement::svgAttributeChanged(const QualifiedName& attrNam
     if (updateRelativeLengths)
         updateRelativeLengthsInformation();
 
-    RenderObject* renderer = this->renderer();
+    auto renderer = this->renderer();
     if (!renderer)
         return;
 
     if (updateRelativeLengths || attrName == SVGNames::rotateAttr) {
         if (RenderSVGText* textRenderer = RenderSVGText::locateRenderSVGTextAncestor(renderer))
             textRenderer->setNeedsPositioningValuesUpdate();
-        RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer);
+        RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer);
         return;
     }
 
index a823998..7ebd2b4 100644 (file)
@@ -225,14 +225,14 @@ void SVGUseElement::svgAttributeChanged(const QualifiedName& attrName)
 
     SVGElementInstance::InvalidationGuard invalidationGuard(this);
 
-    RenderObject* renderer = this->renderer();
+    auto renderer = this->renderer();
     if (attrName == SVGNames::xAttr
         || attrName == SVGNames::yAttr
         || attrName == SVGNames::widthAttr
         || attrName == SVGNames::heightAttr) {
         updateRelativeLengthsInformation();
         if (renderer)
-            RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer);
+            RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer);
         return;
     }