Title: [169228] branches/safari-537.77-branch
Revision
169228
Author
[email protected]
Date
2014-05-22 16:50:34 -0700 (Thu, 22 May 2014)

Log Message

Merged r168915.  <rdar://problem/16975506>

Modified Paths

Added Paths

Diff

Modified: branches/safari-537.77-branch/LayoutTests/ChangeLog (169227 => 169228)


--- branches/safari-537.77-branch/LayoutTests/ChangeLog	2014-05-22 23:43:01 UTC (rev 169227)
+++ branches/safari-537.77-branch/LayoutTests/ChangeLog	2014-05-22 23:50:34 UTC (rev 169228)
@@ -1,5 +1,33 @@
 2014-05-22  Lucas Forschler  <[email protected]>
 
+        Merge r168915
+
+    2014-05-15  Daniel Bates  <[email protected]>
+
+            SVG element may reference arbitrary DOM element before running its insertion logic
+            https://bugs.webkit.org/show_bug.cgi?id=132757
+            <rdar://problem/15703817>
+
+            Reviewed by Ryosuke Niwa.
+
+            Add tests to ensure that we don't cause an assertion failure when re-parenting an SVG subtree that
+            contains an element with a duplicate id.
+
+            * svg/custom/reparent-animate-element-expected.txt: Added.
+            * svg/custom/reparent-animate-element.html: Added.
+            * svg/custom/reparent-feimage-element-expected.txt: Added.
+            * svg/custom/reparent-feimage-element.html: Added.
+            * svg/custom/reparent-mpath-element-expected.txt: Added.
+            * svg/custom/reparent-mpath-element.html: Added.
+            * svg/custom/reparent-textpath-element-expected.txt: Added.
+            * svg/custom/reparent-textpath-element.html: Added.
+            * svg/custom/reparent-tref-element-expected.txt: Added.
+            * svg/custom/reparent-tref-element.html: Added.
+            * svg/custom/reparent-use-element-expected.txt: Added.
+            * svg/custom/reparent-use-element.html: Added.
+
+2014-05-22  Lucas Forschler  <[email protected]>
+
         Merge r168636
 
     2014-05-12  Martin Hock  <[email protected]>

Copied: branches/safari-537.77-branch/LayoutTests/svg/custom/reparent-animate-element-expected.txt (from rev 168915, trunk/LayoutTests/svg/custom/reparent-animate-element-expected.txt) (0 => 169228)


--- branches/safari-537.77-branch/LayoutTests/svg/custom/reparent-animate-element-expected.txt	                        (rev 0)
+++ branches/safari-537.77-branch/LayoutTests/svg/custom/reparent-animate-element-expected.txt	2014-05-22 23:50:34 UTC (rev 169228)
@@ -0,0 +1,4 @@
+This tests that we don't cause an assertion failure when re-parenting a <animate> after temporarily removing its referenced element.
+
+ 
+PASS

Copied: branches/safari-537.77-branch/LayoutTests/svg/custom/reparent-animate-element.html (from rev 168915, trunk/LayoutTests/svg/custom/reparent-animate-element.html) (0 => 169228)


--- branches/safari-537.77-branch/LayoutTests/svg/custom/reparent-animate-element.html	                        (rev 0)
+++ branches/safari-537.77-branch/LayoutTests/svg/custom/reparent-animate-element.html	2014-05-22 23:50:34 UTC (rev 169228)
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<html>
+<body>
+<head>
+<script>
+if (window.testRunner)
+    testRunner.dumpAsText();
+</script>
+<style>
+svg {
+    height: 0;
+    width: 0;
+}
+</style>
+</head>
+<p>This tests that we don't cause an assertion failure when re-parenting a &lt;animate&gt; after temporarily removing its referenced element.</p>
+<svg>
+    <circle id="a"></circle>
+    <animate xlink:href="" id="b"></animate>
+</svg>
+<svg id="c"></svg> <!-- This must be a <svg> element. -->
+<div id="a"></div>
+<script>
+var a = document.getElementById("a"); // <circle>
+var b = document.getElementById("b"); // <animate>
+a.parentNode.removeChild(a);
+b.appendChild(a);
+b.parentNode.removeChild(b);
+document.getElementById("c").appendChild(b);
+</script>
+<p>PASS</p>
+</body>
+</html>

Copied: branches/safari-537.77-branch/LayoutTests/svg/custom/reparent-feimage-element-expected.txt (from rev 168915, trunk/LayoutTests/svg/custom/reparent-feimage-element-expected.txt) (0 => 169228)


--- branches/safari-537.77-branch/LayoutTests/svg/custom/reparent-feimage-element-expected.txt	                        (rev 0)
+++ branches/safari-537.77-branch/LayoutTests/svg/custom/reparent-feimage-element-expected.txt	2014-05-22 23:50:34 UTC (rev 169228)
@@ -0,0 +1,4 @@
+This tests that we don't cause an assertion failure when re-parenting a <feimage> after temporarily removing its referenced element.
+
+ 
+PASS

Copied: branches/safari-537.77-branch/LayoutTests/svg/custom/reparent-feimage-element.html (from rev 168915, trunk/LayoutTests/svg/custom/reparent-feimage-element.html) (0 => 169228)


--- branches/safari-537.77-branch/LayoutTests/svg/custom/reparent-feimage-element.html	                        (rev 0)
+++ branches/safari-537.77-branch/LayoutTests/svg/custom/reparent-feimage-element.html	2014-05-22 23:50:34 UTC (rev 169228)
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<html>
+<body>
+<head>
+<script>
+if (window.testRunner)
+    testRunner.dumpAsText();
+</script>
+<style>
+svg {
+    height: 0;
+    width: 0;
+}
+</style>
+</head>
+<p>This tests that we don't cause an assertion failure when re-parenting a &lt;feimage&gt; after temporarily removing its referenced element.</p>
+<svg>
+    <circle id="a"></circle>
+    <feimage xlink:href="" id="b"></feimage>
+</svg>
+<svg id="c"></svg>
+<div id="a"></div>
+<script>
+var a = document.getElementById("a"); // <circle>
+var b = document.getElementById("b"); // <feimage>
+a.parentNode.removeChild(a);
+b.appendChild(a);
+b.parentNode.removeChild(b);
+document.getElementById("c").appendChild(b);
+</script>
+<p>PASS</p>
+</body>
+</html>

Copied: branches/safari-537.77-branch/LayoutTests/svg/custom/reparent-mpath-element-expected.txt (from rev 168915, trunk/LayoutTests/svg/custom/reparent-mpath-element-expected.txt) (0 => 169228)


--- branches/safari-537.77-branch/LayoutTests/svg/custom/reparent-mpath-element-expected.txt	                        (rev 0)
+++ branches/safari-537.77-branch/LayoutTests/svg/custom/reparent-mpath-element-expected.txt	2014-05-22 23:50:34 UTC (rev 169228)
@@ -0,0 +1,3 @@
+This tests that we don't cause an assertion failure when re-parenting a <mpath> after temporarily removing its referenced element.
+
+PASS

Copied: branches/safari-537.77-branch/LayoutTests/svg/custom/reparent-mpath-element.html (from rev 168915, trunk/LayoutTests/svg/custom/reparent-mpath-element.html) (0 => 169228)


--- branches/safari-537.77-branch/LayoutTests/svg/custom/reparent-mpath-element.html	                        (rev 0)
+++ branches/safari-537.77-branch/LayoutTests/svg/custom/reparent-mpath-element.html	2014-05-22 23:50:34 UTC (rev 169228)
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<html>
+<body>
+<head>
+<script>
+if (window.testRunner)
+    testRunner.dumpAsText();
+</script>
+<style>
+svg {
+    height: 0;
+    width: 0;
+}
+</style>
+</head>
+<p>This tests that we don't cause an assertion failure when re-parenting a &lt;mpath&gt; after temporarily removing its referenced element.</p>
+<svg>
+    <circle id="a"></circle>
+    <mpath xlink:href="" id="b"></mpath>
+</svg>
+<div id="c"></div>
+<div id="a"></div>
+<script>
+var a = document.getElementById("a"); // <circle>
+var b = document.getElementById("b"); // <mpath>
+a.parentNode.removeChild(a);
+b.appendChild(a);
+b.parentNode.removeChild(b);
+document.getElementById("c").appendChild(b);
+</script>
+<p>PASS</p>
+</body>
+</html>

Copied: branches/safari-537.77-branch/LayoutTests/svg/custom/reparent-textpath-element-expected.txt (from rev 168915, trunk/LayoutTests/svg/custom/reparent-textpath-element-expected.txt) (0 => 169228)


--- branches/safari-537.77-branch/LayoutTests/svg/custom/reparent-textpath-element-expected.txt	                        (rev 0)
+++ branches/safari-537.77-branch/LayoutTests/svg/custom/reparent-textpath-element-expected.txt	2014-05-22 23:50:34 UTC (rev 169228)
@@ -0,0 +1,3 @@
+This tests that we don't cause an assertion failure when re-parenting a <textPath> after temporarily removing its referenced element.
+
+PASS

Copied: branches/safari-537.77-branch/LayoutTests/svg/custom/reparent-textpath-element.html (from rev 168915, trunk/LayoutTests/svg/custom/reparent-textpath-element.html) (0 => 169228)


--- branches/safari-537.77-branch/LayoutTests/svg/custom/reparent-textpath-element.html	                        (rev 0)
+++ branches/safari-537.77-branch/LayoutTests/svg/custom/reparent-textpath-element.html	2014-05-22 23:50:34 UTC (rev 169228)
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<html>
+<body>
+<head>
+<script>
+if (window.testRunner)
+    testRunner.dumpAsText();
+</script>
+<style>
+svg {
+    height: 0;
+    width: 0;
+}
+</style>
+</head>
+<p>This tests that we don't cause an assertion failure when re-parenting a &lt;textPath&gt; after temporarily removing its referenced element.</p>
+<svg>
+    <circle id="a"></circle>
+    <text>
+        <textPath xlink:href="" id="b"></textPath>
+    </text>
+</svg>
+<div id="c"></div>
+<div id="a"></div>
+<script>
+var a = document.getElementById("a"); // <circle>
+var b = document.getElementById("b"); // <textPath>
+a.parentNode.removeChild(a);
+b.appendChild(a);
+b.parentNode.removeChild(b);
+document.getElementById("c").appendChild(b);
+</script>
+<p>PASS</p>
+</body>
+</html>

Copied: branches/safari-537.77-branch/LayoutTests/svg/custom/reparent-tref-element-expected.txt (from rev 168915, trunk/LayoutTests/svg/custom/reparent-tref-element-expected.txt) (0 => 169228)


--- branches/safari-537.77-branch/LayoutTests/svg/custom/reparent-tref-element-expected.txt	                        (rev 0)
+++ branches/safari-537.77-branch/LayoutTests/svg/custom/reparent-tref-element-expected.txt	2014-05-22 23:50:34 UTC (rev 169228)
@@ -0,0 +1,3 @@
+This tests that we don't cause an assertion failure when re-parenting a <tref> after temporarily removing its referenced element.
+
+PASS

Copied: branches/safari-537.77-branch/LayoutTests/svg/custom/reparent-tref-element.html (from rev 168915, trunk/LayoutTests/svg/custom/reparent-tref-element.html) (0 => 169228)


--- branches/safari-537.77-branch/LayoutTests/svg/custom/reparent-tref-element.html	                        (rev 0)
+++ branches/safari-537.77-branch/LayoutTests/svg/custom/reparent-tref-element.html	2014-05-22 23:50:34 UTC (rev 169228)
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<html>
+<body>
+<head>
+<script>
+if (window.testRunner)
+    testRunner.dumpAsText();
+</script>
+<style>
+svg {
+    height: 0;
+    width: 0;
+}
+</style>
+</head>
+<p>This tests that we don't cause an assertion failure when re-parenting a &lt;tref&gt; after temporarily removing its referenced element.</p>
+<svg>
+    <circle id="a"></circle>
+    <text>
+        <tref xlink:href="" id="b"></tref>
+    </text>
+</svg>
+<div id="c"></div>
+<div id="a"></div>
+<script>
+var a = document.getElementById("a"); // <circle>
+var b = document.getElementById("b"); // <tref>
+a.parentNode.removeChild(a);
+b.appendChild(a);
+b.parentNode.removeChild(b);
+document.getElementById("c").appendChild(b);
+</script>
+<p>PASS</p>
+</body>
+</html>

Copied: branches/safari-537.77-branch/LayoutTests/svg/custom/reparent-use-element-expected.txt (from rev 168915, trunk/LayoutTests/svg/custom/reparent-use-element-expected.txt) (0 => 169228)


--- branches/safari-537.77-branch/LayoutTests/svg/custom/reparent-use-element-expected.txt	                        (rev 0)
+++ branches/safari-537.77-branch/LayoutTests/svg/custom/reparent-use-element-expected.txt	2014-05-22 23:50:34 UTC (rev 169228)
@@ -0,0 +1,3 @@
+This tests that we don't cause an assertion failure when re-parenting a <use> after removing its referenced element.
+
+PASS

Copied: branches/safari-537.77-branch/LayoutTests/svg/custom/reparent-use-element.html (from rev 168915, trunk/LayoutTests/svg/custom/reparent-use-element.html) (0 => 169228)


--- branches/safari-537.77-branch/LayoutTests/svg/custom/reparent-use-element.html	                        (rev 0)
+++ branches/safari-537.77-branch/LayoutTests/svg/custom/reparent-use-element.html	2014-05-22 23:50:34 UTC (rev 169228)
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<html>
+<body>
+<head>
+<script>
+if (window.testRunner)
+    testRunner.dumpAsText();
+</script>
+<style>
+svg {
+    height: 0;
+    width: 0;
+}
+</style>
+</head>
+<p>This tests that we don't cause an assertion failure when re-parenting a &lt;use&gt; after removing its referenced element.</p>
+<svg version="1.1">
+    <circle id="a"></circle>
+    <use xlink:href="" id="b"></use>
+</svg>
+<div id="c"></div>
+<div id="a"></div>
+<script>
+var a = document.getElementById("a"); // <circle>
+var b = document.getElementById("b"); // <use>
+a.parentNode.removeChild(a);
+b.appendChild(a);
+b.parentNode.removeChild(b);
+document.getElementById("c").appendChild(b);
+</script>
+<p>PASS</p>
+</body>
+</html>

Modified: branches/safari-537.77-branch/Source/WebCore/ChangeLog (169227 => 169228)


--- branches/safari-537.77-branch/Source/WebCore/ChangeLog	2014-05-22 23:43:01 UTC (rev 169227)
+++ branches/safari-537.77-branch/Source/WebCore/ChangeLog	2014-05-22 23:50:34 UTC (rev 169228)
@@ -1,3 +1,69 @@
+2014-05-22  Lucas Forschler  <[email protected]>
+
+        Merge r168915
+
+    2014-05-15  Daniel Bates  <[email protected]>
+
+            SVG element may reference arbitrary DOM element before running its insertion logic
+            https://bugs.webkit.org/show_bug.cgi?id=132757
+            <rdar://problem/15703817>
+
+            Reviewed by Ryosuke Niwa.
+
+            Fixes an issue where an SVG element may reference an arbitrary DOM element e before e finished being
+            inserted in the tree.
+
+            Currently when an SVG element A is inserted into a document we use document.getElementById() to find the
+            element B it references (if any). If A is inserted before B and B has the same id as a later element in
+            the document then A can find B before B is notified that its been inserted into the document (i.e. before
+            Element::insertedFrom() is called on B). Instead, A should call document.getElementById() only after
+            cessation of the insertion operation that inserted it to ensure that all inserted nodes (including B)
+            processed their insertion-specific logic.
+
+            Tests: svg/custom/reparent-animate-element.html
+                   svg/custom/reparent-feimage-element.html
+                   svg/custom/reparent-mpath-element.html
+                   svg/custom/reparent-textpath-element.html
+                   svg/custom/reparent-tref-element.html
+                   svg/custom/reparent-use-element.html
+
+            * svg/SVGFEImageElement.cpp:
+            (WebCore::SVGFEImageElement::insertedInto): Return InsertionShouldCallDidNotifySubtreeInsertions so that
+            we are called back to resolve our target element (i.e. call SVGFEImageElement::buildPendingResources())
+            after the subtree we're in is inserted.
+            (WebCore::SVGFEImageElement::didNotifySubtreeInsertions): Added; turns around and calls SVGFEImageElement::buildPendingResources().
+            * svg/SVGFEImageElement.h:
+            * svg/SVGMPathElement.cpp:
+            (WebCore::SVGMPathElement::insertedInto): Return InsertionShouldCallDidNotifySubtreeInsertions so that
+            we are called back to resolve our target element (i.e. call SVGMPathElement::buildPendingResources())
+            after the subtree we're in is inserted.
+            (WebCore::SVGMPathElement::didNotifySubtreeInsertions): Added; turns around and calls SVGMPathElement::buildPendingResources().
+            * svg/SVGMPathElement.h:
+            * svg/SVGTRefElement.cpp:
+            (WebCore::SVGTRefElement::insertedInto): Return InsertionShouldCallDidNotifySubtreeInsertions so that
+            we are called back to resolve our target element (i.e. call SVGTRefElement::buildPendingResources())
+            after the subtree we're in is inserted.
+            (WebCore::SVGTRefElement::didNotifySubtreeInsertions): Added; turns around and calls SVGTRefElement::buildPendingResources().
+            * svg/SVGTRefElement.h:
+            * svg/SVGTextPathElement.cpp:
+            (WebCore::SVGTextPathElement::insertedInto): Return InsertionShouldCallDidNotifySubtreeInsertions so that
+            we are called back to resolve our target element (i.e. call SVGTextPathElement::buildPendingResources())
+            after the subtree we're in is inserted.
+            (WebCore::SVGTextPathElement::didNotifySubtreeInsertions): Added; turns around and calls SVGTextPathElement::buildPendingResources().
+            * svg/SVGTextPathElement.h:
+            * svg/SVGUseElement.cpp:
+            (WebCore::SVGUseElement::insertedInto): Return InsertionShouldCallDidNotifySubtreeInsertions so that
+            we are called back to resolve our target element (i.e. call SVGUseElement::buildPendingResources()) after its subtree is
+            inserted.
+            (WebCore::SVGUseElement::didNotifySubtreeInsertions): Added; turns around and calls SVGUseElement::buildPendingResources().
+            * svg/SVGUseElement.h:
+            * svg/animation/SVGSMILElement.cpp:
+            (WebCore::SVGSMILElement::insertedInto): Return InsertionShouldCallDidNotifySubtreeInsertions so that
+            we are called back to resolve our target element (i.e. call SVGSMILElement::buildPendingResources())
+            after the subtree we're in is inserted.
+            (WebCore::SVGSMILElement::didNotifySubtreeInsertions): Added; turns around and calls SVGSMILElement::buildPendingResources().
+            * svg/animation/SVGSMILElement.h:
+
 2014-05-22  Dana Burkart  <[email protected]>
 
         Merge r167856
@@ -51,6 +117,7 @@
             of a String.
             * page/SecurityOrigin.h: Updated for above change.
 
+
 2014-05-22  Lucas Forschler  <[email protected]>
 
         Merge r168636

Modified: branches/safari-537.77-branch/Source/WebCore/svg/SVGFEImageElement.cpp (169227 => 169228)


--- branches/safari-537.77-branch/Source/WebCore/svg/SVGFEImageElement.cpp	2014-05-22 23:43:01 UTC (rev 169227)
+++ branches/safari-537.77-branch/Source/WebCore/svg/SVGFEImageElement.cpp	2014-05-22 23:50:34 UTC (rev 169228)
@@ -177,8 +177,12 @@
 Node::InsertionNotificationRequest SVGFEImageElement::insertedInto(ContainerNode* rootParent)
 {
     SVGFilterPrimitiveStandardAttributes::insertedInto(rootParent);
+    return InsertionShouldCallDidNotifySubtreeInsertions;
+}
+
+void SVGFEImageElement::didNotifySubtreeInsertions(ContainerNode*)
+{
     buildPendingResource();
-    return InsertionDone;
 }
 
 void SVGFEImageElement::removedFrom(ContainerNode* rootParent)

Modified: branches/safari-537.77-branch/Source/WebCore/svg/SVGFEImageElement.h (169227 => 169228)


--- branches/safari-537.77-branch/Source/WebCore/svg/SVGFEImageElement.h	2014-05-22 23:43:01 UTC (rev 169227)
+++ branches/safari-537.77-branch/Source/WebCore/svg/SVGFEImageElement.h	2014-05-22 23:50:34 UTC (rev 169228)
@@ -45,6 +45,9 @@
 
     virtual ~SVGFEImageElement();
 
+protected:
+    virtual void didNotifySubtreeInsertions(ContainerNode*) override;
+
 private:
     SVGFEImageElement(const QualifiedName&, Document*);
 

Modified: branches/safari-537.77-branch/Source/WebCore/svg/SVGMPathElement.cpp (169227 => 169228)


--- branches/safari-537.77-branch/Source/WebCore/svg/SVGMPathElement.cpp	2014-05-22 23:43:01 UTC (rev 169227)
+++ branches/safari-537.77-branch/Source/WebCore/svg/SVGMPathElement.cpp	2014-05-22 23:50:34 UTC (rev 169228)
@@ -91,10 +91,15 @@
 {
     SVGElement::insertedInto(rootParent);
     if (rootParent->inDocument())
-        buildPendingResource();
+        return InsertionShouldCallDidNotifySubtreeInsertions;
     return InsertionDone;
 }
 
+void SVGMPathElement::didNotifySubtreeInsertions(ContainerNode*)
+{
+    buildPendingResource();
+}
+
 void SVGMPathElement::removedFrom(ContainerNode* rootParent)
 {
     SVGElement::removedFrom(rootParent);

Modified: branches/safari-537.77-branch/Source/WebCore/svg/SVGMPathElement.h (169227 => 169228)


--- branches/safari-537.77-branch/Source/WebCore/svg/SVGMPathElement.h	2014-05-22 23:43:01 UTC (rev 169227)
+++ branches/safari-537.77-branch/Source/WebCore/svg/SVGMPathElement.h	2014-05-22 23:50:34 UTC (rev 169228)
@@ -43,6 +43,9 @@
 
     void targetPathChanged();
 
+protected:
+    virtual void didNotifySubtreeInsertions(ContainerNode*) override;
+
 private:
     SVGMPathElement(const QualifiedName&, Document*);
 

Modified: branches/safari-537.77-branch/Source/WebCore/svg/SVGTRefElement.cpp (169227 => 169228)


--- branches/safari-537.77-branch/Source/WebCore/svg/SVGTRefElement.cpp	2014-05-22 23:43:01 UTC (rev 169227)
+++ branches/safari-537.77-branch/Source/WebCore/svg/SVGTRefElement.cpp	2014-05-22 23:50:34 UTC (rev 169228)
@@ -281,10 +281,15 @@
 {
     SVGStyledElement::insertedInto(rootParent);
     if (rootParent->inDocument())
-        buildPendingResource();
+        return InsertionShouldCallDidNotifySubtreeInsertions;
     return InsertionDone;
 }
 
+void SVGTRefElement::didNotifySubtreeInsertions(ContainerNode*)
+{
+    buildPendingResource();
+}
+
 void SVGTRefElement::removedFrom(ContainerNode* rootParent)
 {
     SVGStyledElement::removedFrom(rootParent);

Modified: branches/safari-537.77-branch/Source/WebCore/svg/SVGTRefElement.h (169227 => 169228)


--- branches/safari-537.77-branch/Source/WebCore/svg/SVGTRefElement.h	2014-05-22 23:43:01 UTC (rev 169227)
+++ branches/safari-537.77-branch/Source/WebCore/svg/SVGTRefElement.h	2014-05-22 23:50:34 UTC (rev 169228)
@@ -34,6 +34,9 @@
 public:
     static PassRefPtr<SVGTRefElement> create(const QualifiedName&, Document*);
 
+protected:
+    virtual void didNotifySubtreeInsertions(ContainerNode*) override;
+
 private:
     friend class SVGTRefTargetEventListener;
 

Modified: branches/safari-537.77-branch/Source/WebCore/svg/SVGTextPathElement.cpp (169227 => 169228)


--- branches/safari-537.77-branch/Source/WebCore/svg/SVGTextPathElement.cpp	2014-05-22 23:43:01 UTC (rev 169227)
+++ branches/safari-537.77-branch/Source/WebCore/svg/SVGTextPathElement.cpp	2014-05-22 23:50:34 UTC (rev 169228)
@@ -181,8 +181,12 @@
 Node::InsertionNotificationRequest SVGTextPathElement::insertedInto(ContainerNode* rootParent)
 {
     SVGTextContentElement::insertedInto(rootParent);
+    return InsertionShouldCallDidNotifySubtreeInsertions;
+}
+
+void SVGTextPathElement::didNotifySubtreeInsertions(ContainerNode*)
+{
     buildPendingResource();
-    return InsertionDone;
 }
 
 void SVGTextPathElement::removedFrom(ContainerNode* rootParent)

Modified: branches/safari-537.77-branch/Source/WebCore/svg/SVGTextPathElement.h (169227 => 169228)


--- branches/safari-537.77-branch/Source/WebCore/svg/SVGTextPathElement.h	2014-05-22 23:43:01 UTC (rev 169227)
+++ branches/safari-537.77-branch/Source/WebCore/svg/SVGTextPathElement.h	2014-05-22 23:50:34 UTC (rev 169228)
@@ -111,7 +111,10 @@
     };
 
     static PassRefPtr<SVGTextPathElement> create(const QualifiedName&, Document*);
- 
+
+protected:
+    virtual void didNotifySubtreeInsertions(ContainerNode*) override;
+
 private:
     SVGTextPathElement(const QualifiedName&, Document*);
 

Modified: branches/safari-537.77-branch/Source/WebCore/svg/SVGUseElement.cpp (169227 => 169228)


--- branches/safari-537.77-branch/Source/WebCore/svg/SVGUseElement.cpp	2014-05-22 23:43:01 UTC (rev 169227)
+++ branches/safari-537.77-branch/Source/WebCore/svg/SVGUseElement.cpp	2014-05-22 23:50:34 UTC (rev 169228)
@@ -187,12 +187,17 @@
         return InsertionDone;
     ASSERT(!m_targetElementInstance || !isWellFormedDocument(document()));
     ASSERT(!hasPendingResources() || !isWellFormedDocument(document()));
+    SVGExternalResourcesRequired::insertedIntoDocument(this);
     if (!m_wasInsertedByParser)
-        buildPendingResource();
-    SVGExternalResourcesRequired::insertedIntoDocument(this);
+        return InsertionShouldCallDidNotifySubtreeInsertions;
     return InsertionDone;
 }
 
+void SVGUseElement::didNotifySubtreeInsertions(ContainerNode*)
+{
+    buildPendingResource();
+}
+
 void SVGUseElement::removedFrom(ContainerNode* rootParent)
 {
     SVGStyledTransformableElement::removedFrom(rootParent);

Modified: branches/safari-537.77-branch/Source/WebCore/svg/SVGUseElement.h (169227 => 169228)


--- branches/safari-537.77-branch/Source/WebCore/svg/SVGUseElement.h	2014-05-22 23:43:01 UTC (rev 169227)
+++ branches/safari-537.77-branch/Source/WebCore/svg/SVGUseElement.h	2014-05-22 23:50:34 UTC (rev 169228)
@@ -55,6 +55,9 @@
 
     RenderObject* rendererClipChild() const;
 
+protected:
+    virtual void didNotifySubtreeInsertions(ContainerNode*) override;
+
 private:
     SVGUseElement(const QualifiedName&, Document*, bool wasInsertedByParser);
 

Modified: branches/safari-537.77-branch/Source/WebCore/svg/animation/SVGSMILElement.cpp (169227 => 169228)


--- branches/safari-537.77-branch/Source/WebCore/svg/animation/SVGSMILElement.cpp	2014-05-22 23:43:01 UTC (rev 169227)
+++ branches/safari-537.77-branch/Source/WebCore/svg/animation/SVGSMILElement.cpp	2014-05-22 23:50:34 UTC (rev 169228)
@@ -263,9 +263,12 @@
     if (m_timeContainer)
         m_timeContainer->notifyIntervalsChanged();
 
+    return InsertionShouldCallDidNotifySubtreeInsertions;
+}
+
+void SVGSMILElement::didNotifySubtreeInsertions(ContainerNode*)
+{
     buildPendingResource();
-
-    return InsertionDone;
 }
 
 void SVGSMILElement::removedFrom(ContainerNode* rootParent)

Modified: branches/safari-537.77-branch/Source/WebCore/svg/animation/SVGSMILElement.h (169227 => 169228)


--- branches/safari-537.77-branch/Source/WebCore/svg/animation/SVGSMILElement.h	2014-05-22 23:43:01 UTC (rev 169227)
+++ branches/safari-537.77-branch/Source/WebCore/svg/animation/SVGSMILElement.h	2014-05-22 23:50:34 UTC (rev 169228)
@@ -120,6 +120,8 @@
     virtual void setTargetElement(SVGElement*);
     virtual void setAttributeName(const QualifiedName&);
 
+    virtual void didNotifySubtreeInsertions(ContainerNode*) override;
+
 private:
     void buildPendingResource();
     void clearResourceReferences();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to