Source/WebCore/ChangeLog

 12022-02-25 Said Abou-Hallawa <said@apple.com>
 2
 3 setNeedsLayout() should not be called when changing the SVG properties
 4 https://bugs.webkit.org/show_bug.cgi?id=230296
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 WIP
 9
 10 * rendering/svg/RenderSVGImage.cpp:
 11 (WebCore::RenderSVGImage::imageChanged):
 12 * rendering/svg/RenderSVGResource.cpp:
 13 (WebCore::removeFromCacheAndInvalidateDependencies):
 14 * rendering/svg/SVGResourcesCache.cpp:
 15 (WebCore::SVGResourcesCache::removeRendererFromResources):
 16 * rendering/svg/SVGResourcesCache.h:
 17 * rendering/updating/RenderTreeUpdater.cpp:
 18 (WebCore::RenderTreeUpdater::updateRenderTree):
 19 * svg/SVGAnimateMotionElement.cpp:
 20 (WebCore::SVGAnimateMotionElement::applyResultsToTarget):
 21 * svg/SVGCircleElement.cpp:
 22 (WebCore::SVGCircleElement::svgAttributeChanged):
 23 * svg/SVGClipPathElement.cpp:
 24 (WebCore::SVGClipPathElement::svgAttributeChanged):
 25 * svg/SVGComponentTransferFunctionElement.cpp:
 26 (WebCore::SVGComponentTransferFunctionElement::svgAttributeChanged):
 27 * svg/SVGElement.cpp:
 28 (WebCore::SVGElement::commitPropertyChange):
 29 (WebCore::SVGElement::setPresentationalHintStyleIsDirty):
 30 (WebCore::SVGElement::setNeedsParentAndResourceInvalidation):
 31 (WebCore::SVGElement::invalidateParentAndResourceIfNeeded):
 32 * svg/SVGElement.h:
 33 (WebCore::SVGElement::setAnimatedSVGAttributesAreDirty):
 34 (WebCore::SVGElement::invalidateSVGAttributes): Deleted.
 35 (WebCore::SVGElement::invalidateSVGPresentationalHintStyle): Deleted.
 36 * svg/SVGEllipseElement.cpp:
 37 (WebCore::SVGEllipseElement::svgAttributeChanged):
 38 * svg/SVGFEBlendElement.cpp:
 39 (WebCore::SVGFEBlendElement::svgAttributeChanged):
 40 * svg/SVGFEColorMatrixElement.cpp:
 41 (WebCore::SVGFEColorMatrixElement::svgAttributeChanged):
 42 * svg/SVGFEComponentTransferElement.cpp:
 43 (WebCore::SVGFEComponentTransferElement::svgAttributeChanged):
 44 * svg/SVGFEComponentTransferElement.h:
 45 * svg/SVGFECompositeElement.cpp:
 46 (WebCore::SVGFECompositeElement::svgAttributeChanged):
 47 * svg/SVGFEConvolveMatrixElement.cpp:
 48 (WebCore::SVGFEConvolveMatrixElement::setOrder):
 49 (WebCore::SVGFEConvolveMatrixElement::setKernelUnitLength):
 50 (WebCore::SVGFEConvolveMatrixElement::svgAttributeChanged):
 51 * svg/SVGFEDiffuseLightingElement.cpp:
 52 (WebCore::SVGFEDiffuseLightingElement::svgAttributeChanged):
 53 * svg/SVGFEDisplacementMapElement.cpp:
 54 (WebCore::SVGFEDisplacementMapElement::svgAttributeChanged):
 55 * svg/SVGFEDropShadowElement.cpp:
 56 (WebCore::SVGFEDropShadowElement::setStdDeviation):
 57 (WebCore::SVGFEDropShadowElement::svgAttributeChanged):
 58 * svg/SVGFEGaussianBlurElement.cpp:
 59 (WebCore::SVGFEGaussianBlurElement::setStdDeviation):
 60 (WebCore::SVGFEGaussianBlurElement::svgAttributeChanged):
 61 * svg/SVGFEImageElement.cpp:
 62 (WebCore::SVGFEImageElement::buildPendingResource):
 63 (WebCore::SVGFEImageElement::svgAttributeChanged):
 64 (WebCore::SVGFEImageElement::notifyFinished):
 65 * svg/SVGFELightElement.cpp:
 66 (WebCore::SVGFELightElement::childrenChanged):
 67 * svg/SVGFEMergeNodeElement.cpp:
 68 (WebCore::SVGFEMergeNodeElement::svgAttributeChanged):
 69 * svg/SVGFEMorphologyElement.cpp:
 70 (WebCore::SVGFEMorphologyElement::setRadius):
 71 (WebCore::SVGFEMorphologyElement::svgAttributeChanged):
 72 * svg/SVGFEOffsetElement.cpp:
 73 (WebCore::SVGFEOffsetElement::svgAttributeChanged):
 74 * svg/SVGFESpecularLightingElement.cpp:
 75 (WebCore::SVGFESpecularLightingElement::svgAttributeChanged):
 76 * svg/SVGFETileElement.cpp:
 77 (WebCore::SVGFETileElement::svgAttributeChanged):
 78 * svg/SVGFilterElement.cpp:
 79 (WebCore::SVGFilterElement::svgAttributeChanged):
 80 * svg/SVGFilterPrimitiveStandardAttributes.cpp:
 81 (WebCore::SVGFilterPrimitiveStandardAttributes::svgAttributeChanged):
 82 (WebCore::SVGFilterPrimitiveStandardAttributes::childrenChanged):
 83 (WebCore::invalidateFilterPrimitiveParent):
 84 * svg/SVGFilterPrimitiveStandardAttributes.h:
 85 (WebCore::SVGFilterPrimitiveStandardAttributes::invalidate): Deleted.
 86 * svg/SVGForeignObjectElement.cpp:
 87 (WebCore::SVGForeignObjectElement::svgAttributeChanged):
 88 * svg/SVGGeometryElement.cpp:
 89 (WebCore::SVGGeometryElement::svgAttributeChanged):
 90 * svg/SVGGradientElement.cpp:
 91 (WebCore::SVGGradientElement::svgAttributeChanged):
 92 * svg/SVGGraphicsElement.cpp:
 93 (WebCore::SVGGraphicsElement::svgAttributeChanged):
 94 * svg/SVGImageElement.cpp:
 95 (WebCore::SVGImageElement::svgAttributeChanged):
 96 * svg/SVGLineElement.cpp:
 97 (WebCore::SVGLineElement::svgAttributeChanged):
 98 * svg/SVGLinearGradientElement.cpp:
 99 (WebCore::SVGLinearGradientElement::svgAttributeChanged):
 100 * svg/SVGMarkerElement.cpp:
 101 (WebCore::SVGMarkerElement::svgAttributeChanged):
 102 * svg/SVGMaskElement.cpp:
 103 (WebCore::SVGMaskElement::svgAttributeChanged):
 104 * svg/SVGPathElement.cpp:
 105 (WebCore::SVGPathElement::svgAttributeChanged):
 106 * svg/SVGPatternElement.cpp:
 107 (WebCore::SVGPatternElement::svgAttributeChanged):
 108 * svg/SVGPolyElement.cpp:
 109 (WebCore::SVGPolyElement::svgAttributeChanged):
 110 * svg/SVGRadialGradientElement.cpp:
 111 (WebCore::SVGRadialGradientElement::svgAttributeChanged):
 112 * svg/SVGRectElement.cpp:
 113 (WebCore::SVGRectElement::svgAttributeChanged):
 114 * svg/SVGSVGElement.cpp:
 115 (WebCore::SVGSVGElement::svgAttributeChanged):
 116 (WebCore::SVGSVGElement::scrollToFragment):
 117 (WebCore::SVGSVGElement::resetScrollAnchor):
 118 * svg/SVGStopElement.cpp:
 119 (WebCore::SVGStopElement::svgAttributeChanged):
 120 * svg/SVGTRefElement.cpp:
 121 (WebCore::SVGTRefElement::svgAttributeChanged):
 122 * svg/SVGTextContentElement.cpp:
 123 (WebCore::SVGTextContentElement::svgAttributeChanged):
 124 * svg/SVGTextPathElement.cpp:
 125 (WebCore::SVGTextPathElement::svgAttributeChanged):
 126 * svg/SVGTextPositioningElement.cpp:
 127 (WebCore::SVGTextPositioningElement::svgAttributeChanged):
 128 * svg/SVGUseElement.cpp:
 129 (WebCore::SVGUseElement::svgAttributeChanged):
 130 * svg/SVGViewElement.cpp:
 131 (WebCore::SVGViewElement::svgAttributeChanged):
 132 * svg/properties/SVGAttributeAnimator.cpp:
 133 (WebCore::SVGAttributeAnimator::invalidateStyle):
 134
11352022-02-25 Carlos Garcia Campos <cgarcia@igalia.com>
2136
3137 AX: List item marker not exposed when not a direct child of a list item

Source/WebCore/rendering/svg/RenderSVGImage.cpp

@@void RenderSVGImage::imageChanged(WrappedImagePtr, const IntRect*)
244244 // This empty image may be cached by SVG resources which must be invalidated.
245245 if (auto* resources = SVGResourcesCache::cachedResourcesForRenderer(*this))
246246 resources->removeClientFromCache(*this);
247 
248  // Eventually notify parent resources, that we've changed.
249  RenderSVGResource::markForLayoutAndParentResourceInvalidation(*this, false);
250 
 247
251248 // Update the SVGImageCache sizeAndScales entry in case image loading finished after layout.
252249 // (https://bugs.webkit.org/show_bug.cgi?id=99489)
253250 m_objectBoundingBox = FloatRect();
254  if (updateImageViewport())
255  setNeedsLayout();
256251
257252 invalidateBufferedForeground();
258253
259  repaint();
 254 imageElement().setNeedsParentAndResourceInvalidation();
260255}
261256
262257void RenderSVGImage::addFocusRingRects(Vector<LayoutRect>& rects, const LayoutPoint&, const RenderLayerModelObject*)

Source/WebCore/rendering/svg/RenderSVGResource.cpp

@@RenderSVGResourceSolidColor* RenderSVGResource::sharedSolidPaintingResource()
159159
160160static void removeFromCacheAndInvalidateDependencies(RenderElement& renderer, bool needsLayout)
161161{
162  if (auto* resources = SVGResourcesCache::cachedResourcesForRenderer(renderer)) {
163  if (RenderSVGResourceFilter* filter = resources->filter())
164  filter->removeClientFromCache(renderer);
165 
166  if (RenderSVGResourceMasker* masker = resources->masker())
167  masker->removeClientFromCache(renderer);
168 
169  if (RenderSVGResourceClipper* clipper = resources->clipper())
170  clipper->removeClientFromCache(renderer);
171  }
 162 SVGResourcesCache::removeRendererFromResources(renderer);
172163
173164 if (!is<SVGElement>(renderer.element()))
174165 return;

Source/WebCore/rendering/svg/SVGResourcesCache.cpp

@@void SVGResourcesCache::resourceDestroyed(RenderSVGResourceContainer& resource)
170170 }
171171}
172172
 173void SVGResourcesCache::removeRendererFromResources(RenderElement& renderer)
 174{
 175 auto* resources = SVGResourcesCache::cachedResourcesForRenderer(renderer);
 176 if (!resources)
 177 return;
 178
 179 if (auto filter = resources->filter())
 180 filter->removeClientFromCache(renderer);
 181
 182 if (auto masker = resources->masker())
 183 masker->removeClientFromCache(renderer);
 184
 185 if (auto clipper = resources->clipper())
 186 clipper->removeClientFromCache(renderer);
 187}
 188
173189SVGResourcesCache::SetStyleForScope::SetStyleForScope(RenderElement& renderer, const RenderStyle& scopedStyle, const RenderStyle& newStyle)
174190 : m_renderer(renderer)
175191 , m_scopedStyle(scopedStyle)

Source/WebCore/rendering/svg/SVGResourcesCache.h

@@public:
5858 // Called from RenderSVGResourceContainer::willBeDestroyed().
5959 static void resourceDestroyed(RenderSVGResourceContainer&);
6060
 61 static void removeRendererFromResources(RenderElement&);
 62
6163 class SetStyleForScope {
6264 WTF_MAKE_NONCOPYABLE(SetStyleForScope);
6365 public:

Source/WebCore/rendering/updating/RenderTreeUpdater.cpp

4545#include "RenderTreeUpdaterGeneratedContent.h"
4646#include "RenderView.h"
4747#include "RuntimeEnabledFeatures.h"
 48#include "SVGElement.h"
4849#include "StyleResolver.h"
4950#include "StyleTreeResolver.h"
5051#include "TextManipulationController.h"

@@void RenderTreeUpdater::updateRenderTree(ContainerNode& root)
192193 if (elementUpdates)
193194 updateElementRenderer(element, *elementUpdates);
194195
 196 if (is<SVGElement>(element))
 197 downcast<SVGElement>(element).invalidateParentAndResourceIfNeeded();
 198
195199 storePreviousRenderer(element);
196200
197201 bool mayHaveRenderedDescendants = element.renderer() || (element.hasDisplayContents() && shouldCreateRenderer(element, renderTreePosition().parent()));

Source/WebCore/svg/SVGAnimateMotionElement.cpp

@@void SVGAnimateMotionElement::applyResultsToTarget()
250250 if (!targetElement)
251251 return;
252252
253  if (RenderElement* renderer = targetElement->renderer()) {
254  renderer->setNeedsTransformUpdate();
255  RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer);
256  }
257 
 253 auto invalidate = [](SVGElement& element) {
 254 if (auto renderer = element.renderer())
 255 renderer->setNeedsTransformUpdate();
 256 element.setNeedsParentAndResourceInvalidation();
 257 };
 258
 259 invalidate(*targetElement);
 260
258261 AffineTransform* targetSupplementalTransform = targetElement->supplementalTransform();
259262 if (!targetSupplementalTransform)
260263 return;

@@void SVGAnimateMotionElement::applyResultsToTarget()
265268 if (!transform || *transform == *targetSupplementalTransform)
266269 continue;
267270 *transform = *targetSupplementalTransform;
268  if (RenderElement* renderer = instance->renderer()) {
269  renderer->setNeedsTransformUpdate();
270  RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer);
271  }
 271 invalidate(instance);
272272 }
273273}
274274

Source/WebCore/svg/SVGCircleElement.cpp

@@void SVGCircleElement::parseAttribute(const QualifiedName& name, const AtomStrin
6868void SVGCircleElement::svgAttributeChanged(const QualifiedName& attrName)
6969{
7070 if (PropertyRegistry::isKnownAttribute(attrName)) {
 71 ASSERT(PropertyRegistry::isAnimatedLengthAttribute(attrName));
7172 InstanceInvalidationGuard guard(*this);
72  invalidateSVGPresentationalHintStyle();
 73 setPresentationalHintStyleIsDirty();
7374 return;
7475 }
7576

Source/WebCore/svg/SVGClipPathElement.cpp

@@void SVGClipPathElement::svgAttributeChanged(const QualifiedName& attrName)
6666{
6767 if (PropertyRegistry::isKnownAttribute(attrName)) {
6868 InstanceInvalidationGuard guard(*this);
69 
70  if (RenderObject* object = renderer())
71  object->setNeedsLayout();
 69 setNeedsParentAndResourceInvalidation();
7270 return;
7371 }
7472

Source/WebCore/svg/SVGComponentTransferFunctionElement.cpp

@@void SVGComponentTransferFunctionElement::svgAttributeChanged(const QualifiedNam
9292{
9393 if (PropertyRegistry::isKnownAttribute(attrName)) {
9494 InstanceInvalidationGuard guard(*this);
95  invalidateFilterPrimitiveParent(this);
 95 invalidateFilterPrimitiveParent(*this);
9696 return;
9797 }
9898

Source/WebCore/svg/SVGElement.cpp

@@void SVGElement::commitPropertyChange(SVGProperty* property)
610610 // SVGLengthList and not the SVGLength.
611611 property->setDirty();
612612
613  invalidateSVGAttributes();
 613 setAnimatedSVGAttributesAreDirty();
614614 svgAttributeChanged(propertyRegistry().propertyAttributeName(*property));
615615}
616616

@@void SVGElement::commitPropertyChange(SVGAnimatedProperty& animatedProperty)
626626 else
627627 setSynchronizedLazyAttribute(attributeName, animatedProperty.baseValAsString());
628628
629  invalidateSVGAttributes();
 629 setAnimatedSVGAttributesAreDirty();
630630 svgAttributeChanged(attributeName);
631631}
632632

@@RefPtr<SVGAttributeAnimator> SVGElement::createAnimator(const QualifiedName& att
659659 instance->propertyRegistry().appendAnimatedInstance(attributeName, *animator);
660660 return animator;
661661}
662 
 662
663663void SVGElement::animatorWillBeDeleted(const QualifiedName& attributeName)
664664{
665665 propertyAnimatorFactory().animatorWillBeDeleted(attributeName);

@@void SVGElement::collectPresentationalHintsForAttribute(const QualifiedName& nam
883883 addPropertyToPresentationalHintStyle(style, propertyID, value);
884884}
885885
 886void SVGElement::setPresentationalHintStyleIsDirty()
 887{
 888 ensureUniqueElementData().setPresentationalHintStyleIsDirty(true);
 889 // Trigger style recalculation for "elements as resource" (e.g. referenced by feImage).
 890 invalidateStyle();
 891}
 892
 893void SVGElement::setNeedsParentAndResourceInvalidation()
 894{
 895 m_NeedsParentAndResourceInvalidation = true;
 896 invalidateStyle();
 897}
 898
 899void SVGElement::invalidateParentAndResourceIfNeeded()
 900{
 901 if (!m_NeedsParentAndResourceInvalidation)
 902 return;
 903
 904 if (auto renderer = this->renderer())
 905 RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer);
 906 m_NeedsParentAndResourceInvalidation = false;
 907}
 908
886909void SVGElement::svgAttributeChanged(const QualifiedName& attrName)
887910{
888911 CSSPropertyID propId = cssPropertyIdForSVGAttributeName(attrName);

Source/WebCore/svg/SVGElement.h

@@public:
8282
8383 virtual AffineTransform* supplementalTransform() { return nullptr; }
8484
85  inline void invalidateSVGAttributes();
86  inline void invalidateSVGPresentationalHintStyle();
 85 inline void setAnimatedSVGAttributesAreDirty();
 86 void setPresentationalHintStyleIsDirty();
 87 void setNeedsParentAndResourceInvalidation();
 88 void invalidateParentAndResourceIfNeeded();
8789
8890 // The instances of an element are clones made in shadow trees to implement <use>.
8991 const WeakHashSet<SVGElement>& instances() const;

@@private:
193195
194196 void invalidateInstances();
195197
 198 bool m_NeedsParentAndResourceInvalidation { false };
 199
196200 std::unique_ptr<SVGElementRareData> m_svgRareData;
197201
198202 WeakHashSet<SVGElement> m_elementsWithRelativeLengths;

Source/WebCore/svg/SVGElementInlines.h

3030
3131namespace WebCore {
3232
33 inline void SVGElement::invalidateSVGAttributes()
 33inline void SVGElement::setAnimatedSVGAttributesAreDirty()
3434{
3535 ensureUniqueElementData().setAnimatedSVGAttributesAreDirty(true);
3636}
3737
38 inline void SVGElement::invalidateSVGPresentationalHintStyle()
39 {
40  ensureUniqueElementData().setPresentationalHintStyleIsDirty(true);
41  // Trigger style recalculation for "elements as resource" (e.g. referenced by feImage).
42  invalidateStyle();
43 }
44 
4538struct SVGAttributeHashTranslator {
4639 static unsigned hash(const QualifiedName& key)
4740 {

Source/WebCore/svg/SVGEllipseElement.cpp

@@void SVGEllipseElement::parseAttribute(const QualifiedName& name, const AtomStri
7171void SVGEllipseElement::svgAttributeChanged(const QualifiedName& attrName)
7272{
7373 if (PropertyRegistry::isKnownAttribute(attrName)) {
 74 ASSERT(PropertyRegistry::isAnimatedLengthAttribute(attrName));
7475 InstanceInvalidationGuard guard(*this);
75  invalidateSVGPresentationalHintStyle();
 76 setPresentationalHintStyleIsDirty();
7677 return;
7778 }
7879

Source/WebCore/svg/SVGFEBlendElement.cpp

@@bool SVGFEBlendElement::setFilterEffectAttribute(FilterEffect* effect, const Qua
8383
8484void SVGFEBlendElement::svgAttributeChanged(const QualifiedName& attrName)
8585{
86  if (attrName == SVGNames::modeAttr) {
 86 if (PropertyRegistry::isKnownAttribute(attrName)) {
8787 InstanceInvalidationGuard guard(*this);
88  primitiveAttributeChanged(attrName);
89  return;
90  }
91 
92  if (attrName == SVGNames::inAttr || attrName == SVGNames::in2Attr) {
93  InstanceInvalidationGuard guard(*this);
94  invalidate();
 88 if (attrName == SVGNames::inAttr || attrName == SVGNames::in2Attr)
 89 setNeedsParentAndResourceInvalidation();
 90 else
 91 primitiveAttributeChanged(attrName);
9592 return;
9693 }
9794

Source/WebCore/svg/SVGFEColorMatrixElement.cpp

@@bool SVGFEColorMatrixElement::setFilterEffectAttribute(FilterEffect* effect, con
8484
8585void SVGFEColorMatrixElement::svgAttributeChanged(const QualifiedName& attrName)
8686{
87  if (attrName == SVGNames::typeAttr || attrName == SVGNames::valuesAttr) {
 87 if (PropertyRegistry::isKnownAttribute(attrName)) {
8888 InstanceInvalidationGuard guard(*this);
89  primitiveAttributeChanged(attrName);
90  return;
91  }
92 
93  if (attrName == SVGNames::inAttr) {
94  InstanceInvalidationGuard guard(*this);
95  invalidate();
 89 if (attrName == SVGNames::inAttr)
 90 setNeedsParentAndResourceInvalidation();
 91 else
 92 primitiveAttributeChanged(attrName);
9693 return;
9794 }
9895

Source/WebCore/svg/SVGFEComponentTransferElement.cpp

@@void SVGFEComponentTransferElement::parseAttribute(const QualifiedName& name, co
6262 SVGFilterPrimitiveStandardAttributes::parseAttribute(name, value);
6363}
6464
 65void SVGFEComponentTransferElement::svgAttributeChanged(const QualifiedName& attrName)
 66{
 67 if (PropertyRegistry::isKnownAttribute(attrName)) {
 68 InstanceInvalidationGuard guard(*this);
 69 invalidateFilterPrimitiveParent(*this);
 70 return;
 71 }
 72
 73 SVGFilterPrimitiveStandardAttributes::svgAttributeChanged(attrName);
 74}
 75
6576RefPtr<FilterEffect> SVGFEComponentTransferElement::filterEffect(const SVGFilterBuilder&, const FilterEffectVector&) const
6677{
6778 ComponentTransferFunction red;

Source/WebCore/svg/SVGFEComponentTransferElement.h

@@private:
4040 using PropertyRegistry = SVGPropertyOwnerRegistry<SVGFEComponentTransferElement, SVGFilterPrimitiveStandardAttributes>;
4141 const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; }
4242
43  // FIXME: svgAttributeChanged missing.
4443 void parseAttribute(const QualifiedName&, const AtomString&) override;
 44 void svgAttributeChanged(const QualifiedName&) override;
4545
4646 Vector<AtomString> filterEffectInputsNames() const override { return { in1() }; }
4747 RefPtr<FilterEffect> filterEffect(const SVGFilterBuilder&, const FilterEffectVector&) const override;

Source/WebCore/svg/SVGFECompositeElement.cpp

@@bool SVGFECompositeElement::setFilterEffectAttribute(FilterEffect* effect, const
115115
116116void SVGFECompositeElement::svgAttributeChanged(const QualifiedName& attrName)
117117{
118  if (attrName == SVGNames::operatorAttr || attrName == SVGNames::k1Attr || attrName == SVGNames::k2Attr || attrName == SVGNames::k3Attr || attrName == SVGNames::k4Attr) {
 118 if (PropertyRegistry::isKnownAttribute(attrName)) {
119119 InstanceInvalidationGuard guard(*this);
120  primitiveAttributeChanged(attrName);
121  return;
122  }
123 
124  if (attrName == SVGNames::inAttr || attrName == SVGNames::in2Attr) {
125  InstanceInvalidationGuard guard(*this);
126  invalidate();
 120 if (attrName == SVGNames::inAttr || attrName == SVGNames::in2Attr)
 121 setNeedsParentAndResourceInvalidation();
 122 else
 123 primitiveAttributeChanged(attrName);
127124 return;
128125 }
129126

Source/WebCore/svg/SVGFEConvolveMatrixElement.cpp

@@void SVGFEConvolveMatrixElement::setOrder(float x, float y)
160160{
161161 m_orderX->setBaseValInternal(x);
162162 m_orderY->setBaseValInternal(y);
163  invalidate();
 163 setNeedsParentAndResourceInvalidation();
164164}
165165
166166void SVGFEConvolveMatrixElement::setKernelUnitLength(float x, float y)
167167{
168168 m_kernelUnitLengthX->setBaseValInternal(x);
169169 m_kernelUnitLengthY->setBaseValInternal(y);
170  invalidate();
 170 setNeedsParentAndResourceInvalidation();
171171}
172172
173173void SVGFEConvolveMatrixElement::svgAttributeChanged(const QualifiedName& attrName)
174174{
175  if (attrName == SVGNames::edgeModeAttr || attrName == SVGNames::divisorAttr || attrName == SVGNames::biasAttr || attrName == SVGNames::targetXAttr || attrName == SVGNames::targetYAttr || attrName == SVGNames::kernelUnitLengthAttr || attrName == SVGNames::preserveAlphaAttr) {
 175 if (PropertyRegistry::isKnownAttribute(attrName)) {
176176 InstanceInvalidationGuard guard(*this);
177  primitiveAttributeChanged(attrName);
178  return;
179  }
180 
181  if (attrName == SVGNames::inAttr || attrName == SVGNames::orderAttr || attrName == SVGNames::kernelMatrixAttr) {
182  InstanceInvalidationGuard guard(*this);
183  invalidate();
 177 if (attrName == SVGNames::inAttr || attrName == SVGNames::orderAttr || attrName == SVGNames::kernelMatrixAttr)
 178 setNeedsParentAndResourceInvalidation();
 179 else
 180 primitiveAttributeChanged(attrName);
184181 return;
185182 }
186183

Source/WebCore/svg/SVGFEDiffuseLightingElement.cpp

@@bool SVGFEDiffuseLightingElement::setFilterEffectAttribute(FilterEffect* effect,
125125
126126void SVGFEDiffuseLightingElement::svgAttributeChanged(const QualifiedName& attrName)
127127{
128  if (attrName == SVGNames::surfaceScaleAttr || attrName == SVGNames::diffuseConstantAttr || attrName == SVGNames::kernelUnitLengthAttr || attrName == SVGNames::lighting_colorAttr) {
 128 if (PropertyRegistry::isKnownAttribute(attrName)) {
129129 InstanceInvalidationGuard guard(*this);
130  primitiveAttributeChanged(attrName);
131  return;
132  }
133 
134  if (attrName == SVGNames::inAttr) {
135  InstanceInvalidationGuard guard(*this);
136  invalidate();
 130 if (attrName == SVGNames::inAttr)
 131 setNeedsParentAndResourceInvalidation();
 132 else
 133 primitiveAttributeChanged(attrName);
137134 return;
138135 }
139136

Source/WebCore/svg/SVGFEDisplacementMapElement.cpp

@@bool SVGFEDisplacementMapElement::setFilterEffectAttribute(FilterEffect* effect,
9999
100100void SVGFEDisplacementMapElement::svgAttributeChanged(const QualifiedName& attrName)
101101{
102  if (attrName == SVGNames::xChannelSelectorAttr || attrName == SVGNames::yChannelSelectorAttr || attrName == SVGNames::scaleAttr) {
 102 if (PropertyRegistry::isKnownAttribute(attrName)) {
103103 InstanceInvalidationGuard guard(*this);
104  primitiveAttributeChanged(attrName);
105  return;
106  }
107 
108  if (attrName == SVGNames::inAttr || attrName == SVGNames::in2Attr) {
109  InstanceInvalidationGuard guard(*this);
110  invalidate();
 104 if (attrName == SVGNames::inAttr || attrName == SVGNames::in2Attr)
 105 setNeedsParentAndResourceInvalidation();
 106 else
 107 primitiveAttributeChanged(attrName);
111108 return;
112109 }
113110

Source/WebCore/svg/SVGFEDropShadowElement.cpp

@@void SVGFEDropShadowElement::setStdDeviation(float x, float y)
5454{
5555 m_stdDeviationX->setBaseValInternal(x);
5656 m_stdDeviationY->setBaseValInternal(y);
57  invalidate();
 57 setNeedsParentAndResourceInvalidation();
5858}
5959
6060void SVGFEDropShadowElement::parseAttribute(const QualifiedName& name, const AtomString& value)

@@void SVGFEDropShadowElement::svgAttributeChanged(const QualifiedName& attrName)
8989{
9090 if (PropertyRegistry::isKnownAttribute(attrName)) {
9191 InstanceInvalidationGuard guard(*this);
92  invalidate();
 92 setNeedsParentAndResourceInvalidation();
9393 return;
9494 }
9595

Source/WebCore/svg/SVGFEGaussianBlurElement.cpp

@@void SVGFEGaussianBlurElement::setStdDeviation(float x, float y)
5353{
5454 m_stdDeviationX->setBaseValInternal(x);
5555 m_stdDeviationY->setBaseValInternal(y);
56  invalidate();
 56 setNeedsParentAndResourceInvalidation();
5757}
5858
5959void SVGFEGaussianBlurElement::parseAttribute(const QualifiedName& name, const AtomString& value)

@@void SVGFEGaussianBlurElement::svgAttributeChanged(const QualifiedName& attrName
8787{
8888 if (PropertyRegistry::isKnownAttribute(attrName)) {
8989 InstanceInvalidationGuard guard(*this);
90  invalidate();
 90 setNeedsParentAndResourceInvalidation();
9191 return;
9292 }
9393

Source/WebCore/svg/SVGFEImageElement.cpp

@@void SVGFEImageElement::buildPendingResource()
111111 } else if (is<SVGElement>(*target.element))
112112 downcast<SVGElement>(*target.element).addReferencingElement(*this);
113113
114  invalidate();
 114 setNeedsParentAndResourceInvalidation();
115115}
116116
117117void SVGFEImageElement::parseAttribute(const QualifiedName& name, const AtomString& value)

@@void SVGFEImageElement::parseAttribute(const QualifiedName& name, const AtomStri
127127
128128void SVGFEImageElement::svgAttributeChanged(const QualifiedName& attrName)
129129{
130  if (attrName == SVGNames::preserveAspectRatioAttr) {
 130 if (PropertyRegistry::isKnownAttribute(attrName)) {
131131 InstanceInvalidationGuard guard(*this);
132  invalidate();
 132 setNeedsParentAndResourceInvalidation();
133133 return;
134134 }
135135

@@void SVGFEImageElement::notifyFinished(CachedResource&, const NetworkLoadMetrics
165165 if (!isConnected())
166166 return;
167167
168  RefPtr parent = parentElement();
169 
 168 auto parent = parentElement();
170169 if (!parent || !parent->hasTagName(SVGNames::filterTag))
171170 return;
172171
173  RenderElement* parentRenderer = parent->renderer();
174  if (!parentRenderer)
175  return;
176 
177  RenderSVGResource::markForLayoutAndParentResourceInvalidation(*parentRenderer);
 172 downcast<SVGElement>(*parent).setNeedsParentAndResourceInvalidation();
178173}
179174
180175static inline IntRect scaledImageBufferRect(const FloatRect& rect, const FloatSize& scale)

Source/WebCore/svg/SVGFELightElement.cpp

@@void SVGFELightElement::svgAttributeChanged(const QualifiedName& attrName)
151151void SVGFELightElement::childrenChanged(const ChildChange& change)
152152{
153153 SVGElement::childrenChanged(change);
154 
155154 if (change.source == ChildChange::Source::Parser)
156155 return;
157  RefPtr parent = parentNode();
158  if (!parent)
159  return;
160  RenderElement* renderer = parent->renderer();
161  if (renderer && renderer->isSVGResourceFilterPrimitive())
162  RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer);
 156 invalidateFilterPrimitiveParent(*this);
163157}
164158
165159}

Source/WebCore/svg/SVGFEMergeNodeElement.cpp

@@void SVGFEMergeNodeElement::parseAttribute(const QualifiedName& name, const Atom
6060
6161void SVGFEMergeNodeElement::svgAttributeChanged(const QualifiedName& attrName)
6262{
63  if (attrName == SVGNames::inAttr) {
 63 if (PropertyRegistry::isKnownAttribute(attrName)) {
6464 InstanceInvalidationGuard guard(*this);
65  invalidateFilterPrimitiveParent(this);
 65 invalidateFilterPrimitiveParent(*this);
6666 return;
6767 }
6868

Source/WebCore/svg/SVGFEMorphologyElement.cpp

@@void SVGFEMorphologyElement::setRadius(float x, float y)
5252{
5353 m_radiusX->setBaseValInternal(x);
5454 m_radiusY->setBaseValInternal(y);
55  invalidate();
 55 setNeedsParentAndResourceInvalidation();
5656}
5757
5858void SVGFEMorphologyElement::parseAttribute(const QualifiedName& name, const AtomString& value)

@@bool SVGFEMorphologyElement::setFilterEffectAttribute(FilterEffect* effect, cons
9898
9999void SVGFEMorphologyElement::svgAttributeChanged(const QualifiedName& attrName)
100100{
101  if (attrName == SVGNames::operatorAttr || attrName == SVGNames::radiusAttr) {
 101 if (PropertyRegistry::isKnownAttribute(attrName)) {
102102 InstanceInvalidationGuard guard(*this);
103  primitiveAttributeChanged(attrName);
104  return;
105  }
106 
107  if (attrName == SVGNames::inAttr) {
108  InstanceInvalidationGuard guard(*this);
109  invalidate();
 103 if (attrName == SVGNames::inAttr)
 104 setNeedsParentAndResourceInvalidation();
 105 else
 106 primitiveAttributeChanged(attrName);
110107 return;
111108 }
112109

Source/WebCore/svg/SVGFEOffsetElement.cpp

@@void SVGFEOffsetElement::svgAttributeChanged(const QualifiedName& attrName)
7272{
7373 if (PropertyRegistry::isKnownAttribute(attrName)) {
7474 InstanceInvalidationGuard guard(*this);
75  invalidate();
 75 setNeedsParentAndResourceInvalidation();
7676 return;
7777 }
7878

Source/WebCore/svg/SVGFESpecularLightingElement.cpp

@@bool SVGFESpecularLightingElement::setFilterEffectAttribute(FilterEffect* effect
135135
136136void SVGFESpecularLightingElement::svgAttributeChanged(const QualifiedName& attrName)
137137{
138  if (attrName == SVGNames::surfaceScaleAttr || attrName == SVGNames::specularConstantAttr || attrName == SVGNames::specularExponentAttr || attrName == SVGNames::kernelUnitLengthAttr) {
 138 if (PropertyRegistry::isKnownAttribute(attrName)) {
139139 InstanceInvalidationGuard guard(*this);
140  primitiveAttributeChanged(attrName);
141  return;
142  }
143 
144  if (attrName == SVGNames::inAttr) {
145  InstanceInvalidationGuard guard(*this);
146  invalidate();
 140 if (attrName == SVGNames::inAttr)
 141 setNeedsParentAndResourceInvalidation();
 142 else
 143 primitiveAttributeChanged(attrName);
147144 return;
148145 }
149146

Source/WebCore/svg/SVGFETileElement.cpp

@@void SVGFETileElement::parseAttribute(const QualifiedName& name, const AtomStrin
5858
5959void SVGFETileElement::svgAttributeChanged(const QualifiedName& attrName)
6060{
61  if (attrName == SVGNames::inAttr) {
 61 if (PropertyRegistry::isKnownAttribute(attrName)) {
6262 InstanceInvalidationGuard guard(*this);
63  invalidate();
 63 setNeedsParentAndResourceInvalidation();
6464 return;
6565 }
6666

Source/WebCore/svg/SVGFilterElement.cpp

@@void SVGFilterElement::parseAttribute(const QualifiedName& name, const AtomStrin
9292
9393void SVGFilterElement::svgAttributeChanged(const QualifiedName& attrName)
9494{
95  if (PropertyRegistry::isAnimatedLengthAttribute(attrName)) {
 95 if (PropertyRegistry::isKnownAttribute(attrName)) {
9696 InstanceInvalidationGuard guard(*this);
97  invalidateSVGPresentationalHintStyle();
98  return;
 97 if (PropertyRegistry::isAnimatedLengthAttribute(attrName))
 98 setPresentationalHintStyleIsDirty();
 99 else
 100 setNeedsParentAndResourceInvalidation();
99101 }
100102
101  if (PropertyRegistry::isKnownAttribute(attrName) || SVGURIReference::isKnownAttribute(attrName)) {
102  if (auto* renderer = this->renderer())
103  renderer->setNeedsLayout();
104  return;
 103 if (SVGURIReference::isKnownAttribute(attrName)) {
 104 InstanceInvalidationGuard guard(*this);
 105 setNeedsParentAndResourceInvalidation();
105106 }
106107
107108 SVGElement::svgAttributeChanged(attrName);

Source/WebCore/svg/SVGFilterPrimitiveStandardAttributes.cpp

@@void SVGFilterPrimitiveStandardAttributes::svgAttributeChanged(const QualifiedNa
7878{
7979 if (PropertyRegistry::isKnownAttribute(attrName)) {
8080 InstanceInvalidationGuard guard(*this);
81  invalidate();
82  return;
 81 setNeedsParentAndResourceInvalidation();
8382 }
8483
8584 SVGElement::svgAttributeChanged(attrName);

@@void SVGFilterPrimitiveStandardAttributes::childrenChanged(const ChildChange& ch
9190
9291 if (change.source == ChildChange::Source::Parser)
9392 return;
94  invalidate();
 93 setNeedsParentAndResourceInvalidation();
9594}
9695
9796RenderPtr<RenderElement> SVGFilterPrimitiveStandardAttributes::createElementRenderer(RenderStyle&& style, const RenderTreePosition&)

@@bool SVGFilterPrimitiveStandardAttributes::rendererIsNeeded(const RenderStyle& s
107106 return false;
108107}
109108
110 void invalidateFilterPrimitiveParent(SVGElement* element)
 109void invalidateFilterPrimitiveParent(SVGElement& element)
111110{
112  if (!element)
113  return;
114 
115  RefPtr parent = element->parentNode();
116  if (!parent)
117  return;
118 
119  RenderElement* renderer = parent->renderer();
120  if (!renderer || !renderer->isSVGResourceFilterPrimitive())
 111 auto parent = element.parentNode();
 112 if (!is<SVGFilterPrimitiveStandardAttributes>(parent))
121113 return;
122114
123  RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer, false);
 115 downcast<SVGFilterPrimitiveStandardAttributes>(parent)->setNeedsParentAndResourceInvalidation();
124116}
125117
126118}

Source/WebCore/svg/SVGFilterPrimitiveStandardAttributes.h

@@protected:
6262 void svgAttributeChanged(const QualifiedName&) override;
6363 void childrenChanged(const ChildChange&) override;
6464
65  void invalidate();
6665 void primitiveAttributeChanged(const QualifiedName& attributeName);
6766
6867private:

@@private:
8180 Ref<SVGAnimatedString> m_result { SVGAnimatedString::create(this) };
8281};
8382
84 void invalidateFilterPrimitiveParent(SVGElement*);
85 
86 inline void SVGFilterPrimitiveStandardAttributes::invalidate()
87 {
88  if (auto* primitiveRenderer = renderer())
89  RenderSVGResource::markForLayoutAndParentResourceInvalidation(*primitiveRenderer);
90 }
 83void invalidateFilterPrimitiveParent(SVGElement&);
9184
9285inline void SVGFilterPrimitiveStandardAttributes::primitiveAttributeChanged(const QualifiedName& attribute)
9386{

Source/WebCore/svg/SVGForeignObjectElement.cpp

@@void SVGForeignObjectElement::parseAttribute(const QualifiedName& name, const At
7474
7575void SVGForeignObjectElement::svgAttributeChanged(const QualifiedName& attrName)
7676{
77  if (attrName == SVGNames::widthAttr || attrName == SVGNames::heightAttr) {
78  invalidateSVGPresentationalHintStyle();
79  return;
80  }
81 
82  if (attrName == SVGNames::xAttr || attrName == SVGNames::yAttr) {
83  updateRelativeLengthsInformation();
84  if (auto renderer = this->renderer())
85  RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer);
 77 if (PropertyRegistry::isKnownAttribute(attrName)) {
 78 InstanceInvalidationGuard guard(*this);
 79 if (attrName == SVGNames::widthAttr || attrName == SVGNames::heightAttr)
 80 setPresentationalHintStyleIsDirty();
 81 else {
 82 updateRelativeLengthsInformation();
 83 setNeedsParentAndResourceInvalidation();
 84 }
8685 return;
8786 }
8887

Source/WebCore/svg/SVGGeometryElement.cpp

@@void SVGGeometryElement::svgAttributeChanged(const QualifiedName& attrName)
149149{
150150 if (attrName == SVGNames::pathLengthAttr) {
151151 InstanceInvalidationGuard guard(*this);
152  if (auto* renderer = this->renderer())
153  RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer);
154  return;
 152 setNeedsParentAndResourceInvalidation();
155153 }
156154
157155 SVGGraphicsElement::svgAttributeChanged(attrName);

Source/WebCore/svg/SVGGradientElement.cpp

@@void SVGGradientElement::parseAttribute(const QualifiedName& name, const AtomStr
7777
7878void SVGGradientElement::svgAttributeChanged(const QualifiedName& attrName)
7979{
80  if (PropertyRegistry::isKnownAttribute(attrName) || SVGURIReference::isKnownAttribute(attrName)) {
 80 if (PropertyRegistry::isKnownAttribute(attrName)) {
8181 InstanceInvalidationGuard guard(*this);
82  if (RenderObject* object = renderer())
83  object->setNeedsLayout();
 82 setNeedsParentAndResourceInvalidation();
 83 return;
 84 }
 85
 86 if (SVGURIReference::isKnownAttribute(attrName)) {
 87 InstanceInvalidationGuard guard(*this);
 88 setNeedsParentAndResourceInvalidation();
8489 return;
8590 }
8691

Source/WebCore/svg/SVGGraphicsElement.cpp

@@void SVGGraphicsElement::parseAttribute(const QualifiedName& name, const AtomStr
132132
133133void SVGGraphicsElement::svgAttributeChanged(const QualifiedName& attrName)
134134{
135  if (attrName == SVGNames::transformAttr) {
 135 if (PropertyRegistry::isKnownAttribute(attrName)) {
 136 ASSERT(attrName == SVGNames::transformAttr);
136137 InstanceInvalidationGuard guard(*this);
137 
138  if (auto renderer = this->renderer()) {
 138 if (auto renderer = this->renderer())
139139 renderer->setNeedsTransformUpdate();
140  RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer);
141  }
142 
 140 setNeedsParentAndResourceInvalidation();
143141 return;
144142 }
145143

Source/WebCore/svg/SVGImageElement.cpp

@@void SVGImageElement::svgAttributeChanged(const QualifiedName& attrName)
9898 updateRelativeLengthsInformation();
9999
100100 if (auto* renderer = this->renderer()) {
101  if (downcast<RenderSVGImage>(*renderer).updateImageViewport())
102  RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer);
 101 if (!downcast<RenderSVGImage>(*renderer).updateImageViewport())
 102 return;
 103 setNeedsParentAndResourceInvalidation();
103104 }
104105 return;
105106 }
106107
107108 if (attrName == SVGNames::widthAttr || attrName == SVGNames::heightAttr) {
108109 InstanceInvalidationGuard guard(*this);
109  invalidateSVGPresentationalHintStyle();
 110 setPresentationalHintStyleIsDirty();
110111 return;
111112 }
112113
113114 if (attrName == SVGNames::preserveAspectRatioAttr) {
114115 InstanceInvalidationGuard guard(*this);
115  if (auto* renderer = this->renderer())
116  RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer);
 116 setNeedsParentAndResourceInvalidation();
117117 return;
118118 }
119119

Source/WebCore/svg/SVGLineElement.cpp

@@void SVGLineElement::svgAttributeChanged(const QualifiedName& attrName)
7272{
7373 if (PropertyRegistry::isKnownAttribute(attrName)) {
7474 InstanceInvalidationGuard guard(*this);
75  updateRelativeLengthsInformation();
76 
77  if (auto* renderer = downcast<LegacyRenderSVGShape>(this->renderer())) {
 75 if (auto* renderer = downcast<LegacyRenderSVGShape>(this->renderer()))
7876 renderer->setNeedsShapeUpdate();
79  RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer);
80  }
 77 updateRelativeLengthsInformation();
 78 setNeedsParentAndResourceInvalidation();
8179 return;
8280 }
8381

Source/WebCore/svg/SVGLinearGradientElement.cpp

@@void SVGLinearGradientElement::svgAttributeChanged(const QualifiedName& attrName
8383 if (PropertyRegistry::isKnownAttribute(attrName)) {
8484 InstanceInvalidationGuard guard(*this);
8585 updateRelativeLengthsInformation();
86  if (RenderObject* object = renderer())
87  object->setNeedsLayout();
 86 setNeedsParentAndResourceInvalidation();
8887 return;
8988 }
9089

Source/WebCore/svg/SVGMarkerElement.cpp

@@void SVGMarkerElement::svgAttributeChanged(const QualifiedName& attrName)
9898 InstanceInvalidationGuard guard(*this);
9999 if (PropertyRegistry::isAnimatedLengthAttribute(attrName))
100100 updateRelativeLengthsInformation();
101  if (RenderObject* object = renderer())
102  object->setNeedsLayout();
 101 setNeedsParentAndResourceInvalidation();
103102 return;
104103 }
105 
 104
106105 if (SVGFitToViewBox::isKnownAttribute(attrName)) {
107  if (RenderObject* object = renderer())
108  object->setNeedsLayout();
 106 InstanceInvalidationGuard guard(*this);
 107 setNeedsParentAndResourceInvalidation();
109108 return;
110109 }
111110

Source/WebCore/svg/SVGMaskElement.cpp

@@void SVGMaskElement::parseAttribute(const QualifiedName& name, const AtomString&
9898
9999void SVGMaskElement::svgAttributeChanged(const QualifiedName& attrName)
100100{
101  if (PropertyRegistry::isAnimatedLengthAttribute(attrName)) {
102  InstanceInvalidationGuard guard(*this);
103  invalidateSVGPresentationalHintStyle();
104  return;
105  }
106 
107101 if (PropertyRegistry::isKnownAttribute(attrName)) {
108  if (auto* renderer = this->renderer())
109  renderer->setNeedsLayout();
 102 InstanceInvalidationGuard guard(*this);
 103 if (PropertyRegistry::isAnimatedLengthAttribute(attrName))
 104 setPresentationalHintStyleIsDirty();
 105 else
 106 setNeedsParentAndResourceInvalidation();
110107 return;
111108 }
112109

Source/WebCore/svg/SVGPathElement.cpp

@@void SVGPathElement::parseAttribute(const QualifiedName& name, const AtomString&
6565
6666void SVGPathElement::svgAttributeChanged(const QualifiedName& attrName)
6767{
68  if (attrName == SVGNames::dAttr) {
 68 if (PropertyRegistry::isKnownAttribute(attrName)) {
6969 InstanceInvalidationGuard guard(*this);
70  invalidateMPathDependencies();
71 
72  if (auto* renderer = downcast<RenderSVGPath>(this->renderer())) {
 70 if (auto* renderer = downcast<RenderSVGPath>(this->renderer()))
7371 renderer->setNeedsShapeUpdate();
74  RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer);
75  }
76 
 72 invalidateMPathDependencies();
 73 setNeedsParentAndResourceInvalidation();
7774 return;
7875 }
7976

Source/WebCore/svg/SVGPatternElement.cpp

@@void SVGPatternElement::parseAttribute(const QualifiedName& name, const AtomStri
110110
111111void SVGPatternElement::svgAttributeChanged(const QualifiedName& attrName)
112112{
113  if (PropertyRegistry::isAnimatedLengthAttribute(attrName)) {
 113 if (PropertyRegistry::isKnownAttribute(attrName)) {
114114 InstanceInvalidationGuard guard(*this);
115  invalidateSVGPresentationalHintStyle();
 115 if (PropertyRegistry::isAnimatedLengthAttribute(attrName))
 116 setPresentationalHintStyleIsDirty();
 117 else
 118 setNeedsParentAndResourceInvalidation();
116119 return;
117120 }
118121
119  if (PropertyRegistry::isKnownAttribute(attrName) || SVGFitToViewBox::isKnownAttribute(attrName) || SVGURIReference::isKnownAttribute(attrName)) {
120  if (RenderObject* object = renderer())
121  object->setNeedsLayout();
 122 if (SVGFitToViewBox::isKnownAttribute(attrName) || SVGURIReference::isKnownAttribute(attrName)) {
 123 InstanceInvalidationGuard guard(*this);
 124 setNeedsParentAndResourceInvalidation();
122125 return;
123126 }
124127

Source/WebCore/svg/SVGPolyElement.cpp

@@void SVGPolyElement::parseAttribute(const QualifiedName& name, const AtomString&
5555
5656void SVGPolyElement::svgAttributeChanged(const QualifiedName& attrName)
5757{
58  if (attrName == SVGNames::pointsAttr) {
59  if (auto* renderer = downcast<RenderSVGPath>(this->renderer())) {
60  InstanceInvalidationGuard guard(*this);
 58 if (PropertyRegistry::isKnownAttribute(attrName)) {
 59 ASSERT(attrName == SVGNames::pointsAttr);
 60 InstanceInvalidationGuard guard(*this);
 61 if (auto* renderer = downcast<RenderSVGPath>(this->renderer()))
6162 renderer->setNeedsShapeUpdate();
62  RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer);
63  }
 63 setNeedsParentAndResourceInvalidation();
6464 return;
6565 }
6666

Source/WebCore/svg/SVGRadialGradientElement.cpp

@@void SVGRadialGradientElement::svgAttributeChanged(const QualifiedName& attrName
8989 if (PropertyRegistry::isKnownAttribute(attrName)) {
9090 InstanceInvalidationGuard guard(*this);
9191 updateRelativeLengthsInformation();
92  if (RenderObject* object = renderer())
93  object->setNeedsLayout();
 92 setNeedsParentAndResourceInvalidation();
9493 return;
9594 }
9695

Source/WebCore/svg/SVGRectElement.cpp

@@void SVGRectElement::parseAttribute(const QualifiedName& name, const AtomString&
7979void SVGRectElement::svgAttributeChanged(const QualifiedName& attrName)
8080{
8181 if (PropertyRegistry::isKnownAttribute(attrName)) {
 82 ASSERT(PropertyRegistry::isAnimatedLengthAttribute(attrName));
8283 InstanceInvalidationGuard guard(*this);
83  invalidateSVGPresentationalHintStyle();
 84 setPresentationalHintStyleIsDirty();
8485 return;
8586 }
8687

Source/WebCore/svg/SVGSVGElement.cpp

@@void SVGSVGElement::svgAttributeChanged(const QualifiedName& attrName)
209209{
210210 if (PropertyRegistry::isKnownAttribute(attrName)) {
211211 InstanceInvalidationGuard guard(*this);
212  invalidateSVGPresentationalHintStyle();
 212 setPresentationalHintStyleIsDirty();
213213
214214 if (auto* renderer = this->renderer())
215215 RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer);

@@void SVGSVGElement::svgAttributeChanged(const QualifiedName& attrName)
217217 }
218218
219219 if (SVGFitToViewBox::isKnownAttribute(attrName)) {
220  if (auto* renderer = this->renderer()) {
 220 if (auto* renderer = this->renderer())
221221 renderer->setNeedsTransformUpdate();
222  RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer);
223  }
224  return;
 222 setNeedsParentAndResourceInvalidation();
225223 }
226224
227225 SVGGraphicsElement::svgAttributeChanged(attrName);

@@SVGSVGElement* SVGSVGElement::findRootAnchor(StringView fragmentIdentifier) cons
583581
584582bool SVGSVGElement::scrollToFragment(StringView fragmentIdentifier)
585583{
586  auto renderer = this->renderer();
587584 auto view = m_viewSpec;
588585 if (view)
589586 view->reset();

@@bool SVGSVGElement::scrollToFragment(StringView fragmentIdentifier)
593590
594591 if (fragmentIdentifier.startsWith("xpointer(")) {
595592 // FIXME: XPointer references are ignored (https://bugs.webkit.org/show_bug.cgi?id=17491)
596  if (renderer && hadUseCurrentView)
597  RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer);
 593 if (hadUseCurrentView)
 594 setNeedsParentAndResourceInvalidation();
598595 return false;
599596 }
600597

@@bool SVGSVGElement::scrollToFragment(StringView fragmentIdentifier)
605602 m_useCurrentView = true;
606603 else
607604 view->reset();
608  if (renderer && (hadUseCurrentView || m_useCurrentView))
609  RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer);
 605 if ((hadUseCurrentView || m_useCurrentView))
 606 setNeedsParentAndResourceInvalidation();
610607 return m_useCurrentView;
611608 }
612609

@@bool SVGSVGElement::scrollToFragment(StringView fragmentIdentifier)
630627 }
631628
632629 rootElement->inheritViewAttributes(*viewElement);
633  if (auto* renderer = rootElement->renderer())
634  RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer);
 630 rootElement->setNeedsParentAndResourceInvalidation();
635631 m_currentViewFragmentIdentifier = fragmentIdentifier.toString();
636632 return true;
637633 }

@@void SVGSVGElement::resetScrollAnchor()
661657 }
662658
663659 m_useCurrentView = false;
664  if (renderer())
665  RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer());
 660 setNeedsParentAndResourceInvalidation();
666661}
667662
668663void SVGSVGElement::inheritViewAttributes(const SVGViewElement& viewElement)

Source/WebCore/svg/SVGStopElement.cpp

@@void SVGStopElement::parseAttribute(const QualifiedName& name, const AtomString&
6464
6565void SVGStopElement::svgAttributeChanged(const QualifiedName& attrName)
6666{
67  if (attrName == SVGNames::offsetAttr) {
68  if (auto renderer = this->renderer()) {
69  InstanceInvalidationGuard guard(*this);
70  RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer);
71  }
 67 if (PropertyRegistry::isKnownAttribute(attrName)) {
 68 ASSERT(attrName == SVGNames::offsetAttr);
 69 InstanceInvalidationGuard guard(*this);
 70 setNeedsParentAndResourceInvalidation();
7271 return;
7372 }
7473

Source/WebCore/svg/SVGTRefElement.cpp

@@void SVGTRefElement::svgAttributeChanged(const QualifiedName& attrName)
184184 if (SVGURIReference::isKnownAttribute(attrName)) {
185185 InstanceInvalidationGuard guard(*this);
186186 buildPendingResource();
187  if (auto renderer = this->renderer())
188  RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer);
 187 setNeedsParentAndResourceInvalidation();
189188 return;
190189 }
191190

Source/WebCore/svg/SVGTextContentElement.cpp

@@void SVGTextContentElement::parseAttribute(const QualifiedName& name, const Atom
180180void SVGTextContentElement::svgAttributeChanged(const QualifiedName& attrName)
181181{
182182 if (PropertyRegistry::isKnownAttribute(attrName)) {
 183 InstanceInvalidationGuard guard(*this);
183184 if (attrName == SVGNames::textLengthAttr)
184185 m_specifiedTextLength = m_textLength->baseVal()->value();
185 
186  if (auto renderer = this->renderer()) {
187  InstanceInvalidationGuard guard(*this);
188  RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer);
189  }
 186 setNeedsParentAndResourceInvalidation();
190187 return;
191188 }
192189

Source/WebCore/svg/SVGTextPathElement.cpp

@@void SVGTextPathElement::svgAttributeChanged(const QualifiedName& attrName)
8989{
9090 if (PropertyRegistry::isKnownAttribute(attrName)) {
9191 InstanceInvalidationGuard guard(*this);
92 
9392 if (attrName == SVGNames::startOffsetAttr)
9493 updateRelativeLengthsInformation();
95 
96  if (auto renderer = this->renderer())
97  RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer);
98  return;
 94 setNeedsParentAndResourceInvalidation();
9995 }
10096
10197 if (SVGURIReference::isKnownAttribute(attrName)) {
 98 InstanceInvalidationGuard guard(*this);
10299 buildPendingResource();
103  if (auto renderer = this->renderer())
104  RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer);
 100 setNeedsParentAndResourceInvalidation();
105101 return;
106102 }
107103

Source/WebCore/svg/SVGTextPositioningElement.cpp

@@void SVGTextPositioningElement::svgAttributeChanged(const QualifiedName& attrNam
9999{
100100 if (PropertyRegistry::isKnownAttribute(attrName)) {
101101 InstanceInvalidationGuard guard(*this);
102 
103102 if (attrName != SVGNames::rotateAttr)
104103 updateRelativeLengthsInformation();
105104
106  if (auto renderer = this->renderer()) {
107  if (auto* textAncestor = RenderSVGText::locateRenderSVGTextAncestor(*renderer))
108  textAncestor->setNeedsPositioningValuesUpdate();
109  RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer);
110  }
 105 if (auto* textAncestor = renderer() ? RenderSVGText::locateRenderSVGTextAncestor(*renderer()) : nullptr)
 106 textAncestor->setNeedsPositioningValuesUpdate();
111107
 108 setNeedsParentAndResourceInvalidation();
112109 return;
113110 }
114111

Source/WebCore/svg/SVGUseElement.cpp

@@void SVGUseElement::transferSizeAttributesToTargetClone(SVGElement& shadowElemen
156156
157157void SVGUseElement::svgAttributeChanged(const QualifiedName& attrName)
158158{
159  InstanceInvalidationGuard guard(*this);
160 
161159 if (PropertyRegistry::isKnownAttribute(attrName)) {
162  updateRelativeLengthsInformation();
163160 if (attrName == SVGNames::widthAttr || attrName == SVGNames::heightAttr) {
164161 // FIXME: It's unnecessarily inefficient to update both width and height each time either is changed.
165162 if (auto targetClone = this->targetClone())
166163 transferSizeAttributesToTargetClone(*targetClone);
167164 }
168  if (auto* renderer = this->renderer())
169  RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer);
 165
 166 InstanceInvalidationGuard guard(*this);
 167 updateRelativeLengthsInformation();
 168 setNeedsParentAndResourceInvalidation();
170169 return;
171170 }
172171
173172 if (SVGURIReference::isKnownAttribute(attrName)) {
 173 InstanceInvalidationGuard guard(*this);
174174 updateExternalDocument();
175175 invalidateShadowTree();
176176 return;

Source/WebCore/svg/SVGViewElement.cpp

@@void SVGViewElement::parseAttribute(const QualifiedName& name, const AtomString&
5454
5555void SVGViewElement::svgAttributeChanged(const QualifiedName& attrName)
5656{
57  // We ignore changes to SVGNames::viewTargetAttr, which is deprecated and unused in WebCore.
58  if (PropertyRegistry::isKnownAttribute(attrName))
59  return;
60 
6157 if (SVGFitToViewBox::isKnownAttribute(attrName)) {
62  if (m_targetElement) {
63  m_targetElement->inheritViewAttributes(*this);
64  if (auto* renderer = m_targetElement->renderer())
65  RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer);
66  }
67 
 58 if (!m_targetElement)
 59 return;
 60 m_targetElement->inheritViewAttributes(*this);
 61
 62 InstanceInvalidationGuard guard(*m_targetElement);
 63 m_targetElement->setNeedsParentAndResourceInvalidation();
6864 return;
6965 }
7066

Source/WebCore/svg/properties/SVGAttributeAnimator.cpp

@@bool SVGAttributeAnimator::isAnimatedStylePropertyAniamtor(const SVGElement& tar
4040void SVGAttributeAnimator::invalidateStyle(SVGElement& targetElement)
4141{
4242 SVGElement::InstanceInvalidationGuard guard(targetElement);
43  targetElement.invalidateSVGPresentationalHintStyle();
 43 targetElement.setPresentationalHintStyleIsDirty();
4444}
4545
4646void SVGAttributeAnimator::applyAnimatedStylePropertyChange(SVGElement& element, CSSPropertyID id, const String& value)