Lines Matching refs:renderer
83 static inline SVGResourcesCache* resourcesCacheFromRenderObject(const RenderObject* renderer)
85 Document& document = renderer->document();
94 SVGResources* SVGResourcesCache::cachedResourcesForRenderObject(const RenderObject* renderer)
96 ASSERT(renderer);
97 return resourcesCacheFromRenderObject(renderer)->m_cache.get(renderer);
112 static inline bool rendererCanHaveResources(RenderObject* renderer)
114 ASSERT(renderer);
115 return renderer->node() && renderer->node()->isSVGElement() && !renderer->isSVGInlineText();
118 void SVGResourcesCache::clientStyleChanged(RenderObject* renderer, StyleDifference diff, const RenderStyle* newStyle)
120 ASSERT(renderer);
121 ASSERT(renderer->node());
122 ASSERT(renderer->node()->isSVGElement());
124 if (!diff.hasDifference() || !renderer->parent())
128 if (renderer->isSVGResourceFilterPrimitive() && !diff.needsLayout())
131 // Dynamic changes of CSS properties like 'clip-path' may require us to recompute the associated resources for a renderer.
134 if (rendererCanHaveResources(renderer)) {
135 SVGResourcesCache* cache = resourcesCacheFromRenderObject(renderer);
136 cache->removeResourcesFromRenderObject(renderer);
137 cache->addResourcesFromRenderObject(renderer, newStyle);
140 RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer, false);
143 void SVGResourcesCache::clientWasAddedToTree(RenderObject* renderer, const RenderStyle* newStyle)
145 if (!renderer->node())
147 RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer, false);
149 if (!rendererCanHaveResources(renderer))
151 SVGResourcesCache* cache = resourcesCacheFromRenderObject(renderer);
152 cache->addResourcesFromRenderObject(renderer, newStyle);
155 void SVGResourcesCache::clientWillBeRemovedFromTree(RenderObject* renderer)
157 if (!renderer->node())
159 RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer, false);
161 if (!rendererCanHaveResources(renderer))
163 SVGResourcesCache* cache = resourcesCacheFromRenderObject(renderer);
164 cache->removeResourcesFromRenderObject(renderer);
167 void SVGResourcesCache::clientDestroyed(RenderObject* renderer)
169 ASSERT(renderer);
171 SVGResources* resources = SVGResourcesCache::cachedResourcesForRenderObject(renderer);
173 resources->removeClientFromCache(renderer);
175 SVGResourcesCache* cache = resourcesCacheFromRenderObject(renderer);
176 cache->removeResourcesFromRenderObject(renderer);