Title: [294067] trunk
Revision
294067
Author
[email protected]
Date
2022-05-11 13:35:02 -0700 (Wed, 11 May 2022)

Log Message

REGRESSION (r291788): MotionMark Suits subtest is 9% regressed
https://bugs.webkit.org/show_bug.cgi?id=240112
rdar://92409900

Reviewed by Alan Bujtas.

Source/WebCore:

Add mechanism to safely update SVG renderer from element without triggering an unnecessary style resolution.

* dom/Document.cpp:
(WebCore::Document::removedLastRef):
(WebCore::Document::resolveStyle):
(WebCore::Document::updateTextRenderer):
(WebCore::Document::updateSVGRenderer):

Use the same mechanism as text updates to schedule SVG rendering updates.

(WebCore::Document::ensurePendingRenderTreeUpdate):
(WebCore::Document::needsStyleRecalc const):
(WebCore::Document::destroyRenderTree):

Ensure any remaining style update get deleted along with the render tree.

* dom/Document.h:
* dom/ElementData.h:
(WebCore::ElementData::svgResourcesInAncestorChainAreDirty const): Deleted.
(WebCore::ElementData::setSVGResourcesInAncestorChainAreDirty const): Deleted.

Not needed anymore, Style::Update remembers what needs updating.

* rendering/updating/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::updateRenderTree):
(WebCore::RenderTreeUpdater::updateElementRenderer):

Schedule an update. Currently this really just schedules a layout which pulls in the changes from the element.

* style/StyleUpdate.cpp:
(WebCore::Style::Update::addElement):
(WebCore::Style::Update::addSVGRendererUpdate):

Add a bit to ElementUpdate to indicate that SVG update is needed.

* style/StyleUpdate.h:
* svg/SVGAnimateMotionElement.cpp:
(WebCore::SVGAnimateMotionElement::applyResultsToTarget):
* svg/SVGClipPathElement.cpp:
(WebCore::SVGClipPathElement::svgAttributeChanged):
(WebCore::SVGClipPathElement::childrenChanged):
* svg/SVGElement.cpp:
(WebCore::SVGElement::updateSVGRendererForElementChange):
(WebCore::SVGElement::setSVGResourcesInAncestorChainAreDirty): Deleted.
(WebCore::SVGElement::invalidateSVGResourcesInAncestorChainIfNeeded): Deleted.

Replace setSVGResourcesInAncestorChainAreDirty with the new mechanism. Don't invalidate style.

* svg/SVGElement.h:
* 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/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):
* 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):

LayoutTests:

* svg/animations/animation-leak-list-property-instances.html:

Do a rendering update before checking for leaks.

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (294066 => 294067)


--- trunk/LayoutTests/ChangeLog	2022-05-11 20:25:33 UTC (rev 294066)
+++ trunk/LayoutTests/ChangeLog	2022-05-11 20:35:02 UTC (rev 294067)
@@ -1,3 +1,15 @@
+2022-05-11  Antti Koivisto  <[email protected]>
+
+        REGRESSION (r291788): MotionMark Suits subtest is 9% regressed
+        https://bugs.webkit.org/show_bug.cgi?id=240112
+        rdar://92409900
+
+        Reviewed by Alan Bujtas.
+
+        * svg/animations/animation-leak-list-property-instances.html:
+
+        Do a rendering update before checking for leaks.
+
 2022-05-11  Ben Nham  <[email protected]>
 
         Rebaseline WK1 notifications test expectations after r293921

Modified: trunk/LayoutTests/platform/win/TestExpectations (294066 => 294067)


--- trunk/LayoutTests/platform/win/TestExpectations	2022-05-11 20:25:33 UTC (rev 294066)
+++ trunk/LayoutTests/platform/win/TestExpectations	2022-05-11 20:35:02 UTC (rev 294067)
@@ -3845,6 +3845,8 @@
 http/tests/security/contentSecurityPolicy/block-favicon.html [ Failure Pass ]
 http/tests/websocket/tests/hybi/workers/close-code-and-reason.html [ Crash Pass ]
 svg/animations/animations-paused-in-background-page.html [ Timeout Pass ]
+svg/animations/animations-paused-when-inserted-in-hidden-document.html [ Skip ]
+svg/animations/animations-paused-when-inserted-in-hidden-document2.html [ Skip ]
 
 # FIXME: create bugs to track the following failures:
 accessibility/add-children-pseudo-element.html [ Failure ]

Modified: trunk/LayoutTests/svg/animations/animation-leak-list-property-instances.html (294066 => 294067)


--- trunk/LayoutTests/svg/animations/animation-leak-list-property-instances.html	2022-05-11 20:25:33 UTC (rev 294066)
+++ trunk/LayoutTests/svg/animations/animation-leak-list-property-instances.html	2022-05-11 20:35:02 UTC (rev 294067)
@@ -37,6 +37,7 @@
          return;
      }
 
+     jsTestIsAsync = true;
      testRunner.dumpAsText();
 
      // One gc() call is not enough and causes flakiness in some platforms.
@@ -48,12 +49,15 @@
      applyTransform();
      removeRect();
 
-     // One gc() call is not enough and causes flakiness in some platforms.
-     gc();
-     gc();
-     var delta = internals.numberOfLiveNodes() - originalLiveElements;
-     shouldBeZero(delta.toString());
-     var successfullyParsed = true;
+     requestAnimationFrame(() => {
+         // One gc() call is not enough and causes flakiness in some platforms.
+         gc();
+         gc();
+         var delta = internals.numberOfLiveNodes() - originalLiveElements;
+         shouldBeZero(delta.toString());
+         var successfullyParsed = true;
+         testRunner.notifyDone();
+     });
  }
 </script>
 <body _onload_="test()">

Modified: trunk/Source/WebCore/ChangeLog (294066 => 294067)


--- trunk/Source/WebCore/ChangeLog	2022-05-11 20:25:33 UTC (rev 294066)
+++ trunk/Source/WebCore/ChangeLog	2022-05-11 20:35:02 UTC (rev 294067)
@@ -1,3 +1,147 @@
+2022-05-11  Antti Koivisto  <[email protected]>
+
+        REGRESSION (r291788): MotionMark Suits subtest is 9% regressed
+        https://bugs.webkit.org/show_bug.cgi?id=240112
+        rdar://92409900
+
+        Reviewed by Alan Bujtas.
+
+        Add mechanism to safely update SVG renderer from element without triggering an unnecessary style resolution.
+
+        * dom/Document.cpp:
+        (WebCore::Document::removedLastRef):
+        (WebCore::Document::resolveStyle):
+        (WebCore::Document::updateTextRenderer):
+        (WebCore::Document::updateSVGRenderer):
+
+        Use the same mechanism as text updates to schedule SVG rendering updates.
+
+        (WebCore::Document::ensurePendingRenderTreeUpdate):
+        (WebCore::Document::needsStyleRecalc const):
+        (WebCore::Document::destroyRenderTree):
+
+        Ensure any remaining style update get deleted along with the render tree.
+
+        * dom/Document.h:
+        * dom/ElementData.h:
+        (WebCore::ElementData::svgResourcesInAncestorChainAreDirty const): Deleted.
+        (WebCore::ElementData::setSVGResourcesInAncestorChainAreDirty const): Deleted.
+
+        Not needed anymore, Style::Update remembers what needs updating.
+
+        * rendering/updating/RenderTreeUpdater.cpp:
+        (WebCore::RenderTreeUpdater::updateRenderTree):
+        (WebCore::RenderTreeUpdater::updateElementRenderer):
+
+        Schedule an update. Currently this really just schedules a layout which pulls in the changes from the element.
+
+        * style/StyleUpdate.cpp:
+        (WebCore::Style::Update::addElement):
+        (WebCore::Style::Update::addSVGRendererUpdate):
+
+        Add a bit to ElementUpdate to indicate that SVG update is needed.
+
+        * style/StyleUpdate.h:
+        * svg/SVGAnimateMotionElement.cpp:
+        (WebCore::SVGAnimateMotionElement::applyResultsToTarget):
+        * svg/SVGClipPathElement.cpp:
+        (WebCore::SVGClipPathElement::svgAttributeChanged):
+        (WebCore::SVGClipPathElement::childrenChanged):
+        * svg/SVGElement.cpp:
+        (WebCore::SVGElement::updateSVGRendererForElementChange):
+        (WebCore::SVGElement::setSVGResourcesInAncestorChainAreDirty): Deleted.
+        (WebCore::SVGElement::invalidateSVGResourcesInAncestorChainIfNeeded): Deleted.
+
+        Replace setSVGResourcesInAncestorChainAreDirty with the new mechanism. Don't invalidate style.
+
+        * svg/SVGElement.h:
+        * 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/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):
+        * 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-05-10  Wenson Hsieh  <[email protected]>
 
         [Webpage Translation] Avoid removing elements with no children during text manipulation

Modified: trunk/Source/WebCore/dom/Document.cpp (294066 => 294067)


--- trunk/Source/WebCore/dom/Document.cpp	2022-05-11 20:25:33 UTC (rev 294066)
+++ trunk/Source/WebCore/dom/Document.cpp	2022-05-11 20:35:02 UTC (rev 294067)
@@ -769,7 +769,7 @@
         m_fullscreenManager->clear();
 #endif
         m_associatedFormControls.clear();
-        m_pendingRenderTreeTextUpdate = { };
+        m_pendingRenderTreeUpdate = { };
 
         m_fontLoader->stopLoadingAndClearFonts();
 
@@ -2092,7 +2092,7 @@
                 documentElement->invalidateStyleForSubtree();
         }
 
-        Style::TreeResolver resolver(*this, WTFMove(m_pendingRenderTreeTextUpdate));
+        Style::TreeResolver resolver(*this, WTFMove(m_pendingRenderTreeUpdate));
         auto styleUpdate = resolver.resolve();
 
         while (resolver.hasUnresolvedQueryContainers() && styleUpdate) {
@@ -2154,12 +2154,27 @@
     if (!hasLivingRenderTree())
         return;
 
-    if (!m_pendingRenderTreeTextUpdate)
-        m_pendingRenderTreeTextUpdate = makeUnique<Style::Update>(*this);
+    ensurePendingRenderTreeUpdate().addText(text, { offsetOfReplacedText, lengthOfReplacedText, std::nullopt });
+}
 
-    m_pendingRenderTreeTextUpdate->addText(text, { offsetOfReplacedText, lengthOfReplacedText, std::nullopt });
+void Document::updateSVGRenderer(SVGElement& element)
+{
+    if (!hasLivingRenderTree())
+        return;
 
+    ensurePendingRenderTreeUpdate().addSVGRendererUpdate(element);
+}
+
+Style::Update& Document::ensurePendingRenderTreeUpdate()
+{
+    ASSERT(hasLivingRenderTree());
+
+    if (!m_pendingRenderTreeUpdate)
+        m_pendingRenderTreeUpdate = makeUnique<Style::Update>(*this);
+
     scheduleRenderingUpdate({ });
+
+    return *m_pendingRenderTreeUpdate;
 }
 
 bool Document::needsStyleRecalc() const
@@ -2173,7 +2188,7 @@
     if (childNeedsStyleRecalc())
         return true;
 
-    if (m_pendingRenderTreeTextUpdate)
+    if (m_pendingRenderTreeUpdate)
         return true;
 
     if (styleScope().hasPendingUpdate())
@@ -2594,6 +2609,8 @@
     if (view())
         view()->willDestroyRenderTree();
 
+    m_pendingRenderTreeUpdate = { };
+
     if (m_documentElement)
         RenderTreeUpdater::tearDownRenderers(*m_documentElement);
 

Modified: trunk/Source/WebCore/dom/Document.h (294066 => 294067)


--- trunk/Source/WebCore/dom/Document.h	2022-05-11 20:25:33 UTC (rev 294066)
+++ trunk/Source/WebCore/dom/Document.h	2022-05-11 20:35:02 UTC (rev 294067)
@@ -205,6 +205,7 @@
 class RequestAnimationFrameCallback;
 class ResizeObserver;
 class SVGDocumentExtensions;
+class SVGElement;
 class SVGSVGElement;
 class SVGUseElement;
 class SWClientConnection;
@@ -1356,6 +1357,7 @@
     void setIsResolvingTreeStyle(bool);
 
     void updateTextRenderer(Text&, unsigned offsetOfReplacedText, unsigned lengthOfReplacedText);
+    void updateSVGRenderer(SVGElement&);
 
     // Return a Locale for the default locale if the argument is null or empty.
     Locale& getCachedLocale(const AtomString& locale = nullAtom());
@@ -1806,6 +1808,8 @@
     void addToDocumentsMap();
     void removeFromDocumentsMap();
 
+    Style::Update& ensurePendingRenderTreeUpdate();
+
     NotificationClient* notificationClient() final;
 
     const Ref<const Settings> m_settings;
@@ -1888,7 +1892,7 @@
     
     Timer m_styleRecalcTimer;
 
-    std::unique_ptr<Style::Update> m_pendingRenderTreeTextUpdate;
+    std::unique_ptr<Style::Update> m_pendingRenderTreeUpdate;
 
     Element* m_cssTarget { nullptr };
 

Modified: trunk/Source/WebCore/dom/ElementData.h (294066 => 294067)


--- trunk/Source/WebCore/dom/ElementData.h	2022-05-11 20:25:33 UTC (rev 294066)
+++ trunk/Source/WebCore/dom/ElementData.h	2022-05-11 20:35:02 UTC (rev 294067)
@@ -125,13 +125,12 @@
     mutable uint32_t m_arraySizeAndFlags;
 
     static const uint32_t s_arraySize = 27;
-    static const uint32_t s_flagCount = 6;
+    static const uint32_t s_flagCount = 5;
     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?
 
@@ -162,9 +161,6 @@
     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;

Modified: trunk/Source/WebCore/rendering/updating/RenderTreeUpdater.cpp (294066 => 294067)


--- trunk/Source/WebCore/rendering/updating/RenderTreeUpdater.cpp	2022-05-11 20:25:33 UTC (rev 294066)
+++ trunk/Source/WebCore/rendering/updating/RenderTreeUpdater.cpp	2022-05-11 20:35:02 UTC (rev 294067)
@@ -42,6 +42,7 @@
 #include "RenderInline.h"
 #include "RenderMultiColumnFlow.h"
 #include "RenderMultiColumnSet.h"
+#include "RenderSVGResource.h"
 #include "RenderTreeUpdaterGeneratedContent.h"
 #include "RenderView.h"
 #include "RuntimeEnabledFeatures.h"
@@ -185,9 +186,6 @@
         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()));
@@ -298,6 +296,12 @@
 
 void RenderTreeUpdater::updateElementRenderer(Element& element, const Style::ElementUpdate& elementUpdate)
 {
+    if (elementUpdate.updateSVGRenderer && element.renderer())
+        RenderSVGResource::markForLayoutAndParentResourceInvalidation(*element.renderer());
+
+    if (!elementUpdate.style)
+        return;
+
 #if ENABLE(CONTENT_CHANGE_OBSERVER)
     ContentChangeObserver::StyleChangeScope observingScope(m_document, element);
 #endif

Modified: trunk/Source/WebCore/style/StyleUpdate.cpp (294066 => 294067)


--- trunk/Source/WebCore/style/StyleUpdate.cpp	2022-05-11 20:25:33 UTC (rev 294066)
+++ trunk/Source/WebCore/style/StyleUpdate.cpp	2022-05-11 20:35:02 UTC (rev 294067)
@@ -31,6 +31,7 @@
 #include "Element.h"
 #include "NodeRenderStyle.h"
 #include "RenderElement.h"
+#include "SVGElement.h"
 #include "Text.h"
 
 namespace WebCore {
@@ -87,13 +88,19 @@
 
 void Update::addElement(Element& element, Element* parent, ElementUpdate&& elementUpdate)
 {
-    ASSERT(!m_elements.contains(&element));
     ASSERT(composedTreeAncestors(element).first() == parent);
 
     m_roots.remove(&element);
     addPossibleRoot(parent);
 
-    m_elements.add(&element, WTFMove(elementUpdate));
+    auto result = m_elements.add(&element, WTFMove(elementUpdate));
+
+    if (!result.isNewEntry) {
+        auto& entry = result.iterator->value;
+        ASSERT(entry.updateSVGRenderer);
+        entry = WTFMove(elementUpdate);
+        entry.updateSVGRenderer = true;
+    }
 }
 
 void Update::addText(Text& text, Element* parent, TextUpdate&& textUpdate)
@@ -122,6 +129,13 @@
     addText(text, composedTreeAncestors(text).first(), WTFMove(textUpdate));
 }
 
+void Update::addSVGRendererUpdate(SVGElement& element)
+{
+    auto elementUpdate = ElementUpdate { };
+    elementUpdate.updateSVGRenderer = true;
+    addElement(element, composedTreeAncestors(element).first(), WTFMove(elementUpdate));
+}
+
 void Update::addPossibleRoot(Element* element)
 {
     if (!element) {

Modified: trunk/Source/WebCore/style/StyleUpdate.h (294066 => 294067)


--- trunk/Source/WebCore/style/StyleUpdate.h	2022-05-11 20:25:33 UTC (rev 294066)
+++ trunk/Source/WebCore/style/StyleUpdate.h	2022-05-11 20:35:02 UTC (rev 294067)
@@ -37,6 +37,7 @@
 class Element;
 class Node;
 class RenderStyle;
+class SVGElement;
 class Text;
 
 namespace Style {
@@ -45,6 +46,7 @@
     std::unique_ptr<RenderStyle> style;
     Change change { Change::None };
     bool recompositeLayer { false };
+    bool updateSVGRenderer { false };
 };
 
 struct TextUpdate {
@@ -76,6 +78,7 @@
     void addElement(Element&, Element* parent, ElementUpdate&&);
     void addText(Text&, Element* parent, TextUpdate&&);
     void addText(Text&, TextUpdate&&);
+    void addSVGRendererUpdate(SVGElement&);
 
 private:
     void addPossibleRoot(Element*);

Modified: trunk/Source/WebCore/svg/SVGAnimateMotionElement.cpp (294066 => 294067)


--- trunk/Source/WebCore/svg/SVGAnimateMotionElement.cpp	2022-05-11 20:25:33 UTC (rev 294066)
+++ trunk/Source/WebCore/svg/SVGAnimateMotionElement.cpp	2022-05-11 20:35:02 UTC (rev 294067)
@@ -253,7 +253,7 @@
     auto updateTargetElement = [](SVGElement& element) {
         if (auto renderer = element.renderer())
             renderer->setNeedsTransformUpdate();
-        element.setSVGResourcesInAncestorChainAreDirty();
+        element.updateSVGRendererForElementChange();
     };
 
     updateTargetElement(*targetElement);

Modified: trunk/Source/WebCore/svg/SVGClipPathElement.cpp (294066 => 294067)


--- trunk/Source/WebCore/svg/SVGClipPathElement.cpp	2022-05-11 20:25:33 UTC (rev 294066)
+++ trunk/Source/WebCore/svg/SVGClipPathElement.cpp	2022-05-11 20:35:02 UTC (rev 294067)
@@ -67,7 +67,7 @@
     if (PropertyRegistry::isKnownAttribute(attrName)) {
         InstanceInvalidationGuard guard(*this);
 
-        setSVGResourcesInAncestorChainAreDirty();
+        updateSVGRendererForElementChange();
         return;
     }
 
@@ -81,7 +81,7 @@
     if (change.source == ChildChange::Source::Parser)
         return;
 
-    setSVGResourcesInAncestorChainAreDirty();
+    updateSVGRendererForElementChange();
 }
 
 RenderPtr<RenderElement> SVGClipPathElement::createElementRenderer(RenderStyle&& style, const RenderTreePosition&)

Modified: trunk/Source/WebCore/svg/SVGElement.cpp (294066 => 294067)


--- trunk/Source/WebCore/svg/SVGElement.cpp	2022-05-11 20:25:33 UTC (rev 294066)
+++ trunk/Source/WebCore/svg/SVGElement.cpp	2022-05-11 20:35:02 UTC (rev 294067)
@@ -883,22 +883,11 @@
         addPropertyToPresentationalHintStyle(style, propertyID, value);
 }
 
-void SVGElement::setSVGResourcesInAncestorChainAreDirty()
+void SVGElement::updateSVGRendererForElementChange()
 {
-    ensureUniqueElementData().setSVGResourcesInAncestorChainAreDirty(true);
-    invalidateStyle();
+    document().updateSVGRenderer(*this);
 }
 
-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);

Modified: trunk/Source/WebCore/svg/SVGElement.h (294066 => 294067)


--- trunk/Source/WebCore/svg/SVGElement.h	2022-05-11 20:25:33 UTC (rev 294066)
+++ trunk/Source/WebCore/svg/SVGElement.h	2022-05-11 20:35:02 UTC (rev 294067)
@@ -84,8 +84,7 @@
 
     inline void setAnimatedSVGAttributesAreDirty();
     inline void setPresentationalHintStyleIsDirty();
-    void setSVGResourcesInAncestorChainAreDirty();
-    void invalidateSVGResourcesInAncestorChainIfNeeded();
+    void updateSVGRendererForElementChange();
 
     // The instances of an element are clones made in shadow trees to implement <use>.
     const WeakHashSet<SVGElement>& instances() const;

Modified: trunk/Source/WebCore/svg/SVGFEBlendElement.cpp (294066 => 294067)


--- trunk/Source/WebCore/svg/SVGFEBlendElement.cpp	2022-05-11 20:25:33 UTC (rev 294066)
+++ trunk/Source/WebCore/svg/SVGFEBlendElement.cpp	2022-05-11 20:35:02 UTC (rev 294067)
@@ -89,7 +89,7 @@
             primitiveAttributeChanged(attrName);
         else {
             ASSERT(attrName == SVGNames::inAttr || attrName == SVGNames::in2Attr);
-            setSVGResourcesInAncestorChainAreDirty();
+            updateSVGRendererForElementChange();
         }
         return;
     }

Modified: trunk/Source/WebCore/svg/SVGFEColorMatrixElement.cpp (294066 => 294067)


--- trunk/Source/WebCore/svg/SVGFEColorMatrixElement.cpp	2022-05-11 20:25:33 UTC (rev 294066)
+++ trunk/Source/WebCore/svg/SVGFEColorMatrixElement.cpp	2022-05-11 20:35:02 UTC (rev 294067)
@@ -87,7 +87,7 @@
     if (PropertyRegistry::isKnownAttribute(attrName)) {
         InstanceInvalidationGuard guard(*this);
         if (attrName == SVGNames::inAttr)
-            setSVGResourcesInAncestorChainAreDirty();
+            updateSVGRendererForElementChange();
         else {
             ASSERT(attrName == SVGNames::typeAttr || attrName == SVGNames::valuesAttr);
             primitiveAttributeChanged(attrName);

Modified: trunk/Source/WebCore/svg/SVGFECompositeElement.cpp (294066 => 294067)


--- trunk/Source/WebCore/svg/SVGFECompositeElement.cpp	2022-05-11 20:25:33 UTC (rev 294066)
+++ trunk/Source/WebCore/svg/SVGFECompositeElement.cpp	2022-05-11 20:35:02 UTC (rev 294067)
@@ -118,7 +118,7 @@
     if (PropertyRegistry::isKnownAttribute(attrName)) {
         InstanceInvalidationGuard guard(*this);
         if (attrName == SVGNames::inAttr || attrName == SVGNames::in2Attr)
-            setSVGResourcesInAncestorChainAreDirty();
+            updateSVGRendererForElementChange();
         else {
             ASSERT(attrName == SVGNames::k1Attr || attrName == SVGNames::k2Attr || attrName == SVGNames::k3Attr || attrName == SVGNames::k4Attr || attrName == SVGNames::operatorAttr);
             primitiveAttributeChanged(attrName);

Modified: trunk/Source/WebCore/svg/SVGFEConvolveMatrixElement.cpp (294066 => 294067)


--- trunk/Source/WebCore/svg/SVGFEConvolveMatrixElement.cpp	2022-05-11 20:25:33 UTC (rev 294066)
+++ trunk/Source/WebCore/svg/SVGFEConvolveMatrixElement.cpp	2022-05-11 20:35:02 UTC (rev 294067)
@@ -161,7 +161,7 @@
 {
     m_orderX->setBaseValInternal(x);
     m_orderY->setBaseValInternal(y);
-    setSVGResourcesInAncestorChainAreDirty();
+    updateSVGRendererForElementChange();
 }
 
 void SVGFEConvolveMatrixElement::setKernelUnitLength(float x, float y)
@@ -168,7 +168,7 @@
 {
     m_kernelUnitLengthX->setBaseValInternal(x);
     m_kernelUnitLengthY->setBaseValInternal(y);
-    setSVGResourcesInAncestorChainAreDirty();
+    updateSVGRendererForElementChange();
 }
 
 void SVGFEConvolveMatrixElement::svgAttributeChanged(const QualifiedName& attrName)
@@ -176,7 +176,7 @@
     if (PropertyRegistry::isKnownAttribute(attrName)) {
         InstanceInvalidationGuard guard(*this);
         if (attrName == SVGNames::inAttr || attrName == SVGNames::orderAttr || attrName == SVGNames::kernelMatrixAttr)
-            setSVGResourcesInAncestorChainAreDirty();
+            updateSVGRendererForElementChange();
         else {
             ASSERT(attrName == SVGNames::edgeModeAttr || attrName == SVGNames::divisorAttr || attrName == SVGNames::biasAttr || attrName == SVGNames::targetXAttr
                 || attrName == SVGNames::targetYAttr || attrName == SVGNames::kernelUnitLengthAttr || attrName == SVGNames::preserveAlphaAttr);

Modified: trunk/Source/WebCore/svg/SVGFEDiffuseLightingElement.cpp (294066 => 294067)


--- trunk/Source/WebCore/svg/SVGFEDiffuseLightingElement.cpp	2022-05-11 20:25:33 UTC (rev 294066)
+++ trunk/Source/WebCore/svg/SVGFEDiffuseLightingElement.cpp	2022-05-11 20:35:02 UTC (rev 294067)
@@ -128,7 +128,7 @@
     if (PropertyRegistry::isKnownAttribute(attrName)) {
         InstanceInvalidationGuard guard(*this);
         if (attrName == SVGNames::inAttr)
-            setSVGResourcesInAncestorChainAreDirty();
+            updateSVGRendererForElementChange();
         else {
             ASSERT(attrName == SVGNames::diffuseConstantAttr || attrName == SVGNames::surfaceScaleAttr || attrName == SVGNames::kernelUnitLengthAttr);
             primitiveAttributeChanged(attrName);

Modified: trunk/Source/WebCore/svg/SVGFEDisplacementMapElement.cpp (294066 => 294067)


--- trunk/Source/WebCore/svg/SVGFEDisplacementMapElement.cpp	2022-05-11 20:25:33 UTC (rev 294066)
+++ trunk/Source/WebCore/svg/SVGFEDisplacementMapElement.cpp	2022-05-11 20:35:02 UTC (rev 294067)
@@ -102,7 +102,7 @@
     if (PropertyRegistry::isKnownAttribute(attrName)) {
         InstanceInvalidationGuard guard(*this);
         if (attrName == SVGNames::inAttr || attrName == SVGNames::in2Attr)
-            setSVGResourcesInAncestorChainAreDirty();
+            updateSVGRendererForElementChange();
         else {
             ASSERT(attrName == SVGNames::xChannelSelectorAttr || attrName == SVGNames::yChannelSelectorAttr || attrName == SVGNames::scaleAttr);
             primitiveAttributeChanged(attrName);

Modified: trunk/Source/WebCore/svg/SVGFEDropShadowElement.cpp (294066 => 294067)


--- trunk/Source/WebCore/svg/SVGFEDropShadowElement.cpp	2022-05-11 20:25:33 UTC (rev 294066)
+++ trunk/Source/WebCore/svg/SVGFEDropShadowElement.cpp	2022-05-11 20:35:02 UTC (rev 294067)
@@ -54,7 +54,7 @@
 {
     m_stdDeviationX->setBaseValInternal(x);
     m_stdDeviationY->setBaseValInternal(y);
-    setSVGResourcesInAncestorChainAreDirty();
+    updateSVGRendererForElementChange();
 }
 
 void SVGFEDropShadowElement::parseAttribute(const QualifiedName& name, const AtomString& value)
@@ -89,7 +89,7 @@
 {
     if (PropertyRegistry::isKnownAttribute(attrName)) {
         InstanceInvalidationGuard guard(*this);
-        setSVGResourcesInAncestorChainAreDirty();
+        updateSVGRendererForElementChange();
         return;
     }
 

Modified: trunk/Source/WebCore/svg/SVGFEGaussianBlurElement.cpp (294066 => 294067)


--- trunk/Source/WebCore/svg/SVGFEGaussianBlurElement.cpp	2022-05-11 20:25:33 UTC (rev 294066)
+++ trunk/Source/WebCore/svg/SVGFEGaussianBlurElement.cpp	2022-05-11 20:35:02 UTC (rev 294067)
@@ -53,7 +53,7 @@
 {
     m_stdDeviationX->setBaseValInternal(x);
     m_stdDeviationY->setBaseValInternal(y);
-    setSVGResourcesInAncestorChainAreDirty();
+    updateSVGRendererForElementChange();
 }
 
 void SVGFEGaussianBlurElement::parseAttribute(const QualifiedName& name, const AtomString& value)
@@ -87,7 +87,7 @@
 {
     if (PropertyRegistry::isKnownAttribute(attrName)) {
         InstanceInvalidationGuard guard(*this);
-        setSVGResourcesInAncestorChainAreDirty();
+        updateSVGRendererForElementChange();
         return;
     }
 

Modified: trunk/Source/WebCore/svg/SVGFEImageElement.cpp (294066 => 294067)


--- trunk/Source/WebCore/svg/SVGFEImageElement.cpp	2022-05-11 20:25:33 UTC (rev 294066)
+++ trunk/Source/WebCore/svg/SVGFEImageElement.cpp	2022-05-11 20:35:02 UTC (rev 294067)
@@ -111,7 +111,7 @@
     } else if (is<SVGElement>(*target.element))
         downcast<SVGElement>(*target.element).addReferencingElement(*this);
 
-    setSVGResourcesInAncestorChainAreDirty();
+    updateSVGRendererForElementChange();
 }
 
 void SVGFEImageElement::parseAttribute(const QualifiedName& name, const AtomString& value)
@@ -130,7 +130,7 @@
     if (PropertyRegistry::isKnownAttribute(attrName)) {
         ASSERT(attrName == SVGNames::preserveAspectRatioAttr);
         InstanceInvalidationGuard guard(*this);
-        setSVGResourcesInAncestorChainAreDirty();
+        updateSVGRendererForElementChange();
         return;
     }
 

Modified: trunk/Source/WebCore/svg/SVGFEMorphologyElement.cpp (294066 => 294067)


--- trunk/Source/WebCore/svg/SVGFEMorphologyElement.cpp	2022-05-11 20:25:33 UTC (rev 294066)
+++ trunk/Source/WebCore/svg/SVGFEMorphologyElement.cpp	2022-05-11 20:35:02 UTC (rev 294067)
@@ -52,7 +52,7 @@
 {
     m_radiusX->setBaseValInternal(x);
     m_radiusY->setBaseValInternal(y);
-    setSVGResourcesInAncestorChainAreDirty();
+    updateSVGRendererForElementChange();
 }
 
 void SVGFEMorphologyElement::parseAttribute(const QualifiedName& name, const AtomString& value)
@@ -101,7 +101,7 @@
     if (PropertyRegistry::isKnownAttribute(attrName)) {
         InstanceInvalidationGuard guard(*this);
         if (attrName == SVGNames::inAttr)
-            setSVGResourcesInAncestorChainAreDirty();
+            updateSVGRendererForElementChange();
         else {
             ASSERT(attrName == SVGNames::operatorAttr || attrName == SVGNames::radiusAttr);
             primitiveAttributeChanged(attrName);

Modified: trunk/Source/WebCore/svg/SVGFEOffsetElement.cpp (294066 => 294067)


--- trunk/Source/WebCore/svg/SVGFEOffsetElement.cpp	2022-05-11 20:25:33 UTC (rev 294066)
+++ trunk/Source/WebCore/svg/SVGFEOffsetElement.cpp	2022-05-11 20:35:02 UTC (rev 294067)
@@ -72,7 +72,7 @@
 {
     if (PropertyRegistry::isKnownAttribute(attrName)) {
         InstanceInvalidationGuard guard(*this);
-        setSVGResourcesInAncestorChainAreDirty();
+        updateSVGRendererForElementChange();
         return;
     }
 

Modified: trunk/Source/WebCore/svg/SVGFESpecularLightingElement.cpp (294066 => 294067)


--- trunk/Source/WebCore/svg/SVGFESpecularLightingElement.cpp	2022-05-11 20:25:33 UTC (rev 294066)
+++ trunk/Source/WebCore/svg/SVGFESpecularLightingElement.cpp	2022-05-11 20:35:02 UTC (rev 294067)
@@ -138,7 +138,7 @@
     if (PropertyRegistry::isKnownAttribute(attrName)) {
         InstanceInvalidationGuard guard(*this);
         if (attrName == SVGNames::inAttr)
-            setSVGResourcesInAncestorChainAreDirty();
+            updateSVGRendererForElementChange();
         else {
             ASSERT(attrName == SVGNames::specularConstantAttr || attrName == SVGNames::specularExponentAttr || attrName == SVGNames::surfaceScaleAttr || attrName == SVGNames::kernelUnitLengthAttr);
             primitiveAttributeChanged(attrName);

Modified: trunk/Source/WebCore/svg/SVGFETileElement.cpp (294066 => 294067)


--- trunk/Source/WebCore/svg/SVGFETileElement.cpp	2022-05-11 20:25:33 UTC (rev 294066)
+++ trunk/Source/WebCore/svg/SVGFETileElement.cpp	2022-05-11 20:35:02 UTC (rev 294067)
@@ -61,7 +61,7 @@
     if (PropertyRegistry::isKnownAttribute(attrName)) {
         ASSERT(attrName == SVGNames::inAttr);
         InstanceInvalidationGuard guard(*this);
-        setSVGResourcesInAncestorChainAreDirty();
+        updateSVGRendererForElementChange();
         return;
     }
 

Modified: trunk/Source/WebCore/svg/SVGFilterElement.cpp (294066 => 294067)


--- trunk/Source/WebCore/svg/SVGFilterElement.cpp	2022-05-11 20:25:33 UTC (rev 294066)
+++ trunk/Source/WebCore/svg/SVGFilterElement.cpp	2022-05-11 20:35:02 UTC (rev 294067)
@@ -98,7 +98,7 @@
     }
 
     if (PropertyRegistry::isKnownAttribute(attrName) || SVGURIReference::isKnownAttribute(attrName)) {
-        setSVGResourcesInAncestorChainAreDirty();
+        updateSVGRendererForElementChange();
         return;
     }
 
@@ -112,7 +112,7 @@
     if (change.source == ChildChange::Source::Parser)
         return;
 
-    setSVGResourcesInAncestorChainAreDirty();
+    updateSVGRendererForElementChange();
 }
 
 RenderPtr<RenderElement> SVGFilterElement::createElementRenderer(RenderStyle&& style, const RenderTreePosition&)

Modified: trunk/Source/WebCore/svg/SVGFilterPrimitiveStandardAttributes.cpp (294066 => 294067)


--- trunk/Source/WebCore/svg/SVGFilterPrimitiveStandardAttributes.cpp	2022-05-11 20:25:33 UTC (rev 294066)
+++ trunk/Source/WebCore/svg/SVGFilterPrimitiveStandardAttributes.cpp	2022-05-11 20:35:02 UTC (rev 294067)
@@ -77,7 +77,7 @@
 {
     if (PropertyRegistry::isKnownAttribute(attrName)) {
         InstanceInvalidationGuard guard(*this);
-        setSVGResourcesInAncestorChainAreDirty();
+        updateSVGRendererForElementChange();
         return;
     }
 
@@ -90,7 +90,7 @@
 
     if (change.source == ChildChange::Source::Parser)
         return;
-    setSVGResourcesInAncestorChainAreDirty();
+    updateSVGRendererForElementChange();
 }
 
 RenderPtr<RenderElement> SVGFilterPrimitiveStandardAttributes::createElementRenderer(RenderStyle&& style, const RenderTreePosition&)
@@ -119,7 +119,7 @@
     if (!renderer || !renderer->isSVGResourceFilterPrimitive())
         return;
 
-    downcast<SVGElement>(*parent).setSVGResourcesInAncestorChainAreDirty();
+    downcast<SVGElement>(*parent).updateSVGRendererForElementChange();
 }
 
 }

Modified: trunk/Source/WebCore/svg/SVGForeignObjectElement.cpp (294066 => 294067)


--- trunk/Source/WebCore/svg/SVGForeignObjectElement.cpp	2022-05-11 20:25:33 UTC (rev 294066)
+++ trunk/Source/WebCore/svg/SVGForeignObjectElement.cpp	2022-05-11 20:35:02 UTC (rev 294067)
@@ -81,7 +81,7 @@
         else {
             ASSERT(attrName == SVGNames::xAttr || attrName == SVGNames::yAttr);
             updateRelativeLengthsInformation();
-            setSVGResourcesInAncestorChainAreDirty();
+            updateSVGRendererForElementChange();
         }
         return;
     }

Modified: trunk/Source/WebCore/svg/SVGGeometryElement.cpp (294066 => 294067)


--- trunk/Source/WebCore/svg/SVGGeometryElement.cpp	2022-05-11 20:25:33 UTC (rev 294066)
+++ trunk/Source/WebCore/svg/SVGGeometryElement.cpp	2022-05-11 20:35:02 UTC (rev 294067)
@@ -150,7 +150,7 @@
     if (PropertyRegistry::isKnownAttribute(attrName)) {
         ASSERT(attrName == SVGNames::pathLengthAttr);
         InstanceInvalidationGuard guard(*this);
-        setSVGResourcesInAncestorChainAreDirty();
+        updateSVGRendererForElementChange();
         return;
     }
 

Modified: trunk/Source/WebCore/svg/SVGGradientElement.cpp (294066 => 294067)


--- trunk/Source/WebCore/svg/SVGGradientElement.cpp	2022-05-11 20:25:33 UTC (rev 294066)
+++ trunk/Source/WebCore/svg/SVGGradientElement.cpp	2022-05-11 20:35:02 UTC (rev 294067)
@@ -79,7 +79,7 @@
 {
     if (PropertyRegistry::isKnownAttribute(attrName) || SVGURIReference::isKnownAttribute(attrName)) {
         InstanceInvalidationGuard guard(*this);
-        setSVGResourcesInAncestorChainAreDirty();
+        updateSVGRendererForElementChange();
         return;
     }
 
@@ -93,7 +93,7 @@
     if (change.source == ChildChange::Source::Parser)
         return;
 
-    setSVGResourcesInAncestorChainAreDirty();
+    updateSVGRendererForElementChange();
 }
 
 GradientColorStops SVGGradientElement::buildStops()

Modified: trunk/Source/WebCore/svg/SVGGraphicsElement.cpp (294066 => 294067)


--- trunk/Source/WebCore/svg/SVGGraphicsElement.cpp	2022-05-11 20:25:33 UTC (rev 294066)
+++ trunk/Source/WebCore/svg/SVGGraphicsElement.cpp	2022-05-11 20:35:02 UTC (rev 294067)
@@ -145,7 +145,7 @@
 
         if (auto renderer = this->renderer())
             renderer->setNeedsTransformUpdate();
-        setSVGResourcesInAncestorChainAreDirty();
+        updateSVGRendererForElementChange();
 
         return;
     }

Modified: trunk/Source/WebCore/svg/SVGImageElement.cpp (294066 => 294067)


--- trunk/Source/WebCore/svg/SVGImageElement.cpp	2022-05-11 20:25:33 UTC (rev 294066)
+++ trunk/Source/WebCore/svg/SVGImageElement.cpp	2022-05-11 20:35:02 UTC (rev 294067)
@@ -101,13 +101,13 @@
             if (auto* renderer = this->renderer()) {
                 if (!downcast<RenderSVGImage>(*renderer).updateImageViewport())
                     return;
-                setSVGResourcesInAncestorChainAreDirty();
+                updateSVGRendererForElementChange();
             }
         } else if (attrName == SVGNames::widthAttr || attrName == SVGNames::heightAttr)
             setPresentationalHintStyleIsDirty();
         else {
             ASSERT(attrName == SVGNames::preserveAspectRatioAttr);
-            setSVGResourcesInAncestorChainAreDirty();
+            updateSVGRendererForElementChange();
         }
         return;
     }

Modified: trunk/Source/WebCore/svg/SVGLineElement.cpp (294066 => 294067)


--- trunk/Source/WebCore/svg/SVGLineElement.cpp	2022-05-11 20:25:33 UTC (rev 294066)
+++ trunk/Source/WebCore/svg/SVGLineElement.cpp	2022-05-11 20:35:02 UTC (rev 294067)
@@ -76,7 +76,7 @@
 
         if (auto* renderer = this->renderer())
             static_cast<LegacyRenderSVGShape*>(renderer)->setNeedsShapeUpdate();
-        setSVGResourcesInAncestorChainAreDirty();
+        updateSVGRendererForElementChange();
         return;
     }
 

Modified: trunk/Source/WebCore/svg/SVGLinearGradientElement.cpp (294066 => 294067)


--- trunk/Source/WebCore/svg/SVGLinearGradientElement.cpp	2022-05-11 20:25:33 UTC (rev 294066)
+++ trunk/Source/WebCore/svg/SVGLinearGradientElement.cpp	2022-05-11 20:35:02 UTC (rev 294067)
@@ -83,7 +83,7 @@
     if (PropertyRegistry::isKnownAttribute(attrName)) {
         InstanceInvalidationGuard guard(*this);
         updateRelativeLengthsInformation();
-        setSVGResourcesInAncestorChainAreDirty();
+        updateSVGRendererForElementChange();
         return;
     }
 

Modified: trunk/Source/WebCore/svg/SVGMarkerElement.cpp (294066 => 294067)


--- trunk/Source/WebCore/svg/SVGMarkerElement.cpp	2022-05-11 20:25:33 UTC (rev 294066)
+++ trunk/Source/WebCore/svg/SVGMarkerElement.cpp	2022-05-11 20:35:02 UTC (rev 294067)
@@ -98,12 +98,12 @@
         InstanceInvalidationGuard guard(*this);
         if (PropertyRegistry::isAnimatedLengthAttribute(attrName))
             updateRelativeLengthsInformation();
-        setSVGResourcesInAncestorChainAreDirty();
+        updateSVGRendererForElementChange();
         return;
     }
     
     if (SVGFitToViewBox::isKnownAttribute(attrName)) {
-        setSVGResourcesInAncestorChainAreDirty();
+        updateSVGRendererForElementChange();
         return;
     }
 
@@ -117,7 +117,7 @@
     if (change.source == ChildChange::Source::Parser)
         return;
 
-    setSVGResourcesInAncestorChainAreDirty();
+    updateSVGRendererForElementChange();
 }
 
 AtomString SVGMarkerElement::orient() const

Modified: trunk/Source/WebCore/svg/SVGMaskElement.cpp (294066 => 294067)


--- trunk/Source/WebCore/svg/SVGMaskElement.cpp	2022-05-11 20:25:33 UTC (rev 294066)
+++ trunk/Source/WebCore/svg/SVGMaskElement.cpp	2022-05-11 20:35:02 UTC (rev 294067)
@@ -105,7 +105,7 @@
     }
 
     if (PropertyRegistry::isKnownAttribute(attrName)) {
-        setSVGResourcesInAncestorChainAreDirty();
+        updateSVGRendererForElementChange();
         return;
     }
 
@@ -119,7 +119,7 @@
     if (change.source == ChildChange::Source::Parser)
         return;
 
-    setSVGResourcesInAncestorChainAreDirty();
+    updateSVGRendererForElementChange();
 }
 
 RenderPtr<RenderElement> SVGMaskElement::createElementRenderer(RenderStyle&& style, const RenderTreePosition&)

Modified: trunk/Source/WebCore/svg/SVGPathElement.cpp (294066 => 294067)


--- trunk/Source/WebCore/svg/SVGPathElement.cpp	2022-05-11 20:25:33 UTC (rev 294066)
+++ trunk/Source/WebCore/svg/SVGPathElement.cpp	2022-05-11 20:35:02 UTC (rev 294067)
@@ -72,7 +72,7 @@
 
         if (auto* renderer = this->renderer())
             static_cast<RenderSVGPath*>(renderer)->setNeedsShapeUpdate();
-        setSVGResourcesInAncestorChainAreDirty();
+        updateSVGRendererForElementChange();
 
         return;
     }

Modified: trunk/Source/WebCore/svg/SVGPatternElement.cpp (294066 => 294067)


--- trunk/Source/WebCore/svg/SVGPatternElement.cpp	2022-05-11 20:25:33 UTC (rev 294066)
+++ trunk/Source/WebCore/svg/SVGPatternElement.cpp	2022-05-11 20:35:02 UTC (rev 294067)
@@ -117,7 +117,7 @@
     }
 
     if (PropertyRegistry::isKnownAttribute(attrName) || SVGFitToViewBox::isKnownAttribute(attrName) || SVGURIReference::isKnownAttribute(attrName)) {
-        setSVGResourcesInAncestorChainAreDirty();
+        updateSVGRendererForElementChange();
         return;
     }
 
@@ -131,7 +131,7 @@
     if (change.source == ChildChange::Source::Parser)
         return;
 
-    setSVGResourcesInAncestorChainAreDirty();
+    updateSVGRendererForElementChange();
 }
 
 RenderPtr<RenderElement> SVGPatternElement::createElementRenderer(RenderStyle&& style, const RenderTreePosition&)

Modified: trunk/Source/WebCore/svg/SVGPolyElement.cpp (294066 => 294067)


--- trunk/Source/WebCore/svg/SVGPolyElement.cpp	2022-05-11 20:25:33 UTC (rev 294066)
+++ trunk/Source/WebCore/svg/SVGPolyElement.cpp	2022-05-11 20:35:02 UTC (rev 294067)
@@ -60,7 +60,7 @@
         InstanceInvalidationGuard guard(*this);
         if (auto* renderer = this->renderer())
             static_cast<RenderSVGPath*>(renderer)->setNeedsShapeUpdate();
-        setSVGResourcesInAncestorChainAreDirty();
+        updateSVGRendererForElementChange();
         return;
     }
 

Modified: trunk/Source/WebCore/svg/SVGRadialGradientElement.cpp (294066 => 294067)


--- trunk/Source/WebCore/svg/SVGRadialGradientElement.cpp	2022-05-11 20:25:33 UTC (rev 294066)
+++ trunk/Source/WebCore/svg/SVGRadialGradientElement.cpp	2022-05-11 20:35:02 UTC (rev 294067)
@@ -89,7 +89,7 @@
     if (PropertyRegistry::isKnownAttribute(attrName)) {
         InstanceInvalidationGuard guard(*this);
         updateRelativeLengthsInformation();
-        setSVGResourcesInAncestorChainAreDirty();
+        updateSVGRendererForElementChange();
         return;
     }
 

Modified: trunk/Source/WebCore/svg/SVGSVGElement.cpp (294066 => 294067)


--- trunk/Source/WebCore/svg/SVGSVGElement.cpp	2022-05-11 20:25:33 UTC (rev 294066)
+++ trunk/Source/WebCore/svg/SVGSVGElement.cpp	2022-05-11 20:35:02 UTC (rev 294067)
@@ -137,7 +137,7 @@
 
 void SVGSVGElement::updateCurrentTranslate()
 {
-    setSVGResourcesInAncestorChainAreDirty();
+    updateSVGRendererForElementChange();
     if (parentNode() == &document() && document().renderView())
         document().renderView()->repaint();
 }
@@ -224,7 +224,7 @@
                     renderer->view().setNeedsLayout(MarkOnlyThis);
             }
         }
-        setSVGResourcesInAncestorChainAreDirty();
+        updateSVGRendererForElementChange();
         return;
     }
 
@@ -231,7 +231,7 @@
     if (SVGFitToViewBox::isKnownAttribute(attrName)) {
         if (auto* renderer = this->renderer())
             renderer->setNeedsTransformUpdate();
-        setSVGResourcesInAncestorChainAreDirty();
+        updateSVGRendererForElementChange();
         return;
     }
 

Modified: trunk/Source/WebCore/svg/SVGStopElement.cpp (294066 => 294067)


--- trunk/Source/WebCore/svg/SVGStopElement.cpp	2022-05-11 20:25:33 UTC (rev 294066)
+++ trunk/Source/WebCore/svg/SVGStopElement.cpp	2022-05-11 20:35:02 UTC (rev 294067)
@@ -67,7 +67,7 @@
     if (PropertyRegistry::isKnownAttribute(attrName)) {
         ASSERT(attrName == SVGNames::offsetAttr);
         InstanceInvalidationGuard guard(*this);
-        setSVGResourcesInAncestorChainAreDirty();
+        updateSVGRendererForElementChange();
         return;
     }
 

Modified: trunk/Source/WebCore/svg/SVGTRefElement.cpp (294066 => 294067)


--- trunk/Source/WebCore/svg/SVGTRefElement.cpp	2022-05-11 20:25:33 UTC (rev 294066)
+++ trunk/Source/WebCore/svg/SVGTRefElement.cpp	2022-05-11 20:35:02 UTC (rev 294067)
@@ -183,7 +183,7 @@
     if (SVGURIReference::isKnownAttribute(attrName)) {
         InstanceInvalidationGuard guard(*this);
         buildPendingResource();
-        setSVGResourcesInAncestorChainAreDirty();
+        updateSVGRendererForElementChange();
         return;
     }
 

Modified: trunk/Source/WebCore/svg/SVGTextContentElement.cpp (294066 => 294067)


--- trunk/Source/WebCore/svg/SVGTextContentElement.cpp	2022-05-11 20:25:33 UTC (rev 294066)
+++ trunk/Source/WebCore/svg/SVGTextContentElement.cpp	2022-05-11 20:35:02 UTC (rev 294067)
@@ -184,7 +184,7 @@
             m_specifiedTextLength = m_textLength->baseVal()->value();
 
         InstanceInvalidationGuard guard(*this);
-        setSVGResourcesInAncestorChainAreDirty();
+        updateSVGRendererForElementChange();
         return;
     }
 

Modified: trunk/Source/WebCore/svg/SVGTextPathElement.cpp (294066 => 294067)


--- trunk/Source/WebCore/svg/SVGTextPathElement.cpp	2022-05-11 20:25:33 UTC (rev 294066)
+++ trunk/Source/WebCore/svg/SVGTextPathElement.cpp	2022-05-11 20:35:02 UTC (rev 294067)
@@ -93,13 +93,13 @@
         if (attrName == SVGNames::startOffsetAttr)
             updateRelativeLengthsInformation();
 
-        setSVGResourcesInAncestorChainAreDirty();
+        updateSVGRendererForElementChange();
         return;
     }
 
     if (SVGURIReference::isKnownAttribute(attrName)) {
         buildPendingResource();
-        setSVGResourcesInAncestorChainAreDirty();
+        updateSVGRendererForElementChange();
         return;
     }
 

Modified: trunk/Source/WebCore/svg/SVGTextPositioningElement.cpp (294066 => 294067)


--- trunk/Source/WebCore/svg/SVGTextPositioningElement.cpp	2022-05-11 20:25:33 UTC (rev 294066)
+++ trunk/Source/WebCore/svg/SVGTextPositioningElement.cpp	2022-05-11 20:35:02 UTC (rev 294067)
@@ -107,7 +107,7 @@
             if (auto* textAncestor = RenderSVGText::locateRenderSVGTextAncestor(*renderer))
                 textAncestor->setNeedsPositioningValuesUpdate();
         }
-        setSVGResourcesInAncestorChainAreDirty();
+        updateSVGRendererForElementChange();
         return;
     }
 

Modified: trunk/Source/WebCore/svg/SVGUseElement.cpp (294066 => 294067)


--- trunk/Source/WebCore/svg/SVGUseElement.cpp	2022-05-11 20:25:33 UTC (rev 294066)
+++ trunk/Source/WebCore/svg/SVGUseElement.cpp	2022-05-11 20:35:02 UTC (rev 294067)
@@ -165,7 +165,7 @@
             if (auto targetClone = this->targetClone())
                 transferSizeAttributesToTargetClone(*targetClone);
         }
-        setSVGResourcesInAncestorChainAreDirty();
+        updateSVGRendererForElementChange();
         return;
     }
 

Modified: trunk/Source/WebCore/svg/SVGViewElement.cpp (294066 => 294067)


--- trunk/Source/WebCore/svg/SVGViewElement.cpp	2022-05-11 20:25:33 UTC (rev 294066)
+++ trunk/Source/WebCore/svg/SVGViewElement.cpp	2022-05-11 20:35:02 UTC (rev 294067)
@@ -62,7 +62,7 @@
         if (!m_targetElement)
             return;
         m_targetElement->inheritViewAttributes(*this);
-        m_targetElement->setSVGResourcesInAncestorChainAreDirty();
+        m_targetElement->updateSVGRendererForElementChange();
         return;
     }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to