void SVGFELightElement::childrenChanged(const ChildChange& change) { SVGElement::childrenChanged(change); if (change.source == ChildChangeSourceParser) return; ContainerNode* parent = parentNode(); if (!parent) return; RenderElement* renderer = parent->renderer(); if (renderer && renderer->isSVGResourceFilterPrimitive()) RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer); }
void invalidateFilterPrimitiveParent(SVGElement* element) { if (!element) return; ContainerNode* parent = element->parentNode(); if (!parent) return; RenderElement* renderer = parent->renderer(); if (!renderer || !renderer->isSVGResourceFilterPrimitive()) return; RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer, false); }
void SVGResourcesCache::clientStyleChanged(RenderElement& renderer, StyleDifference diff, const RenderStyle& newStyle) { if (diff == StyleDifferenceEqual || !renderer.parent()) return; // In this case the proper SVGFE*Element will decide whether the modified CSS properties require a relayout or repaint. if (renderer.isSVGResourceFilterPrimitive() && (diff == StyleDifferenceRepaint || diff == StyleDifferenceRepaintIfTextOrBorderOrOutline)) return; // Dynamic changes of CSS properties like 'clip-path' may require us to recompute the associated resources for a renderer. // FIXME: Avoid passing in a useless StyleDifference, but instead compare oldStyle/newStyle to see which resources changed // to be able to selectively rebuild individual resources, instead of all of them. if (rendererCanHaveResources(renderer)) { SVGResourcesCache* cache = resourcesCacheFromRenderObject(renderer); cache->removeResourcesFromRenderer(renderer); cache->addResourcesFromRenderer(renderer, newStyle); } RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer, false); if (renderer.element() && !renderer.element()->isSVGElement()) renderer.element()->setNeedsStyleRecalc(SyntheticStyleChange); }