Title: [258464] trunk/Source/WebCore
Revision
258464
Author
[email protected]
Date
2020-03-14 00:15:14 -0700 (Sat, 14 Mar 2020)

Log Message

Call SVGTRefElement::buildPendingResource in SVGElement::didFinishInsertingNode
https://bugs.webkit.org/show_bug.cgi?id=208981

Reviewed by Antti Koivisto.

This patch moves the call to SVGTRefElement::buildPendingResource from SVGElement::insertedIntoAncestor
to SVGElement::didFinishInsertingNode.

* svg/SVGElement.cpp:
(WebCore::SVGElement::insertedIntoAncestor): Return true when the element has a pending resource ID.
(WebCore::SVGElement::didFinishInsertingNode): Added. Calls buildPendingResourcesIfNeeded.
* svg/SVGElement.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (258463 => 258464)


--- trunk/Source/WebCore/ChangeLog	2020-03-14 07:03:58 UTC (rev 258463)
+++ trunk/Source/WebCore/ChangeLog	2020-03-14 07:15:14 UTC (rev 258464)
@@ -1,3 +1,18 @@
+2020-03-14  Ryosuke Niwa  <[email protected]>
+
+        Call SVGTRefElement::buildPendingResource in SVGElement::didFinishInsertingNode
+        https://bugs.webkit.org/show_bug.cgi?id=208981
+
+        Reviewed by Antti Koivisto.
+
+        This patch moves the call to SVGTRefElement::buildPendingResource from SVGElement::insertedIntoAncestor
+        to SVGElement::didFinishInsertingNode.
+
+        * svg/SVGElement.cpp:
+        (WebCore::SVGElement::insertedIntoAncestor): Return true when the element has a pending resource ID.
+        (WebCore::SVGElement::didFinishInsertingNode): Added. Calls buildPendingResourcesIfNeeded.
+        * svg/SVGElement.h:
+
 2020-03-13  Said Abou-Hallawa  <[email protected]>
 
         SVGMatrix should have the access right of its owner SVGTransform always

Modified: trunk/Source/WebCore/svg/SVGElement.cpp (258463 => 258464)


--- trunk/Source/WebCore/svg/SVGElement.cpp	2020-03-14 07:03:58 UTC (rev 258463)
+++ trunk/Source/WebCore/svg/SVGElement.cpp	2020-03-14 07:15:14 UTC (rev 258464)
@@ -833,10 +833,22 @@
 {
     StyledElement::insertedIntoAncestor(insertionType, parentOfInsertedTree);
     updateRelativeLengthsInformation();
-    buildPendingResourcesIfNeeded();
+
+    if (needsPendingResourceHandling() && insertionType.connectedToDocument && !isInShadowTree()) {
+        SVGDocumentExtensions& extensions = document().accessSVGExtensions();
+        String resourceId = getIdAttribute();
+        if (extensions.isIdOfPendingResource(resourceId))
+            return InsertedIntoAncestorResult::NeedsPostInsertionCallback;
+    }
+
     return InsertedIntoAncestorResult::Done;
 }
 
+void SVGElement::didFinishInsertingNode()
+{
+    buildPendingResourcesIfNeeded();
+}
+
 void SVGElement::buildPendingResourcesIfNeeded()
 {
     if (!needsPendingResourceHandling() || !isConnected() || isInShadowTree())

Modified: trunk/Source/WebCore/svg/SVGElement.h (258463 => 258464)


--- trunk/Source/WebCore/svg/SVGElement.h	2020-03-14 07:03:58 UTC (rev 258463)
+++ trunk/Source/WebCore/svg/SVGElement.h	2020-03-14 07:15:14 UTC (rev 258464)
@@ -166,6 +166,7 @@
     bool isPresentationAttribute(const QualifiedName&) const override;
     void collectStyleForPresentationAttribute(const QualifiedName&, const AtomString&, MutableStyleProperties&) override;
     InsertedIntoAncestorResult insertedIntoAncestor(InsertionType, ContainerNode&) override;
+    void didFinishInsertingNode() override;
     void removedFromAncestor(RemovalType, ContainerNode&) override;
     void childrenChanged(const ChildChange&) override;
     virtual bool selfHasRelativeLengths() const { return false; }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to