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-20220225121104.patch (text/plain), 70.95 KB, created by
Rob Buis
on 2022-02-25 04:11:06 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Rob Buis
Created:
2022-02-25 04:11:06 PST
Size:
70.95 KB
patch
obsolete
>Subversion Revision: 290502 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index b98218554292721837b6c58f1eaa7ddc8ef681ec..726632ba90410d9658f176063ba6b0f8d750eab4 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,137 @@ >+2022-02-25 Said Abou-Hallawa <said@apple.com> >+ >+ setNeedsLayout() should not be called when changing the SVG properties >+ https://bugs.webkit.org/show_bug.cgi?id=230296 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ WIP >+ >+ * rendering/svg/RenderSVGImage.cpp: >+ (WebCore::RenderSVGImage::imageChanged): >+ * rendering/svg/RenderSVGResource.cpp: >+ (WebCore::removeFromCacheAndInvalidateDependencies): >+ * rendering/svg/SVGResourcesCache.cpp: >+ (WebCore::SVGResourcesCache::removeRendererFromResources): >+ * rendering/svg/SVGResourcesCache.h: >+ * rendering/updating/RenderTreeUpdater.cpp: >+ (WebCore::RenderTreeUpdater::updateRenderTree): >+ * svg/SVGAnimateMotionElement.cpp: >+ (WebCore::SVGAnimateMotionElement::applyResultsToTarget): >+ * svg/SVGCircleElement.cpp: >+ (WebCore::SVGCircleElement::svgAttributeChanged): >+ * svg/SVGClipPathElement.cpp: >+ (WebCore::SVGClipPathElement::svgAttributeChanged): >+ * svg/SVGComponentTransferFunctionElement.cpp: >+ (WebCore::SVGComponentTransferFunctionElement::svgAttributeChanged): >+ * svg/SVGElement.cpp: >+ (WebCore::SVGElement::commitPropertyChange): >+ (WebCore::SVGElement::setPresentationalHintStyleIsDirty): >+ (WebCore::SVGElement::setNeedsParentAndResourceInvalidation): >+ (WebCore::SVGElement::invalidateParentAndResourceIfNeeded): >+ * svg/SVGElement.h: >+ (WebCore::SVGElement::setAnimatedSVGAttributesAreDirty): >+ (WebCore::SVGElement::invalidateSVGAttributes): Deleted. >+ (WebCore::SVGElement::invalidateSVGPresentationalHintStyle): Deleted. >+ * svg/SVGEllipseElement.cpp: >+ (WebCore::SVGEllipseElement::svgAttributeChanged): >+ * svg/SVGFEBlendElement.cpp: >+ (WebCore::SVGFEBlendElement::svgAttributeChanged): >+ * svg/SVGFEColorMatrixElement.cpp: >+ (WebCore::SVGFEColorMatrixElement::svgAttributeChanged): >+ * svg/SVGFEComponentTransferElement.cpp: >+ (WebCore::SVGFEComponentTransferElement::svgAttributeChanged): >+ * svg/SVGFEComponentTransferElement.h: >+ * 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): >+ (WebCore::SVGFEImageElement::notifyFinished): >+ * 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): >+ * svg/SVGFilterPrimitiveStandardAttributes.cpp: >+ (WebCore::SVGFilterPrimitiveStandardAttributes::svgAttributeChanged): >+ (WebCore::SVGFilterPrimitiveStandardAttributes::childrenChanged): >+ (WebCore::invalidateFilterPrimitiveParent): >+ * 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): >+ * 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): >+ * svg/SVGMaskElement.cpp: >+ (WebCore::SVGMaskElement::svgAttributeChanged): >+ * svg/SVGPathElement.cpp: >+ (WebCore::SVGPathElement::svgAttributeChanged): >+ * svg/SVGPatternElement.cpp: >+ (WebCore::SVGPatternElement::svgAttributeChanged): >+ * svg/SVGPolyElement.cpp: >+ (WebCore::SVGPolyElement::svgAttributeChanged): >+ * svg/SVGRadialGradientElement.cpp: >+ (WebCore::SVGRadialGradientElement::svgAttributeChanged): >+ * svg/SVGRectElement.cpp: >+ (WebCore::SVGRectElement::svgAttributeChanged): >+ * svg/SVGSVGElement.cpp: >+ (WebCore::SVGSVGElement::svgAttributeChanged): >+ (WebCore::SVGSVGElement::scrollToFragment): >+ (WebCore::SVGSVGElement::resetScrollAnchor): >+ * 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): >+ * svg/properties/SVGAttributeAnimator.cpp: >+ (WebCore::SVGAttributeAnimator::invalidateStyle): >+ > 2022-02-25 Carlos Garcia Campos <cgarcia@igalia.com> > > AX: List item marker not exposed when not a direct child of a list item >diff --git a/Source/WebCore/rendering/svg/RenderSVGImage.cpp b/Source/WebCore/rendering/svg/RenderSVGImage.cpp >index ecf17131a1c52592a5f730a6d159f11d88adfaa7..a1233deea97cefb56a57daa5c07e3c66efe8c30c 100644 >--- a/Source/WebCore/rendering/svg/RenderSVGImage.cpp >+++ b/Source/WebCore/rendering/svg/RenderSVGImage.cpp >@@ -245,18 +245,13 @@ void RenderSVGImage::imageChanged(WrappedImagePtr, const IntRect*) > if (auto* resources = SVGResourcesCache::cachedResourcesForRenderer(*this)) > resources->removeClientFromCache(*this); > >- // Eventually notify parent resources, that we've changed. >- RenderSVGResource::markForLayoutAndParentResourceInvalidation(*this, false); >- > // Update the SVGImageCache sizeAndScales entry in case image loading finished after layout. > // (https://bugs.webkit.org/show_bug.cgi?id=99489) > m_objectBoundingBox = FloatRect(); >- if (updateImageViewport()) >- setNeedsLayout(); > > invalidateBufferedForeground(); > >- repaint(); >+ imageElement().setNeedsParentAndResourceInvalidation(); > } > > void RenderSVGImage::addFocusRingRects(Vector<LayoutRect>& rects, const LayoutPoint&, const RenderLayerModelObject*) >diff --git a/Source/WebCore/rendering/svg/RenderSVGResource.cpp b/Source/WebCore/rendering/svg/RenderSVGResource.cpp >index e6712fc26f0308df0cea182b09fea739bf3d25c7..d215143ef35f5cc49d1fa7f58fec44435fead7a2 100644 >--- a/Source/WebCore/rendering/svg/RenderSVGResource.cpp >+++ b/Source/WebCore/rendering/svg/RenderSVGResource.cpp >@@ -159,16 +159,7 @@ RenderSVGResourceSolidColor* RenderSVGResource::sharedSolidPaintingResource() > > static void removeFromCacheAndInvalidateDependencies(RenderElement& renderer, bool needsLayout) > { >- if (auto* resources = SVGResourcesCache::cachedResourcesForRenderer(renderer)) { >- if (RenderSVGResourceFilter* filter = resources->filter()) >- filter->removeClientFromCache(renderer); >- >- if (RenderSVGResourceMasker* masker = resources->masker()) >- masker->removeClientFromCache(renderer); >- >- if (RenderSVGResourceClipper* clipper = resources->clipper()) >- clipper->removeClientFromCache(renderer); >- } >+ SVGResourcesCache::removeRendererFromResources(renderer); > > if (!is<SVGElement>(renderer.element())) > return; >diff --git a/Source/WebCore/rendering/svg/SVGResourcesCache.cpp b/Source/WebCore/rendering/svg/SVGResourcesCache.cpp >index 6086cef9e8186a590d3ac1a1862b953d5b52c1d5..6e2babd090a8e768d83ff05e9e647a8638fda8d5 100644 >--- a/Source/WebCore/rendering/svg/SVGResourcesCache.cpp >+++ b/Source/WebCore/rendering/svg/SVGResourcesCache.cpp >@@ -170,6 +170,22 @@ void SVGResourcesCache::resourceDestroyed(RenderSVGResourceContainer& resource) > } > } > >+void SVGResourcesCache::removeRendererFromResources(RenderElement& renderer) >+{ >+ auto* resources = SVGResourcesCache::cachedResourcesForRenderer(renderer); >+ if (!resources) >+ return; >+ >+ if (auto filter = resources->filter()) >+ filter->removeClientFromCache(renderer); >+ >+ if (auto masker = resources->masker()) >+ masker->removeClientFromCache(renderer); >+ >+ if (auto clipper = resources->clipper()) >+ clipper->removeClientFromCache(renderer); >+} >+ > SVGResourcesCache::SetStyleForScope::SetStyleForScope(RenderElement& renderer, const RenderStyle& scopedStyle, const RenderStyle& newStyle) > : m_renderer(renderer) > , m_scopedStyle(scopedStyle) >diff --git a/Source/WebCore/rendering/svg/SVGResourcesCache.h b/Source/WebCore/rendering/svg/SVGResourcesCache.h >index 58c91474dbb035eb35d3ac6717bf4ffdd1852bad..7b6bc9d2db034d2bde2c150425293b73a180a1ed 100644 >--- a/Source/WebCore/rendering/svg/SVGResourcesCache.h >+++ b/Source/WebCore/rendering/svg/SVGResourcesCache.h >@@ -58,6 +58,8 @@ public: > // Called from RenderSVGResourceContainer::willBeDestroyed(). > static void resourceDestroyed(RenderSVGResourceContainer&); > >+ static void removeRendererFromResources(RenderElement&); >+ > class SetStyleForScope { > WTF_MAKE_NONCOPYABLE(SetStyleForScope); > public: >diff --git a/Source/WebCore/rendering/updating/RenderTreeUpdater.cpp b/Source/WebCore/rendering/updating/RenderTreeUpdater.cpp >index 3ec451a961378545585d673dfbb9bd888532e290..1dfadd1da941533c9fe3657457e2cbf5c0ebf2fe 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 (elementUpdates) > updateElementRenderer(element, *elementUpdates); > >+ if (is<SVGElement>(element)) >+ downcast<SVGElement>(element).invalidateParentAndResourceIfNeeded(); >+ > 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..36b7ca76ba108f2cd392a6c64592cc9b8a2f0a61 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 invalidate = [](SVGElement& element) { >+ if (auto renderer = element.renderer()) >+ renderer->setNeedsTransformUpdate(); >+ element.setNeedsParentAndResourceInvalidation(); >+ }; >+ >+ invalidate(*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); >- } >+ invalidate(instance); > } > } > >diff --git a/Source/WebCore/svg/SVGCircleElement.cpp b/Source/WebCore/svg/SVGCircleElement.cpp >index 6d6af2505c4cef2296c9032112d87aff4674947c..7c5f54f8a28dee09f70ff0310c3582b6e0979253 100644 >--- a/Source/WebCore/svg/SVGCircleElement.cpp >+++ b/Source/WebCore/svg/SVGCircleElement.cpp >@@ -68,8 +68,9 @@ void SVGCircleElement::parseAttribute(const QualifiedName& name, const AtomStrin > void SVGCircleElement::svgAttributeChanged(const QualifiedName& attrName) > { > if (PropertyRegistry::isKnownAttribute(attrName)) { >+ ASSERT(PropertyRegistry::isAnimatedLengthAttribute(attrName)); > InstanceInvalidationGuard guard(*this); >- invalidateSVGPresentationalHintStyle(); >+ setPresentationalHintStyleIsDirty(); > return; > } > >diff --git a/Source/WebCore/svg/SVGClipPathElement.cpp b/Source/WebCore/svg/SVGClipPathElement.cpp >index b4e79958c5b130355f79994b1183c53f92ced69b..1000922896d61e30ce782e37853362d1c743444a 100644 >--- a/Source/WebCore/svg/SVGClipPathElement.cpp >+++ b/Source/WebCore/svg/SVGClipPathElement.cpp >@@ -66,9 +66,7 @@ void SVGClipPathElement::svgAttributeChanged(const QualifiedName& attrName) > { > if (PropertyRegistry::isKnownAttribute(attrName)) { > InstanceInvalidationGuard guard(*this); >- >- if (RenderObject* object = renderer()) >- object->setNeedsLayout(); >+ setNeedsParentAndResourceInvalidation(); > return; > } > >@@ -82,8 +80,7 @@ void SVGClipPathElement::childrenChanged(const ChildChange& change) > if (change.source == ChildChange::Source::Parser) > return; > >- if (RenderObject* object = renderer()) >- object->setNeedsLayout(); >+ setNeedsParentAndResourceInvalidation(); > } > > RenderPtr<RenderElement> SVGClipPathElement::createElementRenderer(RenderStyle&& style, const RenderTreePosition&) >diff --git a/Source/WebCore/svg/SVGComponentTransferFunctionElement.cpp b/Source/WebCore/svg/SVGComponentTransferFunctionElement.cpp >index 0cd4fd41e53ad15828328e3b13f82ee6065e2d9d..8ddc8dbd7e2d415facc8381a2080f5cdea688933 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); >+ invalidateFilterPrimitiveParent(*this); > return; > } > >diff --git a/Source/WebCore/svg/SVGElement.cpp b/Source/WebCore/svg/SVGElement.cpp >index dc592a2d741df37fe967cfcb32ced6c766109fd6..e5739365d5959aa58ed8f2753cc89c1a2a640b93 100644 >--- a/Source/WebCore/svg/SVGElement.cpp >+++ b/Source/WebCore/svg/SVGElement.cpp >@@ -610,7 +610,7 @@ void SVGElement::commitPropertyChange(SVGProperty* property) > // SVGLengthList and not the SVGLength. > property->setDirty(); > >- invalidateSVGAttributes(); >+ setAnimatedSVGAttributesAreDirty(); > svgAttributeChanged(propertyRegistry().propertyAttributeName(*property)); > } > >@@ -626,7 +626,7 @@ void SVGElement::commitPropertyChange(SVGAnimatedProperty& animatedProperty) > else > setSynchronizedLazyAttribute(attributeName, animatedProperty.baseValAsString()); > >- invalidateSVGAttributes(); >+ setAnimatedSVGAttributesAreDirty(); > svgAttributeChanged(attributeName); > } > >@@ -659,7 +659,7 @@ RefPtr<SVGAttributeAnimator> SVGElement::createAnimator(const QualifiedName& att > instance->propertyRegistry().appendAnimatedInstance(attributeName, *animator); > return animator; > } >- >+ > void SVGElement::animatorWillBeDeleted(const QualifiedName& attributeName) > { > propertyAnimatorFactory().animatorWillBeDeleted(attributeName); >@@ -883,6 +883,29 @@ void SVGElement::collectPresentationalHintsForAttribute(const QualifiedName& nam > addPropertyToPresentationalHintStyle(style, propertyID, value); > } > >+void SVGElement::setPresentationalHintStyleIsDirty() >+{ >+ ensureUniqueElementData().setPresentationalHintStyleIsDirty(true); >+ // Trigger style recalculation for "elements as resource" (e.g. referenced by feImage). >+ invalidateStyle(); >+} >+ >+void SVGElement::setNeedsParentAndResourceInvalidation() >+{ >+ m_needsParentAndResourceInvalidation = true; >+ invalidateStyle(); >+} >+ >+void SVGElement::invalidateParentAndResourceIfNeeded() >+{ >+ if (!m_needsParentAndResourceInvalidation) >+ return; >+ >+ if (auto renderer = this->renderer()) >+ RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer); >+ m_needsParentAndResourceInvalidation = 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 2d3a331e8e8254e67f0c6762cd205323fa960ccb..ceb24bc1eb8c04ca613d45e4a2e0b484187d535e 100644 >--- a/Source/WebCore/svg/SVGElement.h >+++ b/Source/WebCore/svg/SVGElement.h >@@ -82,8 +82,10 @@ public: > > virtual AffineTransform* supplementalTransform() { return nullptr; } > >- inline void invalidateSVGAttributes(); >- inline void invalidateSVGPresentationalHintStyle(); >+ inline void setAnimatedSVGAttributesAreDirty(); >+ void setPresentationalHintStyleIsDirty(); >+ void setNeedsParentAndResourceInvalidation(); >+ void invalidateParentAndResourceIfNeeded(); > > // The instances of an element are clones made in shadow trees to implement <use>. > const WeakHashSet<SVGElement>& instances() const; >@@ -193,6 +195,8 @@ private: > > void invalidateInstances(); > >+ bool m_needsParentAndResourceInvalidation { false }; >+ > std::unique_ptr<SVGElementRareData> m_svgRareData; > > WeakHashSet<SVGElement> m_elementsWithRelativeLengths; >diff --git a/Source/WebCore/svg/SVGElementInlines.h b/Source/WebCore/svg/SVGElementInlines.h >index 597aa0ee1576c21e75e27d41ab163238bb208ab2..c69ec70bb699b4189c5fae6cdddca3145f7c559c 100644 >--- a/Source/WebCore/svg/SVGElementInlines.h >+++ b/Source/WebCore/svg/SVGElementInlines.h >@@ -30,18 +30,11 @@ > > namespace WebCore { > >-inline void SVGElement::invalidateSVGAttributes() >+inline void SVGElement::setAnimatedSVGAttributesAreDirty() > { > ensureUniqueElementData().setAnimatedSVGAttributesAreDirty(true); > } > >-inline void SVGElement::invalidateSVGPresentationalHintStyle() >-{ >- ensureUniqueElementData().setPresentationalHintStyleIsDirty(true); >- // Trigger style recalculation for "elements as resource" (e.g. referenced by feImage). >- invalidateStyle(); >-} >- > struct SVGAttributeHashTranslator { > static unsigned hash(const QualifiedName& key) > { >diff --git a/Source/WebCore/svg/SVGEllipseElement.cpp b/Source/WebCore/svg/SVGEllipseElement.cpp >index 59599711f4ba99412d9872b80214884072752d19..d54ce2ba6d30715ad01a0cead02f3d3cbea960f9 100644 >--- a/Source/WebCore/svg/SVGEllipseElement.cpp >+++ b/Source/WebCore/svg/SVGEllipseElement.cpp >@@ -71,8 +71,9 @@ void SVGEllipseElement::parseAttribute(const QualifiedName& name, const AtomStri > void SVGEllipseElement::svgAttributeChanged(const QualifiedName& attrName) > { > if (PropertyRegistry::isKnownAttribute(attrName)) { >+ ASSERT(PropertyRegistry::isAnimatedLengthAttribute(attrName)); > InstanceInvalidationGuard guard(*this); >- invalidateSVGPresentationalHintStyle(); >+ setPresentationalHintStyleIsDirty(); > return; > } > >diff --git a/Source/WebCore/svg/SVGFEBlendElement.cpp b/Source/WebCore/svg/SVGFEBlendElement.cpp >index e1cc8335c320d9efe5c2438430fc839748e76f35..2677a9c9d728989d97ee0c92d3ee8263993a750d 100644 >--- a/Source/WebCore/svg/SVGFEBlendElement.cpp >+++ b/Source/WebCore/svg/SVGFEBlendElement.cpp >@@ -83,15 +83,12 @@ bool SVGFEBlendElement::setFilterEffectAttribute(FilterEffect* effect, const Qua > > void SVGFEBlendElement::svgAttributeChanged(const QualifiedName& attrName) > { >- if (attrName == SVGNames::modeAttr) { >+ if (PropertyRegistry::isKnownAttribute(attrName)) { > InstanceInvalidationGuard guard(*this); >- primitiveAttributeChanged(attrName); >- return; >- } >- >- if (attrName == SVGNames::inAttr || attrName == SVGNames::in2Attr) { >- InstanceInvalidationGuard guard(*this); >- invalidate(); >+ if (attrName == SVGNames::inAttr || attrName == SVGNames::in2Attr) >+ setNeedsParentAndResourceInvalidation(); >+ else >+ primitiveAttributeChanged(attrName); > return; > } > >diff --git a/Source/WebCore/svg/SVGFEColorMatrixElement.cpp b/Source/WebCore/svg/SVGFEColorMatrixElement.cpp >index 69f91dc0e50967cfc67ccaaff00fd14a3d8567c4..9b52c4f57501cf80270e3af2f36858ea08ff2824 100644 >--- a/Source/WebCore/svg/SVGFEColorMatrixElement.cpp >+++ b/Source/WebCore/svg/SVGFEColorMatrixElement.cpp >@@ -84,15 +84,12 @@ bool SVGFEColorMatrixElement::setFilterEffectAttribute(FilterEffect* effect, con > > void SVGFEColorMatrixElement::svgAttributeChanged(const QualifiedName& attrName) > { >- if (attrName == SVGNames::typeAttr || attrName == SVGNames::valuesAttr) { >+ if (PropertyRegistry::isKnownAttribute(attrName)) { > InstanceInvalidationGuard guard(*this); >- primitiveAttributeChanged(attrName); >- return; >- } >- >- if (attrName == SVGNames::inAttr) { >- InstanceInvalidationGuard guard(*this); >- invalidate(); >+ if (attrName == SVGNames::inAttr) >+ setNeedsParentAndResourceInvalidation(); >+ else >+ primitiveAttributeChanged(attrName); > return; > } > >diff --git a/Source/WebCore/svg/SVGFEComponentTransferElement.cpp b/Source/WebCore/svg/SVGFEComponentTransferElement.cpp >index 9a75b46287fc06940922ec39513173eef24033e8..b5378eb73e4567774addd14256f2fc98785d33df 100644 >--- a/Source/WebCore/svg/SVGFEComponentTransferElement.cpp >+++ b/Source/WebCore/svg/SVGFEComponentTransferElement.cpp >@@ -62,6 +62,17 @@ void SVGFEComponentTransferElement::parseAttribute(const QualifiedName& name, co > SVGFilterPrimitiveStandardAttributes::parseAttribute(name, value); > } > >+void SVGFEComponentTransferElement::svgAttributeChanged(const QualifiedName& attrName) >+{ >+ if (PropertyRegistry::isKnownAttribute(attrName)) { >+ InstanceInvalidationGuard guard(*this); >+ invalidateFilterPrimitiveParent(*this); >+ return; >+ } >+ >+ SVGFilterPrimitiveStandardAttributes::svgAttributeChanged(attrName); >+} >+ > RefPtr<FilterEffect> SVGFEComponentTransferElement::filterEffect(const SVGFilterBuilder&, const FilterEffectVector&) const > { > ComponentTransferFunction red; >diff --git a/Source/WebCore/svg/SVGFEComponentTransferElement.h b/Source/WebCore/svg/SVGFEComponentTransferElement.h >index 64f7b9ae891ab93127d990f447ee4df264558b11..f14c3c772a6c3cd8a149d0dd6c422f0ec30c7ae3 100644 >--- a/Source/WebCore/svg/SVGFEComponentTransferElement.h >+++ b/Source/WebCore/svg/SVGFEComponentTransferElement.h >@@ -40,8 +40,8 @@ private: > using PropertyRegistry = SVGPropertyOwnerRegistry<SVGFEComponentTransferElement, SVGFilterPrimitiveStandardAttributes>; > const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } > >- // FIXME: svgAttributeChanged missing. > void parseAttribute(const QualifiedName&, const AtomString&) override; >+ void svgAttributeChanged(const QualifiedName&) override; > > Vector<AtomString> filterEffectInputsNames() const override { return { in1() }; } > RefPtr<FilterEffect> filterEffect(const SVGFilterBuilder&, const FilterEffectVector&) const override; >diff --git a/Source/WebCore/svg/SVGFECompositeElement.cpp b/Source/WebCore/svg/SVGFECompositeElement.cpp >index 459edab8597ba2796c7792f9fee578c9838daa1a..97b4cc5c06c73b170445edbb889173666e434bef 100644 >--- a/Source/WebCore/svg/SVGFECompositeElement.cpp >+++ b/Source/WebCore/svg/SVGFECompositeElement.cpp >@@ -115,15 +115,12 @@ bool SVGFECompositeElement::setFilterEffectAttribute(FilterEffect* effect, const > > void SVGFECompositeElement::svgAttributeChanged(const QualifiedName& attrName) > { >- if (attrName == SVGNames::operatorAttr || attrName == SVGNames::k1Attr || attrName == SVGNames::k2Attr || attrName == SVGNames::k3Attr || attrName == SVGNames::k4Attr) { >+ if (PropertyRegistry::isKnownAttribute(attrName)) { > InstanceInvalidationGuard guard(*this); >- primitiveAttributeChanged(attrName); >- return; >- } >- >- if (attrName == SVGNames::inAttr || attrName == SVGNames::in2Attr) { >- InstanceInvalidationGuard guard(*this); >- invalidate(); >+ if (attrName == SVGNames::inAttr || attrName == SVGNames::in2Attr) >+ setNeedsParentAndResourceInvalidation(); >+ else >+ primitiveAttributeChanged(attrName); > return; > } > >diff --git a/Source/WebCore/svg/SVGFEConvolveMatrixElement.cpp b/Source/WebCore/svg/SVGFEConvolveMatrixElement.cpp >index 02bc37b6d4a3bc28da8aed363ae17497f619f76b..b94cde58ebb555ae4a65857151a1d6a46158ab6c 100644 >--- a/Source/WebCore/svg/SVGFEConvolveMatrixElement.cpp >+++ b/Source/WebCore/svg/SVGFEConvolveMatrixElement.cpp >@@ -160,27 +160,24 @@ void SVGFEConvolveMatrixElement::setOrder(float x, float y) > { > m_orderX->setBaseValInternal(x); > m_orderY->setBaseValInternal(y); >- invalidate(); >+ setNeedsParentAndResourceInvalidation(); > } > > void SVGFEConvolveMatrixElement::setKernelUnitLength(float x, float y) > { > m_kernelUnitLengthX->setBaseValInternal(x); > m_kernelUnitLengthY->setBaseValInternal(y); >- invalidate(); >+ setNeedsParentAndResourceInvalidation(); > } > > void SVGFEConvolveMatrixElement::svgAttributeChanged(const QualifiedName& attrName) > { >- if (attrName == SVGNames::edgeModeAttr || attrName == SVGNames::divisorAttr || attrName == SVGNames::biasAttr || attrName == SVGNames::targetXAttr || attrName == SVGNames::targetYAttr || attrName == SVGNames::kernelUnitLengthAttr || attrName == SVGNames::preserveAlphaAttr) { >+ if (PropertyRegistry::isKnownAttribute(attrName)) { > InstanceInvalidationGuard guard(*this); >- primitiveAttributeChanged(attrName); >- return; >- } >- >- if (attrName == SVGNames::inAttr || attrName == SVGNames::orderAttr || attrName == SVGNames::kernelMatrixAttr) { >- InstanceInvalidationGuard guard(*this); >- invalidate(); >+ if (attrName == SVGNames::inAttr || attrName == SVGNames::orderAttr || attrName == SVGNames::kernelMatrixAttr) >+ setNeedsParentAndResourceInvalidation(); >+ else >+ primitiveAttributeChanged(attrName); > return; > } > >diff --git a/Source/WebCore/svg/SVGFEDiffuseLightingElement.cpp b/Source/WebCore/svg/SVGFEDiffuseLightingElement.cpp >index 9684fab800cc056a834b747ecf2d73dbaf0fc698..8a6dc970d254e2c41c4c8a9a8b7cd2e566a9a383 100644 >--- a/Source/WebCore/svg/SVGFEDiffuseLightingElement.cpp >+++ b/Source/WebCore/svg/SVGFEDiffuseLightingElement.cpp >@@ -125,15 +125,12 @@ bool SVGFEDiffuseLightingElement::setFilterEffectAttribute(FilterEffect* effect, > > void SVGFEDiffuseLightingElement::svgAttributeChanged(const QualifiedName& attrName) > { >- if (attrName == SVGNames::surfaceScaleAttr || attrName == SVGNames::diffuseConstantAttr || attrName == SVGNames::kernelUnitLengthAttr || attrName == SVGNames::lighting_colorAttr) { >+ if (PropertyRegistry::isKnownAttribute(attrName)) { > InstanceInvalidationGuard guard(*this); >- primitiveAttributeChanged(attrName); >- return; >- } >- >- if (attrName == SVGNames::inAttr) { >- InstanceInvalidationGuard guard(*this); >- invalidate(); >+ if (attrName == SVGNames::inAttr) >+ setNeedsParentAndResourceInvalidation(); >+ else >+ primitiveAttributeChanged(attrName); > return; > } > >diff --git a/Source/WebCore/svg/SVGFEDisplacementMapElement.cpp b/Source/WebCore/svg/SVGFEDisplacementMapElement.cpp >index b62c4649be13996c181e3a986e0f9c3c3d53db14..523678dd9696346bbc68dcc6e384dd772e06a5ed 100644 >--- a/Source/WebCore/svg/SVGFEDisplacementMapElement.cpp >+++ b/Source/WebCore/svg/SVGFEDisplacementMapElement.cpp >@@ -99,15 +99,12 @@ bool SVGFEDisplacementMapElement::setFilterEffectAttribute(FilterEffect* effect, > > void SVGFEDisplacementMapElement::svgAttributeChanged(const QualifiedName& attrName) > { >- if (attrName == SVGNames::xChannelSelectorAttr || attrName == SVGNames::yChannelSelectorAttr || attrName == SVGNames::scaleAttr) { >+ if (PropertyRegistry::isKnownAttribute(attrName)) { > InstanceInvalidationGuard guard(*this); >- primitiveAttributeChanged(attrName); >- return; >- } >- >- if (attrName == SVGNames::inAttr || attrName == SVGNames::in2Attr) { >- InstanceInvalidationGuard guard(*this); >- invalidate(); >+ if (attrName == SVGNames::inAttr || attrName == SVGNames::in2Attr) >+ setNeedsParentAndResourceInvalidation(); >+ else >+ primitiveAttributeChanged(attrName); > return; > } > >diff --git a/Source/WebCore/svg/SVGFEDropShadowElement.cpp b/Source/WebCore/svg/SVGFEDropShadowElement.cpp >index 459910e54d2f6056ea259b18839b3e3e9b531682..bdc8dcef6bb9940524fda747a8349228eaea2880 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(); >+ setNeedsParentAndResourceInvalidation(); > } > > 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(); >+ setNeedsParentAndResourceInvalidation(); > return; > } > >diff --git a/Source/WebCore/svg/SVGFEGaussianBlurElement.cpp b/Source/WebCore/svg/SVGFEGaussianBlurElement.cpp >index b5f3c7b6ceffd65dfd0ae11a4a9b2b2e0d83b8a3..45ded00056750b5d6293d03941a73c2492d73aa4 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(); >+ setNeedsParentAndResourceInvalidation(); > } > > 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(); >+ setNeedsParentAndResourceInvalidation(); > return; > } > >diff --git a/Source/WebCore/svg/SVGFEImageElement.cpp b/Source/WebCore/svg/SVGFEImageElement.cpp >index 4a9c3c45a923ebd2abdf5a1fd2d7fe5060794d43..d5e86896b5d651287886957ec8fff9e8bfa8074e 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(); >+ setNeedsParentAndResourceInvalidation(); > } > > void SVGFEImageElement::parseAttribute(const QualifiedName& name, const AtomString& value) >@@ -127,9 +127,9 @@ void SVGFEImageElement::parseAttribute(const QualifiedName& name, const AtomStri > > void SVGFEImageElement::svgAttributeChanged(const QualifiedName& attrName) > { >- if (attrName == SVGNames::preserveAspectRatioAttr) { >+ if (PropertyRegistry::isKnownAttribute(attrName)) { > InstanceInvalidationGuard guard(*this); >- invalidate(); >+ setNeedsParentAndResourceInvalidation(); > return; > } > >@@ -165,16 +165,11 @@ void SVGFEImageElement::notifyFinished(CachedResource&, const NetworkLoadMetrics > if (!isConnected()) > return; > >- RefPtr parent = parentElement(); >- >+ auto parent = parentElement(); > if (!parent || !parent->hasTagName(SVGNames::filterTag)) > return; > >- RenderElement* parentRenderer = parent->renderer(); >- if (!parentRenderer) >- return; >- >- RenderSVGResource::markForLayoutAndParentResourceInvalidation(*parentRenderer); >+ downcast<SVGElement>(*parent).setNeedsParentAndResourceInvalidation(); > } > > static inline IntRect scaledImageBufferRect(const FloatRect& rect, const FloatSize& scale) >diff --git a/Source/WebCore/svg/SVGFELightElement.cpp b/Source/WebCore/svg/SVGFELightElement.cpp >index c62526ccd7583270e8856d12e327dec33494b012..87a2e021e470ad95d3d37544dfca75eadb078721 100644 >--- a/Source/WebCore/svg/SVGFELightElement.cpp >+++ b/Source/WebCore/svg/SVGFELightElement.cpp >@@ -151,15 +151,9 @@ void SVGFELightElement::svgAttributeChanged(const QualifiedName& attrName) > void SVGFELightElement::childrenChanged(const ChildChange& change) > { > SVGElement::childrenChanged(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); >+ invalidateFilterPrimitiveParent(*this); > } > > } >diff --git a/Source/WebCore/svg/SVGFEMergeNodeElement.cpp b/Source/WebCore/svg/SVGFEMergeNodeElement.cpp >index 4be907826dba06193684e0a4daf5ba2b5fa94afa..91a6c14041d157d86f6abfa6265c19d53c3abcef 100644 >--- a/Source/WebCore/svg/SVGFEMergeNodeElement.cpp >+++ b/Source/WebCore/svg/SVGFEMergeNodeElement.cpp >@@ -60,9 +60,9 @@ void SVGFEMergeNodeElement::parseAttribute(const QualifiedName& name, const Atom > > void SVGFEMergeNodeElement::svgAttributeChanged(const QualifiedName& attrName) > { >- if (attrName == SVGNames::inAttr) { >+ if (PropertyRegistry::isKnownAttribute(attrName)) { > InstanceInvalidationGuard guard(*this); >- invalidateFilterPrimitiveParent(this); >+ invalidateFilterPrimitiveParent(*this); > return; > } > >diff --git a/Source/WebCore/svg/SVGFEMorphologyElement.cpp b/Source/WebCore/svg/SVGFEMorphologyElement.cpp >index afb999400d5026673427eb7508655ee2c8cc1f95..8650660246b2bcbc4abe0079e27ffdb7eab9b31b 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(); >+ setNeedsParentAndResourceInvalidation(); > } > > void SVGFEMorphologyElement::parseAttribute(const QualifiedName& name, const AtomString& value) >@@ -98,15 +98,12 @@ bool SVGFEMorphologyElement::setFilterEffectAttribute(FilterEffect* effect, cons > > void SVGFEMorphologyElement::svgAttributeChanged(const QualifiedName& attrName) > { >- if (attrName == SVGNames::operatorAttr || attrName == SVGNames::radiusAttr) { >+ if (PropertyRegistry::isKnownAttribute(attrName)) { > InstanceInvalidationGuard guard(*this); >- primitiveAttributeChanged(attrName); >- return; >- } >- >- if (attrName == SVGNames::inAttr) { >- InstanceInvalidationGuard guard(*this); >- invalidate(); >+ if (attrName == SVGNames::inAttr) >+ setNeedsParentAndResourceInvalidation(); >+ else >+ primitiveAttributeChanged(attrName); > return; > } > >diff --git a/Source/WebCore/svg/SVGFEOffsetElement.cpp b/Source/WebCore/svg/SVGFEOffsetElement.cpp >index 843f8de77ab8c81dba33af21df60c8d2e8cb2743..25b86ad932d5bc739a1409ffdc87925aac21f375 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(); >+ setNeedsParentAndResourceInvalidation(); > return; > } > >diff --git a/Source/WebCore/svg/SVGFESpecularLightingElement.cpp b/Source/WebCore/svg/SVGFESpecularLightingElement.cpp >index 6815268082fd88c267779f3119893ed6083206b9..a72394265cd0d28a72962117bda03bc44af1ab0f 100644 >--- a/Source/WebCore/svg/SVGFESpecularLightingElement.cpp >+++ b/Source/WebCore/svg/SVGFESpecularLightingElement.cpp >@@ -135,15 +135,12 @@ bool SVGFESpecularLightingElement::setFilterEffectAttribute(FilterEffect* effect > > void SVGFESpecularLightingElement::svgAttributeChanged(const QualifiedName& attrName) > { >- if (attrName == SVGNames::surfaceScaleAttr || attrName == SVGNames::specularConstantAttr || attrName == SVGNames::specularExponentAttr || attrName == SVGNames::kernelUnitLengthAttr) { >+ if (PropertyRegistry::isKnownAttribute(attrName)) { > InstanceInvalidationGuard guard(*this); >- primitiveAttributeChanged(attrName); >- return; >- } >- >- if (attrName == SVGNames::inAttr) { >- InstanceInvalidationGuard guard(*this); >- invalidate(); >+ if (attrName == SVGNames::inAttr) >+ setNeedsParentAndResourceInvalidation(); >+ else >+ primitiveAttributeChanged(attrName); > return; > } > >diff --git a/Source/WebCore/svg/SVGFETileElement.cpp b/Source/WebCore/svg/SVGFETileElement.cpp >index 2a7a3f493beafa1e2d234ce3a9dca3e82338587f..a979dc9c3ae0562db8c9c84f62564144998c7093 100644 >--- a/Source/WebCore/svg/SVGFETileElement.cpp >+++ b/Source/WebCore/svg/SVGFETileElement.cpp >@@ -58,9 +58,9 @@ void SVGFETileElement::parseAttribute(const QualifiedName& name, const AtomStrin > > void SVGFETileElement::svgAttributeChanged(const QualifiedName& attrName) > { >- if (attrName == SVGNames::inAttr) { >+ if (PropertyRegistry::isKnownAttribute(attrName)) { > InstanceInvalidationGuard guard(*this); >- invalidate(); >+ setNeedsParentAndResourceInvalidation(); > return; > } > >diff --git a/Source/WebCore/svg/SVGFilterElement.cpp b/Source/WebCore/svg/SVGFilterElement.cpp >index 5578b519a3622bd706ad27bfe4c6003914858ca0..24427f3bfa14f789e4ad85bb8fc98ea4ccd64c2d 100644 >--- a/Source/WebCore/svg/SVGFilterElement.cpp >+++ b/Source/WebCore/svg/SVGFilterElement.cpp >@@ -92,16 +92,17 @@ void SVGFilterElement::parseAttribute(const QualifiedName& name, const AtomStrin > > void SVGFilterElement::svgAttributeChanged(const QualifiedName& attrName) > { >- if (PropertyRegistry::isAnimatedLengthAttribute(attrName)) { >+ if (PropertyRegistry::isKnownAttribute(attrName)) { > InstanceInvalidationGuard guard(*this); >- invalidateSVGPresentationalHintStyle(); >- return; >+ if (PropertyRegistry::isAnimatedLengthAttribute(attrName)) >+ setPresentationalHintStyleIsDirty(); >+ else >+ setNeedsParentAndResourceInvalidation(); > } > >- if (PropertyRegistry::isKnownAttribute(attrName) || SVGURIReference::isKnownAttribute(attrName)) { >- if (auto* renderer = this->renderer()) >- renderer->setNeedsLayout(); >- return; >+ if (SVGURIReference::isKnownAttribute(attrName)) { >+ InstanceInvalidationGuard guard(*this); >+ setNeedsParentAndResourceInvalidation(); > } > > SVGElement::svgAttributeChanged(attrName); >@@ -114,8 +115,7 @@ void SVGFilterElement::childrenChanged(const ChildChange& change) > if (change.source == ChildChange::Source::Parser) > return; > >- if (RenderObject* object = renderer()) >- object->setNeedsLayout(); >+ setNeedsParentAndResourceInvalidation(); > } > > RenderPtr<RenderElement> SVGFilterElement::createElementRenderer(RenderStyle&& style, const RenderTreePosition&) >diff --git a/Source/WebCore/svg/SVGFilterPrimitiveStandardAttributes.cpp b/Source/WebCore/svg/SVGFilterPrimitiveStandardAttributes.cpp >index 00e4e698664532922d6375e77ad43b285c74494a..916ae5280c11ee4711c2f7d8e2a7f3b1e08dd9d2 100644 >--- a/Source/WebCore/svg/SVGFilterPrimitiveStandardAttributes.cpp >+++ b/Source/WebCore/svg/SVGFilterPrimitiveStandardAttributes.cpp >@@ -78,8 +78,7 @@ void SVGFilterPrimitiveStandardAttributes::svgAttributeChanged(const QualifiedNa > { > if (PropertyRegistry::isKnownAttribute(attrName)) { > InstanceInvalidationGuard guard(*this); >- invalidate(); >- return; >+ setNeedsParentAndResourceInvalidation(); > } > > SVGElement::svgAttributeChanged(attrName); >@@ -91,7 +90,7 @@ void SVGFilterPrimitiveStandardAttributes::childrenChanged(const ChildChange& ch > > if (change.source == ChildChange::Source::Parser) > return; >- invalidate(); >+ setNeedsParentAndResourceInvalidation(); > } > > RenderPtr<RenderElement> SVGFilterPrimitiveStandardAttributes::createElementRenderer(RenderStyle&& style, const RenderTreePosition&) >@@ -107,20 +106,13 @@ bool SVGFilterPrimitiveStandardAttributes::rendererIsNeeded(const RenderStyle& s > return false; > } > >-void invalidateFilterPrimitiveParent(SVGElement* element) >+void invalidateFilterPrimitiveParent(SVGElement& element) > { >- if (!element) >- return; >- >- RefPtr parent = element->parentNode(); >- if (!parent) >- return; >- >- RenderElement* renderer = parent->renderer(); >- if (!renderer || !renderer->isSVGResourceFilterPrimitive()) >+ auto parent = element.parentNode(); >+ if (!is<SVGFilterPrimitiveStandardAttributes>(parent)) > return; > >- RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer, false); >+ downcast<SVGFilterPrimitiveStandardAttributes>(parent)->setNeedsParentAndResourceInvalidation(); > } > > } >diff --git a/Source/WebCore/svg/SVGFilterPrimitiveStandardAttributes.h b/Source/WebCore/svg/SVGFilterPrimitiveStandardAttributes.h >index 7df9206faa91eafefefda529e92f69c51f3d8ed9..2e2e0d21c411aea99bd648b7b5b6e883e4c1fb05 100644 >--- a/Source/WebCore/svg/SVGFilterPrimitiveStandardAttributes.h >+++ b/Source/WebCore/svg/SVGFilterPrimitiveStandardAttributes.h >@@ -62,7 +62,6 @@ protected: > void svgAttributeChanged(const QualifiedName&) override; > void childrenChanged(const ChildChange&) override; > >- void invalidate(); > void primitiveAttributeChanged(const QualifiedName& attributeName); > > private: >@@ -81,13 +80,7 @@ private: > Ref<SVGAnimatedString> m_result { SVGAnimatedString::create(this) }; > }; > >-void invalidateFilterPrimitiveParent(SVGElement*); >- >-inline void SVGFilterPrimitiveStandardAttributes::invalidate() >-{ >- if (auto* primitiveRenderer = renderer()) >- RenderSVGResource::markForLayoutAndParentResourceInvalidation(*primitiveRenderer); >-} >+void invalidateFilterPrimitiveParent(SVGElement&); > > inline void SVGFilterPrimitiveStandardAttributes::primitiveAttributeChanged(const QualifiedName& attribute) > { >diff --git a/Source/WebCore/svg/SVGForeignObjectElement.cpp b/Source/WebCore/svg/SVGForeignObjectElement.cpp >index 5ab99593d2da2ef37062930e6c4921d6abbad355..95ff556cb020ad27b3ed371a35c6fa45aeb1e48b 100644 >--- a/Source/WebCore/svg/SVGForeignObjectElement.cpp >+++ b/Source/WebCore/svg/SVGForeignObjectElement.cpp >@@ -74,15 +74,14 @@ void SVGForeignObjectElement::parseAttribute(const QualifiedName& name, const At > > void SVGForeignObjectElement::svgAttributeChanged(const QualifiedName& attrName) > { >- if (attrName == SVGNames::widthAttr || attrName == SVGNames::heightAttr) { >- invalidateSVGPresentationalHintStyle(); >- return; >- } >- >- if (attrName == SVGNames::xAttr || attrName == SVGNames::yAttr) { >- updateRelativeLengthsInformation(); >- if (auto renderer = this->renderer()) >- RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer); >+ if (PropertyRegistry::isKnownAttribute(attrName)) { >+ InstanceInvalidationGuard guard(*this); >+ if (attrName == SVGNames::widthAttr || attrName == SVGNames::heightAttr) >+ setPresentationalHintStyleIsDirty(); >+ else { >+ updateRelativeLengthsInformation(); >+ setNeedsParentAndResourceInvalidation(); >+ } > return; > } > >diff --git a/Source/WebCore/svg/SVGGeometryElement.cpp b/Source/WebCore/svg/SVGGeometryElement.cpp >index e6f2c179966abda2214b76b096a3c5ab5427f1a0..c1a151b3ba91f0cb80cf311e19ae07dbaaac72e4 100644 >--- a/Source/WebCore/svg/SVGGeometryElement.cpp >+++ b/Source/WebCore/svg/SVGGeometryElement.cpp >@@ -149,9 +149,7 @@ void SVGGeometryElement::svgAttributeChanged(const QualifiedName& attrName) > { > if (attrName == SVGNames::pathLengthAttr) { > InstanceInvalidationGuard guard(*this); >- if (auto* renderer = this->renderer()) >- RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer); >- return; >+ setNeedsParentAndResourceInvalidation(); > } > > SVGGraphicsElement::svgAttributeChanged(attrName); >diff --git a/Source/WebCore/svg/SVGGradientElement.cpp b/Source/WebCore/svg/SVGGradientElement.cpp >index 774c11e3d9873b93cde968b37eb347c76582483e..645acacd0ee4174c24af0b92c3b628c919624e3f 100644 >--- a/Source/WebCore/svg/SVGGradientElement.cpp >+++ b/Source/WebCore/svg/SVGGradientElement.cpp >@@ -77,10 +77,15 @@ void SVGGradientElement::parseAttribute(const QualifiedName& name, const AtomStr > > void SVGGradientElement::svgAttributeChanged(const QualifiedName& attrName) > { >- if (PropertyRegistry::isKnownAttribute(attrName) || SVGURIReference::isKnownAttribute(attrName)) { >+ if (PropertyRegistry::isKnownAttribute(attrName)) { > InstanceInvalidationGuard guard(*this); >- if (RenderObject* object = renderer()) >- object->setNeedsLayout(); >+ setNeedsParentAndResourceInvalidation(); >+ return; >+ } >+ >+ if (SVGURIReference::isKnownAttribute(attrName)) { >+ InstanceInvalidationGuard guard(*this); >+ setNeedsParentAndResourceInvalidation(); > return; > } > >@@ -94,8 +99,7 @@ void SVGGradientElement::childrenChanged(const ChildChange& change) > if (change.source == ChildChange::Source::Parser) > return; > >- if (RenderObject* object = renderer()) >- object->setNeedsLayout(); >+ setNeedsParentAndResourceInvalidation(); > } > > GradientColorStops SVGGradientElement::buildStops() >diff --git a/Source/WebCore/svg/SVGGraphicsElement.cpp b/Source/WebCore/svg/SVGGraphicsElement.cpp >index 49a2ca698f54e52f0920b54846de35d35ea2d1fa..c1d845adcf7e8bae93aea0082fd2b41babb8bd88 100644 >--- a/Source/WebCore/svg/SVGGraphicsElement.cpp >+++ b/Source/WebCore/svg/SVGGraphicsElement.cpp >@@ -132,14 +132,12 @@ void SVGGraphicsElement::parseAttribute(const QualifiedName& name, const AtomStr > > void SVGGraphicsElement::svgAttributeChanged(const QualifiedName& attrName) > { >- if (attrName == SVGNames::transformAttr) { >+ if (PropertyRegistry::isKnownAttribute(attrName)) { >+ ASSERT(attrName == SVGNames::transformAttr); > InstanceInvalidationGuard guard(*this); >- >- if (auto renderer = this->renderer()) { >+ if (auto renderer = this->renderer()) > renderer->setNeedsTransformUpdate(); >- RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer); >- } >- >+ setNeedsParentAndResourceInvalidation(); > return; > } > >diff --git a/Source/WebCore/svg/SVGImageElement.cpp b/Source/WebCore/svg/SVGImageElement.cpp >index a467cea0b2d16d8981a40f3774143b7f3324fca8..b4c811ca852d74108734ec8c214e0240c1ceea84 100644 >--- a/Source/WebCore/svg/SVGImageElement.cpp >+++ b/Source/WebCore/svg/SVGImageElement.cpp >@@ -98,22 +98,22 @@ 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; >+ setNeedsParentAndResourceInvalidation(); > } > return; > } > > if (attrName == SVGNames::widthAttr || attrName == SVGNames::heightAttr) { > InstanceInvalidationGuard guard(*this); >- invalidateSVGPresentationalHintStyle(); >+ setPresentationalHintStyleIsDirty(); > return; > } > > if (attrName == SVGNames::preserveAspectRatioAttr) { > InstanceInvalidationGuard guard(*this); >- if (auto* renderer = this->renderer()) >- RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer); >+ setNeedsParentAndResourceInvalidation(); > return; > } > >diff --git a/Source/WebCore/svg/SVGLineElement.cpp b/Source/WebCore/svg/SVGLineElement.cpp >index efb9b8bcfd9cc95eaa493bfe1aad919ca79cb3c5..a0b4b51896f0baab6b9bf3759d0337bb004832bb 100644 >--- a/Source/WebCore/svg/SVGLineElement.cpp >+++ b/Source/WebCore/svg/SVGLineElement.cpp >@@ -72,12 +72,10 @@ void SVGLineElement::svgAttributeChanged(const QualifiedName& attrName) > { > if (PropertyRegistry::isKnownAttribute(attrName)) { > InstanceInvalidationGuard guard(*this); >- updateRelativeLengthsInformation(); >- >- if (auto* renderer = downcast<LegacyRenderSVGShape>(this->renderer())) { >+ if (auto* renderer = downcast<LegacyRenderSVGShape>(this->renderer())) > renderer->setNeedsShapeUpdate(); >- RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer); >- } >+ updateRelativeLengthsInformation(); >+ setNeedsParentAndResourceInvalidation(); > return; > } > >diff --git a/Source/WebCore/svg/SVGLinearGradientElement.cpp b/Source/WebCore/svg/SVGLinearGradientElement.cpp >index 848f6a22f8e2513667bb04cbbb99f809a268fc7f..7361bd7b660feae710532fa64e36dcf2ed6f4337 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(); >+ setNeedsParentAndResourceInvalidation(); > return; > } > >diff --git a/Source/WebCore/svg/SVGMarkerElement.cpp b/Source/WebCore/svg/SVGMarkerElement.cpp >index 0b43bb842e5e362aaef879fd6063aa576eae21ab..2b7941d8c60725d012c3badfecd101ac17cdd315 100644 >--- a/Source/WebCore/svg/SVGMarkerElement.cpp >+++ b/Source/WebCore/svg/SVGMarkerElement.cpp >@@ -98,14 +98,13 @@ void SVGMarkerElement::svgAttributeChanged(const QualifiedName& attrName) > InstanceInvalidationGuard guard(*this); > if (PropertyRegistry::isAnimatedLengthAttribute(attrName)) > updateRelativeLengthsInformation(); >- if (RenderObject* object = renderer()) >- object->setNeedsLayout(); >+ setNeedsParentAndResourceInvalidation(); > return; > } >- >+ > if (SVGFitToViewBox::isKnownAttribute(attrName)) { >- if (RenderObject* object = renderer()) >- object->setNeedsLayout(); >+ InstanceInvalidationGuard guard(*this); >+ setNeedsParentAndResourceInvalidation(); > return; > } > >@@ -119,8 +118,7 @@ void SVGMarkerElement::childrenChanged(const ChildChange& change) > if (change.source == ChildChange::Source::Parser) > return; > >- if (RenderObject* object = renderer()) >- object->setNeedsLayout(); >+ setNeedsParentAndResourceInvalidation(); > } > > String SVGMarkerElement::orient() const >diff --git a/Source/WebCore/svg/SVGMaskElement.cpp b/Source/WebCore/svg/SVGMaskElement.cpp >index 1bfb41d370fc3363cb00ab648484df9d5a03ecdd..23e4cb9f740d16afae2d9383a5cf261d17046715 100644 >--- a/Source/WebCore/svg/SVGMaskElement.cpp >+++ b/Source/WebCore/svg/SVGMaskElement.cpp >@@ -98,15 +98,12 @@ void SVGMaskElement::parseAttribute(const QualifiedName& name, const AtomString& > > void SVGMaskElement::svgAttributeChanged(const QualifiedName& attrName) > { >- if (PropertyRegistry::isAnimatedLengthAttribute(attrName)) { >- InstanceInvalidationGuard guard(*this); >- invalidateSVGPresentationalHintStyle(); >- return; >- } >- > if (PropertyRegistry::isKnownAttribute(attrName)) { >- if (auto* renderer = this->renderer()) >- renderer->setNeedsLayout(); >+ InstanceInvalidationGuard guard(*this); >+ if (PropertyRegistry::isAnimatedLengthAttribute(attrName)) >+ setPresentationalHintStyleIsDirty(); >+ else >+ setNeedsParentAndResourceInvalidation(); > return; > } > >@@ -120,8 +117,7 @@ void SVGMaskElement::childrenChanged(const ChildChange& change) > if (change.source == ChildChange::Source::Parser) > return; > >- if (RenderObject* object = renderer()) >- object->setNeedsLayout(); >+ setNeedsParentAndResourceInvalidation(); > } > > RenderPtr<RenderElement> SVGMaskElement::createElementRenderer(RenderStyle&& style, const RenderTreePosition&) >diff --git a/Source/WebCore/svg/SVGPathElement.cpp b/Source/WebCore/svg/SVGPathElement.cpp >index e15190ef83ce65c2a14c0ab21c9fcb52fbd3104d..223d720e7b08619e7937793c6c0a48fc55e99e6e 100644 >--- a/Source/WebCore/svg/SVGPathElement.cpp >+++ b/Source/WebCore/svg/SVGPathElement.cpp >@@ -65,15 +65,12 @@ void SVGPathElement::parseAttribute(const QualifiedName& name, const AtomString& > > void SVGPathElement::svgAttributeChanged(const QualifiedName& attrName) > { >- if (attrName == SVGNames::dAttr) { >+ if (PropertyRegistry::isKnownAttribute(attrName)) { > InstanceInvalidationGuard guard(*this); >- invalidateMPathDependencies(); >- >- if (auto* renderer = downcast<RenderSVGPath>(this->renderer())) { >+ if (auto* renderer = downcast<RenderSVGPath>(this->renderer())) > renderer->setNeedsShapeUpdate(); >- RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer); >- } >- >+ invalidateMPathDependencies(); >+ setNeedsParentAndResourceInvalidation(); > return; > } > >diff --git a/Source/WebCore/svg/SVGPatternElement.cpp b/Source/WebCore/svg/SVGPatternElement.cpp >index c4743406222b55da051cfaeaf3eac2c951eb6515..4310b77f542511dfa2936abc61897dc141a785aa 100644 >--- a/Source/WebCore/svg/SVGPatternElement.cpp >+++ b/Source/WebCore/svg/SVGPatternElement.cpp >@@ -110,15 +110,18 @@ void SVGPatternElement::parseAttribute(const QualifiedName& name, const AtomStri > > void SVGPatternElement::svgAttributeChanged(const QualifiedName& attrName) > { >- if (PropertyRegistry::isAnimatedLengthAttribute(attrName)) { >+ if (PropertyRegistry::isKnownAttribute(attrName)) { > InstanceInvalidationGuard guard(*this); >- invalidateSVGPresentationalHintStyle(); >+ if (PropertyRegistry::isAnimatedLengthAttribute(attrName)) >+ setPresentationalHintStyleIsDirty(); >+ else >+ setNeedsParentAndResourceInvalidation(); > return; > } > >- if (PropertyRegistry::isKnownAttribute(attrName) || SVGFitToViewBox::isKnownAttribute(attrName) || SVGURIReference::isKnownAttribute(attrName)) { >- if (RenderObject* object = renderer()) >- object->setNeedsLayout(); >+ if (SVGFitToViewBox::isKnownAttribute(attrName) || SVGURIReference::isKnownAttribute(attrName)) { >+ InstanceInvalidationGuard guard(*this); >+ setNeedsParentAndResourceInvalidation(); > return; > } > >@@ -132,8 +135,7 @@ void SVGPatternElement::childrenChanged(const ChildChange& change) > if (change.source == ChildChange::Source::Parser) > return; > >- if (RenderObject* object = renderer()) >- object->setNeedsLayout(); >+ setNeedsParentAndResourceInvalidation(); > } > > RenderPtr<RenderElement> SVGPatternElement::createElementRenderer(RenderStyle&& style, const RenderTreePosition&) >diff --git a/Source/WebCore/svg/SVGPolyElement.cpp b/Source/WebCore/svg/SVGPolyElement.cpp >index ea1fe092a1623713c93833a5d957adce1e639100..a6296625ed98ad906d39faf3a18960f89ea9586b 100644 >--- a/Source/WebCore/svg/SVGPolyElement.cpp >+++ b/Source/WebCore/svg/SVGPolyElement.cpp >@@ -55,12 +55,12 @@ void SVGPolyElement::parseAttribute(const QualifiedName& name, const AtomString& > > void SVGPolyElement::svgAttributeChanged(const QualifiedName& attrName) > { >- if (attrName == SVGNames::pointsAttr) { >- if (auto* renderer = downcast<RenderSVGPath>(this->renderer())) { >- InstanceInvalidationGuard guard(*this); >+ if (PropertyRegistry::isKnownAttribute(attrName)) { >+ ASSERT(attrName == SVGNames::pointsAttr); >+ InstanceInvalidationGuard guard(*this); >+ if (auto* renderer = downcast<RenderSVGPath>(this->renderer())) > renderer->setNeedsShapeUpdate(); >- RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer); >- } >+ setNeedsParentAndResourceInvalidation(); > return; > } > >diff --git a/Source/WebCore/svg/SVGRadialGradientElement.cpp b/Source/WebCore/svg/SVGRadialGradientElement.cpp >index e5e21afee9e3f56b1878cd3e2e9198404f4989ce..f33994a90aaa68920325641ae4879e46445cb675 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(); >+ setNeedsParentAndResourceInvalidation(); > return; > } > >diff --git a/Source/WebCore/svg/SVGRectElement.cpp b/Source/WebCore/svg/SVGRectElement.cpp >index fd40a8ecd8bb99fb4ca5baf55ec3c3257b8b819c..ad7aac899e9ada9482b89a00311b67fc72c60d50 100644 >--- a/Source/WebCore/svg/SVGRectElement.cpp >+++ b/Source/WebCore/svg/SVGRectElement.cpp >@@ -79,8 +79,9 @@ void SVGRectElement::parseAttribute(const QualifiedName& name, const AtomString& > void SVGRectElement::svgAttributeChanged(const QualifiedName& attrName) > { > if (PropertyRegistry::isKnownAttribute(attrName)) { >+ ASSERT(PropertyRegistry::isAnimatedLengthAttribute(attrName)); > InstanceInvalidationGuard guard(*this); >- invalidateSVGPresentationalHintStyle(); >+ setPresentationalHintStyleIsDirty(); > return; > } > >diff --git a/Source/WebCore/svg/SVGSVGElement.cpp b/Source/WebCore/svg/SVGSVGElement.cpp >index 945dbc0c93cdcff576adb51603e7c46c36664b7b..d2930aaeee470337c56318ec49d9f05e09032cc9 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(); >+ setNeedsParentAndResourceInvalidation(); > if (parentNode() == &document() && document().renderView()) > document().renderView()->repaint(); > } >@@ -209,7 +208,7 @@ void SVGSVGElement::svgAttributeChanged(const QualifiedName& attrName) > { > if (PropertyRegistry::isKnownAttribute(attrName)) { > InstanceInvalidationGuard guard(*this); >- invalidateSVGPresentationalHintStyle(); >+ setPresentationalHintStyleIsDirty(); > > if (auto* renderer = this->renderer()) > RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer); >@@ -217,11 +216,9 @@ void SVGSVGElement::svgAttributeChanged(const QualifiedName& attrName) > } > > if (SVGFitToViewBox::isKnownAttribute(attrName)) { >- if (auto* renderer = this->renderer()) { >+ if (auto* renderer = this->renderer()) > renderer->setNeedsTransformUpdate(); >- RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer); >- } >- return; >+ setNeedsParentAndResourceInvalidation(); > } > > SVGGraphicsElement::svgAttributeChanged(attrName); >@@ -583,7 +580,6 @@ SVGSVGElement* SVGSVGElement::findRootAnchor(StringView fragmentIdentifier) cons > > bool SVGSVGElement::scrollToFragment(StringView fragmentIdentifier) > { >- auto renderer = this->renderer(); > auto view = m_viewSpec; > if (view) > view->reset(); >@@ -593,8 +589,8 @@ bool SVGSVGElement::scrollToFragment(StringView fragmentIdentifier) > > if (fragmentIdentifier.startsWith("xpointer(")) { > // FIXME: XPointer references are ignored (https://bugs.webkit.org/show_bug.cgi?id=17491) >- if (renderer && hadUseCurrentView) >- RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer); >+ if (hadUseCurrentView) >+ setNeedsParentAndResourceInvalidation(); > return false; > } > >@@ -605,8 +601,8 @@ bool SVGSVGElement::scrollToFragment(StringView fragmentIdentifier) > m_useCurrentView = true; > else > view->reset(); >- if (renderer && (hadUseCurrentView || m_useCurrentView)) >- RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer); >+ if ((hadUseCurrentView || m_useCurrentView)) >+ setNeedsParentAndResourceInvalidation(); > return m_useCurrentView; > } > >@@ -630,8 +626,7 @@ bool SVGSVGElement::scrollToFragment(StringView fragmentIdentifier) > } > > rootElement->inheritViewAttributes(*viewElement); >- if (auto* renderer = rootElement->renderer()) >- RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer); >+ rootElement->setNeedsParentAndResourceInvalidation(); > m_currentViewFragmentIdentifier = fragmentIdentifier.toString(); > return true; > } >@@ -661,8 +656,7 @@ void SVGSVGElement::resetScrollAnchor() > } > > m_useCurrentView = false; >- if (renderer()) >- RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer()); >+ setNeedsParentAndResourceInvalidation(); > } > > void SVGSVGElement::inheritViewAttributes(const SVGViewElement& viewElement) >diff --git a/Source/WebCore/svg/SVGStopElement.cpp b/Source/WebCore/svg/SVGStopElement.cpp >index 195700ebf7ba741943c317c96f52eed57eb29a3c..7aa786b798eb71fa2a345bf0da28d21347226054 100644 >--- a/Source/WebCore/svg/SVGStopElement.cpp >+++ b/Source/WebCore/svg/SVGStopElement.cpp >@@ -64,11 +64,10 @@ void SVGStopElement::parseAttribute(const QualifiedName& name, const AtomString& > > void SVGStopElement::svgAttributeChanged(const QualifiedName& attrName) > { >- if (attrName == SVGNames::offsetAttr) { >- if (auto renderer = this->renderer()) { >- InstanceInvalidationGuard guard(*this); >- RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer); >- } >+ if (PropertyRegistry::isKnownAttribute(attrName)) { >+ ASSERT(attrName == SVGNames::offsetAttr); >+ InstanceInvalidationGuard guard(*this); >+ setNeedsParentAndResourceInvalidation(); > return; > } > >diff --git a/Source/WebCore/svg/SVGTRefElement.cpp b/Source/WebCore/svg/SVGTRefElement.cpp >index 2991db6934206ea927ebd87f37111781e52182de..f4512e927727da151360eabb5d285cb3a78a6fc7 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); >+ setNeedsParentAndResourceInvalidation(); > return; > } > >diff --git a/Source/WebCore/svg/SVGTextContentElement.cpp b/Source/WebCore/svg/SVGTextContentElement.cpp >index c1453bfc60408c950746077d761ee14d729651fb..dd14dac0dcfd3ee7b9bb5bbe5279bab3b66b0881 100644 >--- a/Source/WebCore/svg/SVGTextContentElement.cpp >+++ b/Source/WebCore/svg/SVGTextContentElement.cpp >@@ -180,13 +180,10 @@ void SVGTextContentElement::parseAttribute(const QualifiedName& name, const Atom > void SVGTextContentElement::svgAttributeChanged(const QualifiedName& attrName) > { > if (PropertyRegistry::isKnownAttribute(attrName)) { >+ InstanceInvalidationGuard guard(*this); > if (attrName == SVGNames::textLengthAttr) > m_specifiedTextLength = m_textLength->baseVal()->value(); >- >- if (auto renderer = this->renderer()) { >- InstanceInvalidationGuard guard(*this); >- RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer); >- } >+ setNeedsParentAndResourceInvalidation(); > return; > } > >diff --git a/Source/WebCore/svg/SVGTextPathElement.cpp b/Source/WebCore/svg/SVGTextPathElement.cpp >index a7491c4d1b85b97e347fd5a71411314c97846693..b8dd293519ecdd1dbe780f58781623f7567ea911 100644 >--- a/Source/WebCore/svg/SVGTextPathElement.cpp >+++ b/Source/WebCore/svg/SVGTextPathElement.cpp >@@ -89,19 +89,16 @@ void SVGTextPathElement::svgAttributeChanged(const QualifiedName& attrName) > { > if (PropertyRegistry::isKnownAttribute(attrName)) { > InstanceInvalidationGuard guard(*this); >- > if (attrName == SVGNames::startOffsetAttr) > updateRelativeLengthsInformation(); >- >- if (auto renderer = this->renderer()) >- RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer); >+ setNeedsParentAndResourceInvalidation(); > return; > } > > if (SVGURIReference::isKnownAttribute(attrName)) { >+ InstanceInvalidationGuard guard(*this); > buildPendingResource(); >- if (auto renderer = this->renderer()) >- RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer); >+ setNeedsParentAndResourceInvalidation(); > return; > } > >diff --git a/Source/WebCore/svg/SVGTextPositioningElement.cpp b/Source/WebCore/svg/SVGTextPositioningElement.cpp >index fe21e66af56652890ab318083dd8319cef1e6202..05e48468b8530d29cd8955a831e62a1ddad1c98d 100644 >--- a/Source/WebCore/svg/SVGTextPositioningElement.cpp >+++ b/Source/WebCore/svg/SVGTextPositioningElement.cpp >@@ -99,16 +99,13 @@ void SVGTextPositioningElement::svgAttributeChanged(const QualifiedName& attrNam > { > if (PropertyRegistry::isKnownAttribute(attrName)) { > InstanceInvalidationGuard guard(*this); >- > if (attrName != SVGNames::rotateAttr) > updateRelativeLengthsInformation(); > >- if (auto renderer = this->renderer()) { >- if (auto* textAncestor = RenderSVGText::locateRenderSVGTextAncestor(*renderer)) >- textAncestor->setNeedsPositioningValuesUpdate(); >- RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer); >- } >+ if (auto* textAncestor = renderer() ? RenderSVGText::locateRenderSVGTextAncestor(*renderer()) : nullptr) >+ textAncestor->setNeedsPositioningValuesUpdate(); > >+ setNeedsParentAndResourceInvalidation(); > return; > } > >diff --git a/Source/WebCore/svg/SVGUseElement.cpp b/Source/WebCore/svg/SVGUseElement.cpp >index 0547cca9d26fbd0f395953aaa49edba52220642d..88b07ce75ab27fcc3445dcc4b3ac3a343162e97a 100644 >--- a/Source/WebCore/svg/SVGUseElement.cpp >+++ b/Source/WebCore/svg/SVGUseElement.cpp >@@ -156,21 +156,21 @@ void SVGUseElement::transferSizeAttributesToTargetClone(SVGElement& shadowElemen > > void SVGUseElement::svgAttributeChanged(const QualifiedName& attrName) > { >- InstanceInvalidationGuard guard(*this); >- > if (PropertyRegistry::isKnownAttribute(attrName)) { >- updateRelativeLengthsInformation(); > if (attrName == SVGNames::widthAttr || attrName == SVGNames::heightAttr) { > // FIXME: It's unnecessarily inefficient to update both width and height each time either is changed. > if (auto targetClone = this->targetClone()) > transferSizeAttributesToTargetClone(*targetClone); > } >- if (auto* renderer = this->renderer()) >- RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer); >+ >+ InstanceInvalidationGuard guard(*this); >+ updateRelativeLengthsInformation(); >+ setNeedsParentAndResourceInvalidation(); > return; > } > > if (SVGURIReference::isKnownAttribute(attrName)) { >+ InstanceInvalidationGuard guard(*this); > updateExternalDocument(); > invalidateShadowTree(); > return; >diff --git a/Source/WebCore/svg/SVGViewElement.cpp b/Source/WebCore/svg/SVGViewElement.cpp >index ecfe431a4533c36c08b50323bc2144bcebe490e5..2acebcc868509f36a28042ea950ae4889c3e1372 100644 >--- a/Source/WebCore/svg/SVGViewElement.cpp >+++ b/Source/WebCore/svg/SVGViewElement.cpp >@@ -54,17 +54,13 @@ void SVGViewElement::parseAttribute(const QualifiedName& name, const AtomString& > > void SVGViewElement::svgAttributeChanged(const QualifiedName& attrName) > { >- // We ignore changes to SVGNames::viewTargetAttr, which is deprecated and unused in WebCore. >- if (PropertyRegistry::isKnownAttribute(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); > >+ InstanceInvalidationGuard guard(*m_targetElement); >+ m_targetElement->setNeedsParentAndResourceInvalidation(); > return; > } > >diff --git a/Source/WebCore/svg/properties/SVGAttributeAnimator.cpp b/Source/WebCore/svg/properties/SVGAttributeAnimator.cpp >index 5f23b30126f41fa42d1f68080ce8b944953aeeb3..a6de78ea4844353a5cb39db2b70ed855b9d63c1d 100644 >--- a/Source/WebCore/svg/properties/SVGAttributeAnimator.cpp >+++ b/Source/WebCore/svg/properties/SVGAttributeAnimator.cpp >@@ -40,7 +40,7 @@ bool SVGAttributeAnimator::isAnimatedStylePropertyAniamtor(const SVGElement& tar > void SVGAttributeAnimator::invalidateStyle(SVGElement& targetElement) > { > SVGElement::InstanceInvalidationGuard guard(targetElement); >- targetElement.invalidateSVGPresentationalHintStyle(); >+ targetElement.setPresentationalHintStyleIsDirty(); > } > > void SVGAttributeAnimator::applyAnimatedStylePropertyChange(SVGElement& element, CSSPropertyID id, const String& value)
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