WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-230296-20220323212113.patch (text/plain), 52.43 KB, created by
Rob Buis
on 2022-03-23 14:21:15 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Rob Buis
Created:
2022-03-23 14:21:15 PDT
Size:
52.43 KB
patch
obsolete
>Subversion Revision: 291765 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index ffb33a7b45f3f786f6019f6fc1215c5ab9a35af0..85bf99cba9bfd8a33c290b3c6e379a7f5baf5f01 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,129 @@ >+2022-03-23 Rob Buis <rbuis@igalia.com> >+ >+ setNeedsLayout() should not be called when changing the SVG properties >+ https://bugs.webkit.org/show_bug.cgi?id=230296 >+ >+ Reviewed by Said Abou-Hallawa. >+ >+ Make SVG not call setNeedsLayout() from outside RenderTreeUpdater::updateRenderTree() when an attribute changes. >+ This ensures there will not be a dirty rendering tree immediately after updating it. >+ >+ The patch also tries to avoid invalidate wording since this is quite generic. >+ >+ Based on the initial patch by Said Abou-Hallawa. >+ >+ * dom/ElementData.h: >+ (WebCore::ElementData::svgResourcesInAncestorChainAreDirty const): >+ (WebCore::ElementData::setSVGResourcesInAncestorChainAreDirty const): >+ * rendering/updating/RenderTreeUpdater.cpp: >+ (WebCore::RenderTreeUpdater::updateRenderTree): >+ * svg/SVGAnimateMotionElement.cpp: >+ (WebCore::SVGAnimateMotionElement::applyResultsToTarget): >+ * svg/SVGClipPathElement.cpp: >+ (WebCore::SVGClipPathElement::svgAttributeChanged): >+ (WebCore::SVGClipPathElement::childrenChanged): >+ * svg/SVGComponentTransferFunctionElement.cpp: >+ (WebCore::SVGComponentTransferFunctionElement::svgAttributeChanged): >+ * svg/SVGElement.cpp: >+ (WebCore::SVGElement::setSVGResourcesInAncestorChainAreDirty): >+ (WebCore::SVGElement::invalidateSVGResourcesInAncestorChainIfNeeded): >+ * svg/SVGElement.h: >+ * svg/SVGElementInlines.h: >+ (WebCore::SVGElement::setPresentationalHintStyleIsDirty): >+ * svg/SVGFEBlendElement.cpp: >+ (WebCore::SVGFEBlendElement::svgAttributeChanged): >+ * svg/SVGFEColorMatrixElement.cpp: >+ (WebCore::SVGFEColorMatrixElement::svgAttributeChanged): >+ * svg/SVGFECompositeElement.cpp: >+ (WebCore::SVGFECompositeElement::svgAttributeChanged): >+ * svg/SVGFEConvolveMatrixElement.cpp: >+ (WebCore::SVGFEConvolveMatrixElement::setOrder): >+ (WebCore::SVGFEConvolveMatrixElement::setKernelUnitLength): >+ (WebCore::SVGFEConvolveMatrixElement::svgAttributeChanged): >+ * svg/SVGFEDiffuseLightingElement.cpp: >+ (WebCore::SVGFEDiffuseLightingElement::svgAttributeChanged): >+ * svg/SVGFEDisplacementMapElement.cpp: >+ (WebCore::SVGFEDisplacementMapElement::svgAttributeChanged): >+ * svg/SVGFEDropShadowElement.cpp: >+ (WebCore::SVGFEDropShadowElement::setStdDeviation): >+ (WebCore::SVGFEDropShadowElement::svgAttributeChanged): >+ * svg/SVGFEGaussianBlurElement.cpp: >+ (WebCore::SVGFEGaussianBlurElement::setStdDeviation): >+ (WebCore::SVGFEGaussianBlurElement::svgAttributeChanged): >+ * svg/SVGFEImageElement.cpp: >+ (WebCore::SVGFEImageElement::buildPendingResource): >+ (WebCore::SVGFEImageElement::svgAttributeChanged): >+ * svg/SVGFELightElement.cpp: >+ (WebCore::SVGFELightElement::childrenChanged): >+ * svg/SVGFEMergeNodeElement.cpp: >+ (WebCore::SVGFEMergeNodeElement::svgAttributeChanged): >+ * svg/SVGFEMorphologyElement.cpp: >+ (WebCore::SVGFEMorphologyElement::setRadius): >+ (WebCore::SVGFEMorphologyElement::svgAttributeChanged): >+ * svg/SVGFEOffsetElement.cpp: >+ (WebCore::SVGFEOffsetElement::svgAttributeChanged): >+ * svg/SVGFESpecularLightingElement.cpp: >+ (WebCore::SVGFESpecularLightingElement::svgAttributeChanged): >+ * svg/SVGFETileElement.cpp: >+ (WebCore::SVGFETileElement::svgAttributeChanged): >+ * svg/SVGFilterElement.cpp: >+ (WebCore::SVGFilterElement::svgAttributeChanged): >+ (WebCore::SVGFilterElement::childrenChanged): >+ * svg/SVGFilterPrimitiveStandardAttributes.cpp: >+ (WebCore::SVGFilterPrimitiveStandardAttributes::svgAttributeChanged): >+ (WebCore::SVGFilterPrimitiveStandardAttributes::childrenChanged): >+ (WebCore::SVGFilterPrimitiveStandardAttributes::invalidateFilterPrimitiveParent): >+ (WebCore::invalidateFilterPrimitiveParent): Deleted. >+ * svg/SVGFilterPrimitiveStandardAttributes.h: >+ (WebCore::SVGFilterPrimitiveStandardAttributes::invalidate): Deleted. >+ * svg/SVGForeignObjectElement.cpp: >+ (WebCore::SVGForeignObjectElement::svgAttributeChanged): >+ * svg/SVGGeometryElement.cpp: >+ (WebCore::SVGGeometryElement::svgAttributeChanged): >+ * svg/SVGGradientElement.cpp: >+ (WebCore::SVGGradientElement::svgAttributeChanged): >+ (WebCore::SVGGradientElement::childrenChanged): >+ * svg/SVGGraphicsElement.cpp: >+ (WebCore::SVGGraphicsElement::svgAttributeChanged): >+ * svg/SVGImageElement.cpp: >+ (WebCore::SVGImageElement::svgAttributeChanged): >+ * svg/SVGLineElement.cpp: >+ (WebCore::SVGLineElement::svgAttributeChanged): >+ * svg/SVGLinearGradientElement.cpp: >+ (WebCore::SVGLinearGradientElement::svgAttributeChanged): >+ * svg/SVGMarkerElement.cpp: >+ (WebCore::SVGMarkerElement::svgAttributeChanged): >+ (WebCore::SVGMarkerElement::childrenChanged): >+ * svg/SVGMaskElement.cpp: >+ (WebCore::SVGMaskElement::svgAttributeChanged): >+ (WebCore::SVGMaskElement::childrenChanged): >+ * svg/SVGPathElement.cpp: >+ (WebCore::SVGPathElement::svgAttributeChanged): >+ * svg/SVGPatternElement.cpp: >+ (WebCore::SVGPatternElement::svgAttributeChanged): >+ (WebCore::SVGPatternElement::childrenChanged): >+ * svg/SVGPolyElement.cpp: >+ (WebCore::SVGPolyElement::svgAttributeChanged): >+ * svg/SVGRadialGradientElement.cpp: >+ (WebCore::SVGRadialGradientElement::svgAttributeChanged): >+ * svg/SVGSVGElement.cpp: >+ (WebCore::SVGSVGElement::updateCurrentTranslate): >+ (WebCore::SVGSVGElement::svgAttributeChanged): >+ * 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): >+ * svg/SVGViewElement.cpp: >+ (WebCore::SVGViewElement::svgAttributeChanged): >+ > 2022-03-23 Jer Noble <jer.noble@apple.com> > > [Cocoa] MSE-backed videos fail to play in Captive Portal mode >diff --git a/Source/WebCore/dom/ElementData.h b/Source/WebCore/dom/ElementData.h >index 5116e320897f8db528bb114b79682e9de6cdcf8e..d64b308dfbbbacb6aefdca28a62145b4e70899f7 100644 >--- a/Source/WebCore/dom/ElementData.h >+++ b/Source/WebCore/dom/ElementData.h >@@ -125,13 +125,15 @@ private: > mutable uint32_t m_arraySizeAndFlags; > > static const uint32_t s_arraySize = 27; >- static const uint32_t s_flagCount = 5; >+ static const uint32_t s_flagCount = 6; > static const uint32_t s_flagIsUnique = 1; > static const uint32_t s_flagHasNameAttribute = 1 << 1; > static const uint32_t s_flagPresentationalHintStyleIsDirty = 1 << 2; > static const uint32_t s_flagStyleAttributeIsDirty = 1 << 3; > static const uint32_t s_flagAnimatedSVGAttributesAreDirty = 1 << 4; >+ static const uint32_t s_flagSVGResourcesInAncestorChainAreDirty = 1 << 5; > static const uint32_t s_flagsMask = (1 << s_flagCount) - 1; >+ // FIXME: could the SVG specific flags go to some SVG class? > > inline void updateFlag(uint32_t flag, bool set) const > { >@@ -160,6 +162,9 @@ protected: > bool animatedSVGAttributesAreDirty() const { return m_arraySizeAndFlags & s_flagAnimatedSVGAttributesAreDirty; } > void setAnimatedSVGAttributesAreDirty(bool dirty) const { updateFlag(s_flagAnimatedSVGAttributesAreDirty, dirty); } > >+ bool svgResourcesInAncestorChainAreDirty() const { return m_arraySizeAndFlags & s_flagSVGResourcesInAncestorChainAreDirty; } >+ void setSVGResourcesInAncestorChainAreDirty(bool dirty) const { updateFlag(s_flagSVGResourcesInAncestorChainAreDirty, dirty); } >+ > mutable RefPtr<StyleProperties> m_inlineStyle; > mutable SpaceSplitString m_classNames; > mutable AtomString m_idForStyleResolution; >diff --git a/Source/WebCore/rendering/updating/RenderTreeUpdater.cpp b/Source/WebCore/rendering/updating/RenderTreeUpdater.cpp >index 7151e062e8df3854b12311d9368e7d14a6778f94..5d4f648d9607dc0ab3e07f4afc3c65a5be81feef 100644 >--- a/Source/WebCore/rendering/updating/RenderTreeUpdater.cpp >+++ b/Source/WebCore/rendering/updating/RenderTreeUpdater.cpp >@@ -45,6 +45,7 @@ > #include "RenderTreeUpdaterGeneratedContent.h" > #include "RenderView.h" > #include "RuntimeEnabledFeatures.h" >+#include "SVGElement.h" > #include "StyleResolver.h" > #include "StyleTreeResolver.h" > #include "TextManipulationController.h" >@@ -192,6 +193,9 @@ void RenderTreeUpdater::updateRenderTree(ContainerNode& root) > if (elementUpdate) > updateElementRenderer(element, *elementUpdate); > >+ if (is<SVGElement>(element)) >+ downcast<SVGElement>(element).invalidateSVGResourcesInAncestorChainIfNeeded(); >+ > storePreviousRenderer(element); > > bool mayHaveRenderedDescendants = element.renderer() || (element.hasDisplayContents() && shouldCreateRenderer(element, renderTreePosition().parent())); >diff --git a/Source/WebCore/svg/SVGAnimateMotionElement.cpp b/Source/WebCore/svg/SVGAnimateMotionElement.cpp >index f95272a4d5d8a89b560c6dea80f689c01f1a666e..4b6c530be9dcd0ef4e520a8f10f2bc46a135fdab 100644 >--- a/Source/WebCore/svg/SVGAnimateMotionElement.cpp >+++ b/Source/WebCore/svg/SVGAnimateMotionElement.cpp >@@ -250,10 +250,13 @@ void SVGAnimateMotionElement::applyResultsToTarget() > if (!targetElement) > return; > >- if (RenderElement* renderer = targetElement->renderer()) { >- renderer->setNeedsTransformUpdate(); >- RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer); >- } >+ auto updateTargetElement = [](SVGElement& element) { >+ if (auto renderer = element.renderer()) >+ renderer->setNeedsTransformUpdate(); >+ element.setSVGResourcesInAncestorChainAreDirty(); >+ }; >+ >+ updateTargetElement(*targetElement); > > AffineTransform* targetSupplementalTransform = targetElement->supplementalTransform(); > if (!targetSupplementalTransform) >@@ -265,10 +268,7 @@ void SVGAnimateMotionElement::applyResultsToTarget() > if (!transform || *transform == *targetSupplementalTransform) > continue; > *transform = *targetSupplementalTransform; >- if (RenderElement* renderer = instance->renderer()) { >- renderer->setNeedsTransformUpdate(); >- RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer); >- } >+ updateTargetElement(instance); > } > } > >diff --git a/Source/WebCore/svg/SVGClipPathElement.cpp b/Source/WebCore/svg/SVGClipPathElement.cpp >index b4e79958c5b130355f79994b1183c53f92ced69b..afd60ebe088e43d77a6868a5c5467f4d18500564 100644 >--- a/Source/WebCore/svg/SVGClipPathElement.cpp >+++ b/Source/WebCore/svg/SVGClipPathElement.cpp >@@ -67,8 +67,7 @@ void SVGClipPathElement::svgAttributeChanged(const QualifiedName& attrName) > if (PropertyRegistry::isKnownAttribute(attrName)) { > InstanceInvalidationGuard guard(*this); > >- if (RenderObject* object = renderer()) >- object->setNeedsLayout(); >+ setSVGResourcesInAncestorChainAreDirty(); > return; > } > >@@ -82,8 +81,7 @@ void SVGClipPathElement::childrenChanged(const ChildChange& change) > if (change.source == ChildChange::Source::Parser) > return; > >- if (RenderObject* object = renderer()) >- object->setNeedsLayout(); >+ setSVGResourcesInAncestorChainAreDirty(); > } > > RenderPtr<RenderElement> SVGClipPathElement::createElementRenderer(RenderStyle&& style, const RenderTreePosition&) >diff --git a/Source/WebCore/svg/SVGComponentTransferFunctionElement.cpp b/Source/WebCore/svg/SVGComponentTransferFunctionElement.cpp >index 0cd4fd41e53ad15828328e3b13f82ee6065e2d9d..bb6e525632d7583ef1f8beeecb34b6f1ec72f530 100644 >--- a/Source/WebCore/svg/SVGComponentTransferFunctionElement.cpp >+++ b/Source/WebCore/svg/SVGComponentTransferFunctionElement.cpp >@@ -92,7 +92,7 @@ void SVGComponentTransferFunctionElement::svgAttributeChanged(const QualifiedNam > { > if (PropertyRegistry::isKnownAttribute(attrName)) { > InstanceInvalidationGuard guard(*this); >- invalidateFilterPrimitiveParent(this); >+ SVGFilterPrimitiveStandardAttributes::invalidateFilterPrimitiveParent(this); > return; > } > >diff --git a/Source/WebCore/svg/SVGElement.cpp b/Source/WebCore/svg/SVGElement.cpp >index 424fb0832913c8d9e682e7dc3feadf192cc0c420..414815085dbcaa394dc11f9050ed38c70b814b53 100644 >--- a/Source/WebCore/svg/SVGElement.cpp >+++ b/Source/WebCore/svg/SVGElement.cpp >@@ -883,6 +883,22 @@ void SVGElement::collectPresentationalHintsForAttribute(const QualifiedName& nam > addPropertyToPresentationalHintStyle(style, propertyID, value); > } > >+void SVGElement::setSVGResourcesInAncestorChainAreDirty() >+{ >+ ensureUniqueElementData().setSVGResourcesInAncestorChainAreDirty(true); >+ invalidateStyle(); >+} >+ >+void SVGElement::invalidateSVGResourcesInAncestorChainIfNeeded() >+{ >+ if (!elementData() || !elementData()->svgResourcesInAncestorChainAreDirty()) >+ return; >+ >+ if (auto renderer = this->renderer()) >+ RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer); >+ elementData()->setSVGResourcesInAncestorChainAreDirty(false); >+} >+ > void SVGElement::svgAttributeChanged(const QualifiedName& attrName) > { > CSSPropertyID propId = cssPropertyIdForSVGAttributeName(attrName); >diff --git a/Source/WebCore/svg/SVGElement.h b/Source/WebCore/svg/SVGElement.h >index fc6614bd469329a9c464df9e9346f879d977bfd5..f78d21134898f0c2751bb34aabef3c2c035fb827 100644 >--- a/Source/WebCore/svg/SVGElement.h >+++ b/Source/WebCore/svg/SVGElement.h >@@ -84,6 +84,8 @@ public: > > inline void setAnimatedSVGAttributesAreDirty(); > inline void setPresentationalHintStyleIsDirty(); >+ void setSVGResourcesInAncestorChainAreDirty(); >+ void invalidateSVGResourcesInAncestorChainIfNeeded(); > > // The instances of an element are clones made in shadow trees to implement <use>. > const WeakHashSet<SVGElement>& instances() const; >diff --git a/Source/WebCore/svg/SVGElementInlines.h b/Source/WebCore/svg/SVGElementInlines.h >index b4c177f89f1bdf1e17361fd1d6ed9263b0efa2a8..30d83623f47e4ac7a553d0f57cc45125aeb43415 100644 >--- a/Source/WebCore/svg/SVGElementInlines.h >+++ b/Source/WebCore/svg/SVGElementInlines.h >@@ -38,7 +38,6 @@ inline void SVGElement::setAnimatedSVGAttributesAreDirty() > inline void SVGElement::setPresentationalHintStyleIsDirty() > { > ensureUniqueElementData().setPresentationalHintStyleIsDirty(true); >- // Trigger style recalculation for "elements as resource" (e.g. referenced by feImage). > invalidateStyle(); > } > >diff --git a/Source/WebCore/svg/SVGFEBlendElement.cpp b/Source/WebCore/svg/SVGFEBlendElement.cpp >index 01c6400e2344c935ef2876646443377e88acd462..0a1b43a7ad352f92a8e917e1aea82ad51291b959 100644 >--- a/Source/WebCore/svg/SVGFEBlendElement.cpp >+++ b/Source/WebCore/svg/SVGFEBlendElement.cpp >@@ -89,7 +89,7 @@ void SVGFEBlendElement::svgAttributeChanged(const QualifiedName& attrName) > primitiveAttributeChanged(attrName); > else { > ASSERT(attrName == SVGNames::inAttr || attrName == SVGNames::in2Attr); >- invalidate(); >+ setSVGResourcesInAncestorChainAreDirty(); > } > return; > } >diff --git a/Source/WebCore/svg/SVGFEColorMatrixElement.cpp b/Source/WebCore/svg/SVGFEColorMatrixElement.cpp >index a2b8c607457448c85521c3bc12d6f939ca05c6c2..92c700364f89ebc4d2f84e40357112bb2acc6d65 100644 >--- a/Source/WebCore/svg/SVGFEColorMatrixElement.cpp >+++ b/Source/WebCore/svg/SVGFEColorMatrixElement.cpp >@@ -87,7 +87,7 @@ void SVGFEColorMatrixElement::svgAttributeChanged(const QualifiedName& attrName) > if (PropertyRegistry::isKnownAttribute(attrName)) { > InstanceInvalidationGuard guard(*this); > if (attrName == SVGNames::inAttr) >- invalidate(); >+ setSVGResourcesInAncestorChainAreDirty(); > else { > ASSERT(attrName == SVGNames::typeAttr || attrName == SVGNames::valuesAttr); > primitiveAttributeChanged(attrName); >diff --git a/Source/WebCore/svg/SVGFECompositeElement.cpp b/Source/WebCore/svg/SVGFECompositeElement.cpp >index 1495ccfb93e873b6223274fc52fab70a254bf81e..646042fd4a4452b12e6af46fdca22d66b538bb54 100644 >--- a/Source/WebCore/svg/SVGFECompositeElement.cpp >+++ b/Source/WebCore/svg/SVGFECompositeElement.cpp >@@ -118,7 +118,7 @@ void SVGFECompositeElement::svgAttributeChanged(const QualifiedName& attrName) > if (PropertyRegistry::isKnownAttribute(attrName)) { > InstanceInvalidationGuard guard(*this); > if (attrName == SVGNames::inAttr || attrName == SVGNames::in2Attr) >- invalidate(); >+ setSVGResourcesInAncestorChainAreDirty(); > else { > ASSERT(attrName == SVGNames::k1Attr || attrName == SVGNames::k2Attr || attrName == SVGNames::k3Attr || attrName == SVGNames::k4Attr || attrName == SVGNames::operatorAttr); > primitiveAttributeChanged(attrName); >diff --git a/Source/WebCore/svg/SVGFEConvolveMatrixElement.cpp b/Source/WebCore/svg/SVGFEConvolveMatrixElement.cpp >index bdb1cefdcc9bf0ee1188947861a87b8270943def..4a83a15a03cc5900923d3a271975c98aae0117d1 100644 >--- a/Source/WebCore/svg/SVGFEConvolveMatrixElement.cpp >+++ b/Source/WebCore/svg/SVGFEConvolveMatrixElement.cpp >@@ -160,14 +160,14 @@ void SVGFEConvolveMatrixElement::setOrder(float x, float y) > { > m_orderX->setBaseValInternal(x); > m_orderY->setBaseValInternal(y); >- invalidate(); >+ setSVGResourcesInAncestorChainAreDirty(); > } > > void SVGFEConvolveMatrixElement::setKernelUnitLength(float x, float y) > { > m_kernelUnitLengthX->setBaseValInternal(x); > m_kernelUnitLengthY->setBaseValInternal(y); >- invalidate(); >+ setSVGResourcesInAncestorChainAreDirty(); > } > > void SVGFEConvolveMatrixElement::svgAttributeChanged(const QualifiedName& attrName) >@@ -175,7 +175,7 @@ void SVGFEConvolveMatrixElement::svgAttributeChanged(const QualifiedName& attrNa > if (PropertyRegistry::isKnownAttribute(attrName)) { > InstanceInvalidationGuard guard(*this); > if (attrName == SVGNames::inAttr || attrName == SVGNames::orderAttr || attrName == SVGNames::kernelMatrixAttr) >- invalidate(); >+ setSVGResourcesInAncestorChainAreDirty(); > else { > ASSERT(attrName == SVGNames::edgeModeAttr || attrName == SVGNames::divisorAttr || attrName == SVGNames::biasAttr || attrName == SVGNames::targetXAttr > || attrName == SVGNames::targetYAttr || attrName == SVGNames::kernelUnitLengthAttr || attrName == SVGNames::preserveAlphaAttr); >diff --git a/Source/WebCore/svg/SVGFEDiffuseLightingElement.cpp b/Source/WebCore/svg/SVGFEDiffuseLightingElement.cpp >index 30e9128f27234b0623f266640258c6da7b45313e..13d3cc6fbef8c1288dc1368dbc81feeec944e7bc 100644 >--- a/Source/WebCore/svg/SVGFEDiffuseLightingElement.cpp >+++ b/Source/WebCore/svg/SVGFEDiffuseLightingElement.cpp >@@ -128,7 +128,7 @@ void SVGFEDiffuseLightingElement::svgAttributeChanged(const QualifiedName& attrN > if (PropertyRegistry::isKnownAttribute(attrName)) { > InstanceInvalidationGuard guard(*this); > if (attrName == SVGNames::inAttr) >- invalidate(); >+ setSVGResourcesInAncestorChainAreDirty(); > else { > ASSERT(attrName == SVGNames::diffuseConstantAttr || attrName == SVGNames::surfaceScaleAttr || attrName == SVGNames::kernelUnitLengthAttr); > primitiveAttributeChanged(attrName); >diff --git a/Source/WebCore/svg/SVGFEDisplacementMapElement.cpp b/Source/WebCore/svg/SVGFEDisplacementMapElement.cpp >index f9db85aea90e46115af38ac0e8930fbfbc262f49..a2933bc3e229bf451bb42a78c4017049d97ac69e 100644 >--- a/Source/WebCore/svg/SVGFEDisplacementMapElement.cpp >+++ b/Source/WebCore/svg/SVGFEDisplacementMapElement.cpp >@@ -102,7 +102,7 @@ void SVGFEDisplacementMapElement::svgAttributeChanged(const QualifiedName& attrN > if (PropertyRegistry::isKnownAttribute(attrName)) { > InstanceInvalidationGuard guard(*this); > if (attrName == SVGNames::inAttr || attrName == SVGNames::in2Attr) >- invalidate(); >+ setSVGResourcesInAncestorChainAreDirty(); > else { > ASSERT(attrName == SVGNames::xChannelSelectorAttr || attrName == SVGNames::yChannelSelectorAttr || attrName == SVGNames::scaleAttr); > primitiveAttributeChanged(attrName); >diff --git a/Source/WebCore/svg/SVGFEDropShadowElement.cpp b/Source/WebCore/svg/SVGFEDropShadowElement.cpp >index 459910e54d2f6056ea259b18839b3e3e9b531682..e1acdf09f392e2bca17b1a44e672a7798204abbf 100644 >--- a/Source/WebCore/svg/SVGFEDropShadowElement.cpp >+++ b/Source/WebCore/svg/SVGFEDropShadowElement.cpp >@@ -54,7 +54,7 @@ void SVGFEDropShadowElement::setStdDeviation(float x, float y) > { > m_stdDeviationX->setBaseValInternal(x); > m_stdDeviationY->setBaseValInternal(y); >- invalidate(); >+ setSVGResourcesInAncestorChainAreDirty(); > } > > void SVGFEDropShadowElement::parseAttribute(const QualifiedName& name, const AtomString& value) >@@ -89,7 +89,7 @@ void SVGFEDropShadowElement::svgAttributeChanged(const QualifiedName& attrName) > { > if (PropertyRegistry::isKnownAttribute(attrName)) { > InstanceInvalidationGuard guard(*this); >- invalidate(); >+ setSVGResourcesInAncestorChainAreDirty(); > return; > } > >diff --git a/Source/WebCore/svg/SVGFEGaussianBlurElement.cpp b/Source/WebCore/svg/SVGFEGaussianBlurElement.cpp >index b5f3c7b6ceffd65dfd0ae11a4a9b2b2e0d83b8a3..073bd724bb9e35f0b80d62df9c0295532e969d27 100644 >--- a/Source/WebCore/svg/SVGFEGaussianBlurElement.cpp >+++ b/Source/WebCore/svg/SVGFEGaussianBlurElement.cpp >@@ -53,7 +53,7 @@ void SVGFEGaussianBlurElement::setStdDeviation(float x, float y) > { > m_stdDeviationX->setBaseValInternal(x); > m_stdDeviationY->setBaseValInternal(y); >- invalidate(); >+ setSVGResourcesInAncestorChainAreDirty(); > } > > void SVGFEGaussianBlurElement::parseAttribute(const QualifiedName& name, const AtomString& value) >@@ -87,7 +87,7 @@ void SVGFEGaussianBlurElement::svgAttributeChanged(const QualifiedName& attrName > { > if (PropertyRegistry::isKnownAttribute(attrName)) { > InstanceInvalidationGuard guard(*this); >- invalidate(); >+ setSVGResourcesInAncestorChainAreDirty(); > return; > } > >diff --git a/Source/WebCore/svg/SVGFEImageElement.cpp b/Source/WebCore/svg/SVGFEImageElement.cpp >index 1ad5165901a55256eb41a25302da5fe0a1a3a033..cc32d2902b1d7f48eab952f3bcf3133661271bca 100644 >--- a/Source/WebCore/svg/SVGFEImageElement.cpp >+++ b/Source/WebCore/svg/SVGFEImageElement.cpp >@@ -111,7 +111,7 @@ void SVGFEImageElement::buildPendingResource() > } else if (is<SVGElement>(*target.element)) > downcast<SVGElement>(*target.element).addReferencingElement(*this); > >- invalidate(); >+ setSVGResourcesInAncestorChainAreDirty(); > } > > void SVGFEImageElement::parseAttribute(const QualifiedName& name, const AtomString& value) >@@ -130,7 +130,7 @@ void SVGFEImageElement::svgAttributeChanged(const QualifiedName& attrName) > if (PropertyRegistry::isKnownAttribute(attrName)) { > ASSERT(attrName == SVGNames::preserveAspectRatioAttr); > InstanceInvalidationGuard guard(*this); >- invalidate(); >+ setSVGResourcesInAncestorChainAreDirty(); > return; > } > >diff --git a/Source/WebCore/svg/SVGFELightElement.cpp b/Source/WebCore/svg/SVGFELightElement.cpp >index 2486664ee62491b0e1713f763760a868e9a8ddc3..e6864a7baefa74cc6b739a17a7d725d1d7f4bf75 100644 >--- a/Source/WebCore/svg/SVGFELightElement.cpp >+++ b/Source/WebCore/svg/SVGFELightElement.cpp >@@ -157,12 +157,8 @@ void SVGFELightElement::childrenChanged(const ChildChange& change) > > if (change.source == ChildChange::Source::Parser) > return; >- RefPtr parent = parentNode(); >- if (!parent) >- return; >- RenderElement* renderer = parent->renderer(); >- if (renderer && renderer->isSVGResourceFilterPrimitive()) >- RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer); >+ >+ SVGFilterPrimitiveStandardAttributes::invalidateFilterPrimitiveParent(this); > } > > } >diff --git a/Source/WebCore/svg/SVGFEMergeNodeElement.cpp b/Source/WebCore/svg/SVGFEMergeNodeElement.cpp >index 5ebdcc9dd18b517f665e6a0a9e58d6827eb257bf..9308b20bb65cf185e6ffdc5a5baa448ea3a11a17 100644 >--- a/Source/WebCore/svg/SVGFEMergeNodeElement.cpp >+++ b/Source/WebCore/svg/SVGFEMergeNodeElement.cpp >@@ -63,7 +63,7 @@ void SVGFEMergeNodeElement::svgAttributeChanged(const QualifiedName& attrName) > if (PropertyRegistry::isKnownAttribute(attrName)) { > ASSERT(attrName == SVGNames::inAttr); > InstanceInvalidationGuard guard(*this); >- invalidateFilterPrimitiveParent(this); >+ SVGFilterPrimitiveStandardAttributes::invalidateFilterPrimitiveParent(this); > return; > } > >diff --git a/Source/WebCore/svg/SVGFEMorphologyElement.cpp b/Source/WebCore/svg/SVGFEMorphologyElement.cpp >index 79092074c4f15fdeaeffc6968a6d6fb25337e7f8..ba54ba79215c7af6ce1a4da50b66d1a77cdce4ff 100644 >--- a/Source/WebCore/svg/SVGFEMorphologyElement.cpp >+++ b/Source/WebCore/svg/SVGFEMorphologyElement.cpp >@@ -52,7 +52,7 @@ void SVGFEMorphologyElement::setRadius(float x, float y) > { > m_radiusX->setBaseValInternal(x); > m_radiusY->setBaseValInternal(y); >- invalidate(); >+ setSVGResourcesInAncestorChainAreDirty(); > } > > void SVGFEMorphologyElement::parseAttribute(const QualifiedName& name, const AtomString& value) >@@ -101,7 +101,7 @@ void SVGFEMorphologyElement::svgAttributeChanged(const QualifiedName& attrName) > if (PropertyRegistry::isKnownAttribute(attrName)) { > InstanceInvalidationGuard guard(*this); > if (attrName == SVGNames::inAttr) >- invalidate(); >+ setSVGResourcesInAncestorChainAreDirty(); > else { > ASSERT(attrName == SVGNames::operatorAttr || attrName == SVGNames::radiusAttr); > primitiveAttributeChanged(attrName); >diff --git a/Source/WebCore/svg/SVGFEOffsetElement.cpp b/Source/WebCore/svg/SVGFEOffsetElement.cpp >index 843f8de77ab8c81dba33af21df60c8d2e8cb2743..eb6d7cbf8d80c6ab8c2f8e904c57a83f7f20be4a 100644 >--- a/Source/WebCore/svg/SVGFEOffsetElement.cpp >+++ b/Source/WebCore/svg/SVGFEOffsetElement.cpp >@@ -72,7 +72,7 @@ void SVGFEOffsetElement::svgAttributeChanged(const QualifiedName& attrName) > { > if (PropertyRegistry::isKnownAttribute(attrName)) { > InstanceInvalidationGuard guard(*this); >- invalidate(); >+ setSVGResourcesInAncestorChainAreDirty(); > return; > } > >diff --git a/Source/WebCore/svg/SVGFESpecularLightingElement.cpp b/Source/WebCore/svg/SVGFESpecularLightingElement.cpp >index b68ba390544aa65bfb9ded9674e6ece2c29878a2..e87c510d5c7760a82ae5ae08295699e557ccaab1 100644 >--- a/Source/WebCore/svg/SVGFESpecularLightingElement.cpp >+++ b/Source/WebCore/svg/SVGFESpecularLightingElement.cpp >@@ -138,7 +138,7 @@ void SVGFESpecularLightingElement::svgAttributeChanged(const QualifiedName& attr > if (PropertyRegistry::isKnownAttribute(attrName)) { > InstanceInvalidationGuard guard(*this); > if (attrName == SVGNames::inAttr) >- invalidate(); >+ setSVGResourcesInAncestorChainAreDirty(); > else { > ASSERT(attrName == SVGNames::specularConstantAttr || attrName == SVGNames::specularExponentAttr || attrName == SVGNames::surfaceScaleAttr || attrName == SVGNames::kernelUnitLengthAttr); > primitiveAttributeChanged(attrName); >diff --git a/Source/WebCore/svg/SVGFETileElement.cpp b/Source/WebCore/svg/SVGFETileElement.cpp >index e4617de952d99ebcc7688137f1e73fbe5bd069cf..b99307c4be6cb11b5b3319d635a41a74b1bc5e38 100644 >--- a/Source/WebCore/svg/SVGFETileElement.cpp >+++ b/Source/WebCore/svg/SVGFETileElement.cpp >@@ -61,7 +61,7 @@ void SVGFETileElement::svgAttributeChanged(const QualifiedName& attrName) > if (PropertyRegistry::isKnownAttribute(attrName)) { > ASSERT(attrName == SVGNames::inAttr); > InstanceInvalidationGuard guard(*this); >- invalidate(); >+ setSVGResourcesInAncestorChainAreDirty(); > return; > } > >diff --git a/Source/WebCore/svg/SVGFilterElement.cpp b/Source/WebCore/svg/SVGFilterElement.cpp >index 80d366d1d49e0418cb3a0cd6381f5955165e35c4..204a61b47186a78a60acecd6a32c157cf2b0c7d6 100644 >--- a/Source/WebCore/svg/SVGFilterElement.cpp >+++ b/Source/WebCore/svg/SVGFilterElement.cpp >@@ -99,8 +99,7 @@ void SVGFilterElement::svgAttributeChanged(const QualifiedName& attrName) > } > > if (PropertyRegistry::isKnownAttribute(attrName) || SVGURIReference::isKnownAttribute(attrName)) { >- if (auto* renderer = this->renderer()) >- renderer->setNeedsLayout(); >+ setSVGResourcesInAncestorChainAreDirty(); > return; > } > >@@ -114,8 +113,7 @@ void SVGFilterElement::childrenChanged(const ChildChange& change) > if (change.source == ChildChange::Source::Parser) > return; > >- if (RenderObject* object = renderer()) >- object->setNeedsLayout(); >+ setSVGResourcesInAncestorChainAreDirty(); > } > > RenderPtr<RenderElement> SVGFilterElement::createElementRenderer(RenderStyle&& style, const RenderTreePosition&) >diff --git a/Source/WebCore/svg/SVGFilterPrimitiveStandardAttributes.cpp b/Source/WebCore/svg/SVGFilterPrimitiveStandardAttributes.cpp >index 00e4e698664532922d6375e77ad43b285c74494a..2402546f4f4207057a654ee4d080b0ae4634749a 100644 >--- a/Source/WebCore/svg/SVGFilterPrimitiveStandardAttributes.cpp >+++ b/Source/WebCore/svg/SVGFilterPrimitiveStandardAttributes.cpp >@@ -78,7 +78,7 @@ void SVGFilterPrimitiveStandardAttributes::svgAttributeChanged(const QualifiedNa > { > if (PropertyRegistry::isKnownAttribute(attrName)) { > InstanceInvalidationGuard guard(*this); >- invalidate(); >+ setSVGResourcesInAncestorChainAreDirty(); > return; > } > >@@ -91,7 +91,7 @@ void SVGFilterPrimitiveStandardAttributes::childrenChanged(const ChildChange& ch > > if (change.source == ChildChange::Source::Parser) > return; >- invalidate(); >+ setSVGResourcesInAncestorChainAreDirty(); > } > > RenderPtr<RenderElement> SVGFilterPrimitiveStandardAttributes::createElementRenderer(RenderStyle&& style, const RenderTreePosition&) >@@ -107,7 +107,7 @@ bool SVGFilterPrimitiveStandardAttributes::rendererIsNeeded(const RenderStyle& s > return false; > } > >-void invalidateFilterPrimitiveParent(SVGElement* element) >+void SVGFilterPrimitiveStandardAttributes::invalidateFilterPrimitiveParent(SVGElement* element) > { > if (!element) > return; >@@ -120,7 +120,7 @@ void invalidateFilterPrimitiveParent(SVGElement* element) > if (!renderer || !renderer->isSVGResourceFilterPrimitive()) > return; > >- RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer, false); >+ downcast<SVGElement>(*parent).setSVGResourcesInAncestorChainAreDirty(); > } > > } >diff --git a/Source/WebCore/svg/SVGFilterPrimitiveStandardAttributes.h b/Source/WebCore/svg/SVGFilterPrimitiveStandardAttributes.h >index 7df9206faa91eafefefda529e92f69c51f3d8ed9..3103cc6ac233e0fd3b2fb1e979049a28b7b6f8bb 100644 >--- a/Source/WebCore/svg/SVGFilterPrimitiveStandardAttributes.h >+++ b/Source/WebCore/svg/SVGFilterPrimitiveStandardAttributes.h >@@ -55,6 +55,8 @@ public: > virtual Vector<AtomString> filterEffectInputsNames() const { return { }; } > virtual RefPtr<FilterEffect> filterEffect(const SVGFilterBuilder&, const FilterEffectVector&) const = 0; > >+ static void invalidateFilterPrimitiveParent(SVGElement*); >+ > protected: > SVGFilterPrimitiveStandardAttributes(const QualifiedName&, Document&); > >@@ -62,7 +64,6 @@ protected: > void svgAttributeChanged(const QualifiedName&) override; > void childrenChanged(const ChildChange&) override; > >- void invalidate(); > void primitiveAttributeChanged(const QualifiedName& attributeName); > > private: >@@ -81,14 +82,6 @@ private: > Ref<SVGAnimatedString> m_result { SVGAnimatedString::create(this) }; > }; > >-void invalidateFilterPrimitiveParent(SVGElement*); >- >-inline void SVGFilterPrimitiveStandardAttributes::invalidate() >-{ >- if (auto* primitiveRenderer = renderer()) >- RenderSVGResource::markForLayoutAndParentResourceInvalidation(*primitiveRenderer); >-} >- > inline void SVGFilterPrimitiveStandardAttributes::primitiveAttributeChanged(const QualifiedName& attribute) > { > if (auto* primitiveRenderer = renderer()) >diff --git a/Source/WebCore/svg/SVGForeignObjectElement.cpp b/Source/WebCore/svg/SVGForeignObjectElement.cpp >index e349bc7196c04cc1f2ebec2975141db6c4ffb050..ecb3bbf89607cd7d03257644e8b62acb06558c1b 100644 >--- a/Source/WebCore/svg/SVGForeignObjectElement.cpp >+++ b/Source/WebCore/svg/SVGForeignObjectElement.cpp >@@ -81,8 +81,7 @@ void SVGForeignObjectElement::svgAttributeChanged(const QualifiedName& attrName) > else { > ASSERT(attrName == SVGNames::xAttr || attrName == SVGNames::yAttr); > updateRelativeLengthsInformation(); >- if (auto renderer = this->renderer()) >- RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer); >+ setSVGResourcesInAncestorChainAreDirty(); > } > return; > } >diff --git a/Source/WebCore/svg/SVGGeometryElement.cpp b/Source/WebCore/svg/SVGGeometryElement.cpp >index 56480e916dffb35a996d4b459f1cdde64b40e1bd..c0bf21e4424a36388c7f21672715530c1f2d183b 100644 >--- a/Source/WebCore/svg/SVGGeometryElement.cpp >+++ b/Source/WebCore/svg/SVGGeometryElement.cpp >@@ -150,8 +150,7 @@ void SVGGeometryElement::svgAttributeChanged(const QualifiedName& attrName) > if (PropertyRegistry::isKnownAttribute(attrName)) { > ASSERT(attrName == SVGNames::pathLengthAttr); > InstanceInvalidationGuard guard(*this); >- if (auto* renderer = this->renderer()) >- RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer); >+ setSVGResourcesInAncestorChainAreDirty(); > return; > } > >diff --git a/Source/WebCore/svg/SVGGradientElement.cpp b/Source/WebCore/svg/SVGGradientElement.cpp >index 774c11e3d9873b93cde968b37eb347c76582483e..e09c1d959de89d6d382b1c7767ba30fc327a6500 100644 >--- a/Source/WebCore/svg/SVGGradientElement.cpp >+++ b/Source/WebCore/svg/SVGGradientElement.cpp >@@ -79,8 +79,7 @@ void SVGGradientElement::svgAttributeChanged(const QualifiedName& attrName) > { > if (PropertyRegistry::isKnownAttribute(attrName) || SVGURIReference::isKnownAttribute(attrName)) { > InstanceInvalidationGuard guard(*this); >- if (RenderObject* object = renderer()) >- object->setNeedsLayout(); >+ setSVGResourcesInAncestorChainAreDirty(); > return; > } > >@@ -94,8 +93,7 @@ void SVGGradientElement::childrenChanged(const ChildChange& change) > if (change.source == ChildChange::Source::Parser) > return; > >- if (RenderObject* object = renderer()) >- object->setNeedsLayout(); >+ setSVGResourcesInAncestorChainAreDirty(); > } > > GradientColorStops SVGGradientElement::buildStops() >diff --git a/Source/WebCore/svg/SVGGraphicsElement.cpp b/Source/WebCore/svg/SVGGraphicsElement.cpp >index dc108e5b23c46da95600a02aac6207ed5b665696..03163e4f39fdca1d5d81ec77875ffd0b1c8344b5 100644 >--- a/Source/WebCore/svg/SVGGraphicsElement.cpp >+++ b/Source/WebCore/svg/SVGGraphicsElement.cpp >@@ -136,10 +136,9 @@ void SVGGraphicsElement::svgAttributeChanged(const QualifiedName& attrName) > ASSERT(attrName == SVGNames::transformAttr); > InstanceInvalidationGuard guard(*this); > >- if (auto renderer = this->renderer()) { >+ if (auto renderer = this->renderer()) > renderer->setNeedsTransformUpdate(); >- RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer); >- } >+ setSVGResourcesInAncestorChainAreDirty(); > > return; > } >diff --git a/Source/WebCore/svg/SVGImageElement.cpp b/Source/WebCore/svg/SVGImageElement.cpp >index 1623e739cc03afa482deea655ac6e9e5f03a52b0..be044927cc81f90d411486e96706ca72bd07a148 100644 >--- a/Source/WebCore/svg/SVGImageElement.cpp >+++ b/Source/WebCore/svg/SVGImageElement.cpp >@@ -99,15 +99,15 @@ void SVGImageElement::svgAttributeChanged(const QualifiedName& attrName) > updateRelativeLengthsInformation(); > > if (auto* renderer = this->renderer()) { >- if (downcast<RenderSVGImage>(*renderer).updateImageViewport()) >- RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer); >+ if (!downcast<RenderSVGImage>(*renderer).updateImageViewport()) >+ return; >+ setSVGResourcesInAncestorChainAreDirty(); > } > } else if (attrName == SVGNames::widthAttr || attrName == SVGNames::heightAttr) > setPresentationalHintStyleIsDirty(); > else { > ASSERT(attrName == SVGNames::preserveAspectRatioAttr); >- if (auto* renderer = this->renderer()) >- RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer); >+ setSVGResourcesInAncestorChainAreDirty(); > } > return; > } >diff --git a/Source/WebCore/svg/SVGLineElement.cpp b/Source/WebCore/svg/SVGLineElement.cpp >index efb9b8bcfd9cc95eaa493bfe1aad919ca79cb3c5..2319d5eccd7ef23446fde84ced72a087a6997c70 100644 >--- a/Source/WebCore/svg/SVGLineElement.cpp >+++ b/Source/WebCore/svg/SVGLineElement.cpp >@@ -74,10 +74,9 @@ void SVGLineElement::svgAttributeChanged(const QualifiedName& attrName) > InstanceInvalidationGuard guard(*this); > updateRelativeLengthsInformation(); > >- if (auto* renderer = downcast<LegacyRenderSVGShape>(this->renderer())) { >- renderer->setNeedsShapeUpdate(); >- RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer); >- } >+ if (auto* renderer = this->renderer()) >+ static_cast<LegacyRenderSVGShape*>(renderer)->setNeedsShapeUpdate(); >+ setSVGResourcesInAncestorChainAreDirty(); > return; > } > >diff --git a/Source/WebCore/svg/SVGLinearGradientElement.cpp b/Source/WebCore/svg/SVGLinearGradientElement.cpp >index 848f6a22f8e2513667bb04cbbb99f809a268fc7f..1cd501b02e69d46278e57ceb9b8ecffa29f1cb9a 100644 >--- a/Source/WebCore/svg/SVGLinearGradientElement.cpp >+++ b/Source/WebCore/svg/SVGLinearGradientElement.cpp >@@ -83,8 +83,7 @@ void SVGLinearGradientElement::svgAttributeChanged(const QualifiedName& attrName > if (PropertyRegistry::isKnownAttribute(attrName)) { > InstanceInvalidationGuard guard(*this); > updateRelativeLengthsInformation(); >- if (RenderObject* object = renderer()) >- object->setNeedsLayout(); >+ setSVGResourcesInAncestorChainAreDirty(); > return; > } > >diff --git a/Source/WebCore/svg/SVGMarkerElement.cpp b/Source/WebCore/svg/SVGMarkerElement.cpp >index 0b43bb842e5e362aaef879fd6063aa576eae21ab..9948f198773825c90c6e01fb83f3bb01e8ff9771 100644 >--- a/Source/WebCore/svg/SVGMarkerElement.cpp >+++ b/Source/WebCore/svg/SVGMarkerElement.cpp >@@ -98,14 +98,12 @@ void SVGMarkerElement::svgAttributeChanged(const QualifiedName& attrName) > InstanceInvalidationGuard guard(*this); > if (PropertyRegistry::isAnimatedLengthAttribute(attrName)) > updateRelativeLengthsInformation(); >- if (RenderObject* object = renderer()) >- object->setNeedsLayout(); >+ setSVGResourcesInAncestorChainAreDirty(); > return; > } > > if (SVGFitToViewBox::isKnownAttribute(attrName)) { >- if (RenderObject* object = renderer()) >- object->setNeedsLayout(); >+ setSVGResourcesInAncestorChainAreDirty(); > return; > } > >@@ -119,8 +117,7 @@ void SVGMarkerElement::childrenChanged(const ChildChange& change) > if (change.source == ChildChange::Source::Parser) > return; > >- if (RenderObject* object = renderer()) >- object->setNeedsLayout(); >+ setSVGResourcesInAncestorChainAreDirty(); > } > > String SVGMarkerElement::orient() const >diff --git a/Source/WebCore/svg/SVGMaskElement.cpp b/Source/WebCore/svg/SVGMaskElement.cpp >index 63ba72b05382ff58bea052dcbfef5471ba949104..257783b34ecb258ce27fe414ca8b6fe8691d3972 100644 >--- a/Source/WebCore/svg/SVGMaskElement.cpp >+++ b/Source/WebCore/svg/SVGMaskElement.cpp >@@ -105,8 +105,7 @@ void SVGMaskElement::svgAttributeChanged(const QualifiedName& attrName) > } > > if (PropertyRegistry::isKnownAttribute(attrName)) { >- if (auto* renderer = this->renderer()) >- renderer->setNeedsLayout(); >+ setSVGResourcesInAncestorChainAreDirty(); > return; > } > >@@ -120,8 +119,7 @@ void SVGMaskElement::childrenChanged(const ChildChange& change) > if (change.source == ChildChange::Source::Parser) > return; > >- if (RenderObject* object = renderer()) >- object->setNeedsLayout(); >+ setSVGResourcesInAncestorChainAreDirty(); > } > > RenderPtr<RenderElement> SVGMaskElement::createElementRenderer(RenderStyle&& style, const RenderTreePosition&) >diff --git a/Source/WebCore/svg/SVGPathElement.cpp b/Source/WebCore/svg/SVGPathElement.cpp >index 6a0cf936d357a9ea8579e3f475edb87023a580ec..d0b5df21d16ac4dc130f40291bd45a99fd3846f7 100644 >--- a/Source/WebCore/svg/SVGPathElement.cpp >+++ b/Source/WebCore/svg/SVGPathElement.cpp >@@ -70,10 +70,9 @@ void SVGPathElement::svgAttributeChanged(const QualifiedName& attrName) > InstanceInvalidationGuard guard(*this); > invalidateMPathDependencies(); > >- if (auto* renderer = downcast<RenderSVGPath>(this->renderer())) { >- renderer->setNeedsShapeUpdate(); >- RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer); >- } >+ if (auto* renderer = this->renderer()) >+ static_cast<RenderSVGPath*>(renderer)->setNeedsShapeUpdate(); >+ setSVGResourcesInAncestorChainAreDirty(); > > return; > } >diff --git a/Source/WebCore/svg/SVGPatternElement.cpp b/Source/WebCore/svg/SVGPatternElement.cpp >index 6b54e7efcd83344c38735a71a1dc20c5d48bd865..b47589ff8fca7ca168396be96184ed64ed9705a6 100644 >--- a/Source/WebCore/svg/SVGPatternElement.cpp >+++ b/Source/WebCore/svg/SVGPatternElement.cpp >@@ -117,8 +117,7 @@ void SVGPatternElement::svgAttributeChanged(const QualifiedName& attrName) > } > > if (PropertyRegistry::isKnownAttribute(attrName) || SVGFitToViewBox::isKnownAttribute(attrName) || SVGURIReference::isKnownAttribute(attrName)) { >- if (RenderObject* object = renderer()) >- object->setNeedsLayout(); >+ setSVGResourcesInAncestorChainAreDirty(); > return; > } > >@@ -132,8 +131,7 @@ void SVGPatternElement::childrenChanged(const ChildChange& change) > if (change.source == ChildChange::Source::Parser) > return; > >- if (RenderObject* object = renderer()) >- object->setNeedsLayout(); >+ setSVGResourcesInAncestorChainAreDirty(); > } > > RenderPtr<RenderElement> SVGPatternElement::createElementRenderer(RenderStyle&& style, const RenderTreePosition&) >diff --git a/Source/WebCore/svg/SVGPolyElement.cpp b/Source/WebCore/svg/SVGPolyElement.cpp >index 6bdebfa7a4952467d905650689c75ef18e110ec3..80ed03fca4b7c366854095c6decb7c56ac3ffe30 100644 >--- a/Source/WebCore/svg/SVGPolyElement.cpp >+++ b/Source/WebCore/svg/SVGPolyElement.cpp >@@ -57,11 +57,10 @@ void SVGPolyElement::svgAttributeChanged(const QualifiedName& attrName) > { > if (PropertyRegistry::isKnownAttribute(attrName)) { > ASSERT(attrName == SVGNames::pointsAttr); >- if (auto* renderer = downcast<RenderSVGPath>(this->renderer())) { >- InstanceInvalidationGuard guard(*this); >- renderer->setNeedsShapeUpdate(); >- RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer); >- } >+ InstanceInvalidationGuard guard(*this); >+ if (auto* renderer = this->renderer()) >+ static_cast<RenderSVGPath*>(renderer)->setNeedsShapeUpdate(); >+ setSVGResourcesInAncestorChainAreDirty(); > return; > } > >diff --git a/Source/WebCore/svg/SVGRadialGradientElement.cpp b/Source/WebCore/svg/SVGRadialGradientElement.cpp >index e5e21afee9e3f56b1878cd3e2e9198404f4989ce..074a76779d7dcb10907d6e70dee30bbec3092c3d 100644 >--- a/Source/WebCore/svg/SVGRadialGradientElement.cpp >+++ b/Source/WebCore/svg/SVGRadialGradientElement.cpp >@@ -89,8 +89,7 @@ void SVGRadialGradientElement::svgAttributeChanged(const QualifiedName& attrName > if (PropertyRegistry::isKnownAttribute(attrName)) { > InstanceInvalidationGuard guard(*this); > updateRelativeLengthsInformation(); >- if (RenderObject* object = renderer()) >- object->setNeedsLayout(); >+ setSVGResourcesInAncestorChainAreDirty(); > return; > } > >diff --git a/Source/WebCore/svg/SVGSVGElement.cpp b/Source/WebCore/svg/SVGSVGElement.cpp >index 9c6a7e83be7921617e259ca7d3fc8e9a55e358d8..7c8491293177e6cadf6eaa05a9f6850aaf9dfd05 100644 >--- a/Source/WebCore/svg/SVGSVGElement.cpp >+++ b/Source/WebCore/svg/SVGSVGElement.cpp >@@ -137,8 +137,7 @@ void SVGSVGElement::setCurrentTranslate(const FloatPoint& translation) > > void SVGSVGElement::updateCurrentTranslate() > { >- if (RenderObject* object = renderer()) >- object->setNeedsLayout(); >+ setSVGResourcesInAncestorChainAreDirty(); > if (parentNode() == &document() && document().renderView()) > document().renderView()->repaint(); > } >@@ -211,16 +210,28 @@ void SVGSVGElement::svgAttributeChanged(const QualifiedName& attrName) > InstanceInvalidationGuard guard(*this); > setPresentationalHintStyleIsDirty(); > >- if (auto* renderer = this->renderer()) >- RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer); >+ if (attrName == SVGNames::widthAttr || attrName == SVGNames::heightAttr) { >+ // FIXME: try to get rid of this custom handling of embedded SVG invalidation, maybe through abstraction. >+ if (auto* renderer = this->renderer()) { >+ bool embeddedThroughFrame = false; >+#if ENABLE(LAYER_BASED_SVG_ENGINE) >+ if (is<RenderSVGRoot>(renderer) && downcast<RenderSVGRoot>(renderer)->isEmbeddedThroughFrameContainingSVGDocument()) >+ embeddedThroughFrame = true; >+#endif >+ if (!embeddedThroughFrame && is<LegacyRenderSVGRoot>(renderer) && downcast<LegacyRenderSVGRoot>(renderer)->isEmbeddedThroughFrameContainingSVGDocument()) >+ embeddedThroughFrame = true; >+ if (embeddedThroughFrame) >+ renderer->view().setNeedsLayout(MarkOnlyThis); >+ } >+ } >+ setSVGResourcesInAncestorChainAreDirty(); > return; > } > > if (SVGFitToViewBox::isKnownAttribute(attrName)) { >- if (auto* renderer = this->renderer()) { >+ if (auto* renderer = this->renderer()) > renderer->setNeedsTransformUpdate(); >- RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer); >- } >+ setSVGResourcesInAncestorChainAreDirty(); > return; > } > >diff --git a/Source/WebCore/svg/SVGStopElement.cpp b/Source/WebCore/svg/SVGStopElement.cpp >index 20796a9020280db536c4bcf574044c7c38753d13..ad832399e6dedc1090833600101a081f24a07951 100644 >--- a/Source/WebCore/svg/SVGStopElement.cpp >+++ b/Source/WebCore/svg/SVGStopElement.cpp >@@ -66,10 +66,8 @@ void SVGStopElement::svgAttributeChanged(const QualifiedName& attrName) > { > if (PropertyRegistry::isKnownAttribute(attrName)) { > ASSERT(attrName == SVGNames::offsetAttr); >- if (auto renderer = this->renderer()) { >- InstanceInvalidationGuard guard(*this); >- RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer); >- } >+ InstanceInvalidationGuard guard(*this); >+ setSVGResourcesInAncestorChainAreDirty(); > return; > } > >diff --git a/Source/WebCore/svg/SVGTRefElement.cpp b/Source/WebCore/svg/SVGTRefElement.cpp >index 2991db6934206ea927ebd87f37111781e52182de..aadac99e5059aded5429eba3ff4e951bb66c4af8 100644 >--- a/Source/WebCore/svg/SVGTRefElement.cpp >+++ b/Source/WebCore/svg/SVGTRefElement.cpp >@@ -184,8 +184,7 @@ void SVGTRefElement::svgAttributeChanged(const QualifiedName& attrName) > if (SVGURIReference::isKnownAttribute(attrName)) { > InstanceInvalidationGuard guard(*this); > buildPendingResource(); >- if (auto renderer = this->renderer()) >- RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer); >+ setSVGResourcesInAncestorChainAreDirty(); > return; > } > >diff --git a/Source/WebCore/svg/SVGTextContentElement.cpp b/Source/WebCore/svg/SVGTextContentElement.cpp >index c1453bfc60408c950746077d761ee14d729651fb..f84c34b44012daacd8395b162c48176054c7fecf 100644 >--- a/Source/WebCore/svg/SVGTextContentElement.cpp >+++ b/Source/WebCore/svg/SVGTextContentElement.cpp >@@ -183,10 +183,8 @@ void SVGTextContentElement::svgAttributeChanged(const QualifiedName& attrName) > if (attrName == SVGNames::textLengthAttr) > m_specifiedTextLength = m_textLength->baseVal()->value(); > >- if (auto renderer = this->renderer()) { >- InstanceInvalidationGuard guard(*this); >- RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer); >- } >+ InstanceInvalidationGuard guard(*this); >+ setSVGResourcesInAncestorChainAreDirty(); > return; > } > >diff --git a/Source/WebCore/svg/SVGTextPathElement.cpp b/Source/WebCore/svg/SVGTextPathElement.cpp >index a7491c4d1b85b97e347fd5a71411314c97846693..078c0c7811b74b016f136776813cb638a6d31a71 100644 >--- a/Source/WebCore/svg/SVGTextPathElement.cpp >+++ b/Source/WebCore/svg/SVGTextPathElement.cpp >@@ -93,15 +93,13 @@ void SVGTextPathElement::svgAttributeChanged(const QualifiedName& attrName) > if (attrName == SVGNames::startOffsetAttr) > updateRelativeLengthsInformation(); > >- if (auto renderer = this->renderer()) >- RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer); >+ setSVGResourcesInAncestorChainAreDirty(); > return; > } > > if (SVGURIReference::isKnownAttribute(attrName)) { > buildPendingResource(); >- if (auto renderer = this->renderer()) >- RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer); >+ setSVGResourcesInAncestorChainAreDirty(); > return; > } > >diff --git a/Source/WebCore/svg/SVGTextPositioningElement.cpp b/Source/WebCore/svg/SVGTextPositioningElement.cpp >index fe21e66af56652890ab318083dd8319cef1e6202..baa551dc3f3140de2e515cf95440c4dddf5e7c79 100644 >--- a/Source/WebCore/svg/SVGTextPositioningElement.cpp >+++ b/Source/WebCore/svg/SVGTextPositioningElement.cpp >@@ -106,9 +106,8 @@ void SVGTextPositioningElement::svgAttributeChanged(const QualifiedName& attrNam > if (auto renderer = this->renderer()) { > if (auto* textAncestor = RenderSVGText::locateRenderSVGTextAncestor(*renderer)) > textAncestor->setNeedsPositioningValuesUpdate(); >- RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer); > } >- >+ setSVGResourcesInAncestorChainAreDirty(); > return; > } > >diff --git a/Source/WebCore/svg/SVGUseElement.cpp b/Source/WebCore/svg/SVGUseElement.cpp >index b9edef631e66e60ff58c75234981e214530e4ffa..a01f6bada1c1d6c25f820f726c8ecee8182ecb6a 100644 >--- a/Source/WebCore/svg/SVGUseElement.cpp >+++ b/Source/WebCore/svg/SVGUseElement.cpp >@@ -165,8 +165,7 @@ void SVGUseElement::svgAttributeChanged(const QualifiedName& attrName) > if (auto targetClone = this->targetClone()) > transferSizeAttributesToTargetClone(*targetClone); > } >- if (auto* renderer = this->renderer()) >- RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer); >+ setSVGResourcesInAncestorChainAreDirty(); > return; > } > >diff --git a/Source/WebCore/svg/SVGViewElement.cpp b/Source/WebCore/svg/SVGViewElement.cpp >index ecfe431a4533c36c08b50323bc2144bcebe490e5..eaa265164c496adea3825e1b348e3fa40d9e0a6c 100644 >--- a/Source/WebCore/svg/SVGViewElement.cpp >+++ b/Source/WebCore/svg/SVGViewElement.cpp >@@ -59,12 +59,10 @@ void SVGViewElement::svgAttributeChanged(const QualifiedName& attrName) > return; > > if (SVGFitToViewBox::isKnownAttribute(attrName)) { >- if (m_targetElement) { >- m_targetElement->inheritViewAttributes(*this); >- if (auto* renderer = m_targetElement->renderer()) >- RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer); >- } >- >+ if (!m_targetElement) >+ return; >+ m_targetElement->inheritViewAttributes(*this); >+ m_targetElement->setSVGResourcesInAncestorChainAreDirty(); > return; > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 230296
:
438211
|
438212
|
453188
|
453194
|
453199
|
453292
|
454103
|
454469
|
454482
|
454834
|
455357
|
455372
|
455394
| 455553