Title: [177060] branches/safari-600.1.4.13-branch

Diff

Modified: branches/safari-600.1.4.13-branch/LayoutTests/ChangeLog (177059 => 177060)


--- branches/safari-600.1.4.13-branch/LayoutTests/ChangeLog	2014-12-10 16:46:59 UTC (rev 177059)
+++ branches/safari-600.1.4.13-branch/LayoutTests/ChangeLog	2014-12-10 16:48:56 UTC (rev 177060)
@@ -1,5 +1,21 @@
 2014-12-10  Babak Shafiei  <bshaf...@apple.com>
 
+        Merge r173738.
+
+    2014-09-18  Daniel Bates  <daba...@apple.com>
+
+            REGRESSION (r168921): SVG elements may be unnecessarily rebuilt
+            https://bugs.webkit.org/show_bug.cgi?id=136373
+
+            Reviewed by David Kilzer.
+
+            Add a test to ensure that we don't rebuild a SVG element that will be removed from the document.
+
+            * svg/custom/remove-subtree-including-use-with-child-textpath-that-references-earlier-path-expected.txt: Added.
+            * svg/custom/remove-subtree-including-use-with-child-textpath-that-references-earlier-path.html: Added.
+
+2014-12-10  Babak Shafiei  <bshaf...@apple.com>
+
         Merge r173424.
 
     2014-09-08  Mihnea Ovidenie  <mih...@adobe.com>

Copied: branches/safari-600.1.4.13-branch/LayoutTests/svg/custom/remove-subtree-including-use-with-child-textpath-that-references-earlier-path-expected.txt (from rev 175518, branches/safari-600.3-branch/LayoutTests/svg/custom/remove-subtree-including-use-with-child-textpath-that-references-earlier-path-expected.txt) (0 => 177060)


--- branches/safari-600.1.4.13-branch/LayoutTests/svg/custom/remove-subtree-including-use-with-child-textpath-that-references-earlier-path-expected.txt	                        (rev 0)
+++ branches/safari-600.1.4.13-branch/LayoutTests/svg/custom/remove-subtree-including-use-with-child-textpath-that-references-earlier-path-expected.txt	2014-12-10 16:48:56 UTC (rev 177060)
@@ -0,0 +1 @@
+ALERT: PASS

Copied: branches/safari-600.1.4.13-branch/LayoutTests/svg/custom/remove-subtree-including-use-with-child-textpath-that-references-earlier-path.html (from rev 175518, branches/safari-600.3-branch/LayoutTests/svg/custom/remove-subtree-including-use-with-child-textpath-that-references-earlier-path.html) (0 => 177060)


--- branches/safari-600.1.4.13-branch/LayoutTests/svg/custom/remove-subtree-including-use-with-child-textpath-that-references-earlier-path.html	                        (rev 0)
+++ branches/safari-600.1.4.13-branch/LayoutTests/svg/custom/remove-subtree-including-use-with-child-textpath-that-references-earlier-path.html	2014-12-10 16:48:56 UTC (rev 177060)
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+if (window.testRunner)
+    testRunner.dumpAsText();
+</script>
+</head>
+<body>
+<!-- This tests that we don't crash when removing a SVG subtree (by removing <html>) that contains nodes that reference nodes within the same subtree. This test PASSED if and only if there isn't any red or "FAIL" on the page and a _javascript_ alert with message "PASS" is shown. -->
+<svg style="width: 200px; height: 200px">
+    <path id="Path" d="M 0 20 L 100 20 L 100 120 L 0 120" fill="red">
+        <text>
+            <textPath xlink:href="" FAIL FAIL FAIL FAIL FAIL FAIL FAIL</textPath>
+        </text>
+    </path>
+    <!--
+     Notice that the <use> (below) will be expanded (since it references #Path) and have the form:
+     <use xlink:href=""
+         <path id="Path" d="M 0 20 L 100 20 L 100 120 L 0 120" fill="red">
+            <text>
+                <textPath xlink:href="" FAIL FAIL FAIL FAIL FAIL FAIL FAIL</textPath>
+            </text>
+        </path>
+    </use>
+    -->
+    <use xlink:href=""
+</svg>
+<script>
+document.removeChild(document.documentElement);
+alert("PASS");
+</script>
+</body>
+</html>

Modified: branches/safari-600.1.4.13-branch/Source/WebCore/ChangeLog (177059 => 177060)


--- branches/safari-600.1.4.13-branch/Source/WebCore/ChangeLog	2014-12-10 16:46:59 UTC (rev 177059)
+++ branches/safari-600.1.4.13-branch/Source/WebCore/ChangeLog	2014-12-10 16:48:56 UTC (rev 177060)
@@ -1,5 +1,25 @@
 2014-12-10  Babak Shafiei  <bshaf...@apple.com>
 
+        Merge r173738.
+
+    2014-09-18  Daniel Bates  <daba...@apple.com>
+
+            REGRESSION (r168921): SVG elements may be unnecessarily rebuilt
+            https://bugs.webkit.org/show_bug.cgi?id=136373
+
+            Reviewed by David Kilzer.
+
+            Fixes an issue where a SVG element may be unnecessarily rebuilt. In particular,
+            it is unnecessary to rebuild a SVG element that will be removed from the document.
+
+            Test: svg/custom/remove-subtree-including-use-with-child-textpath-that-references-earlier-path.html
+
+            * svg/SVGDocumentExtensions.cpp:
+            (WebCore::SVGDocumentExtensions::removeAllElementReferencesForTarget): Modified to remove a SVG element
+            from the list of elements to be rebuilt.
+
+2014-12-10  Babak Shafiei  <bshaf...@apple.com>
+
         Merge r173424.
 
     2014-09-08  Mihnea Ovidenie  <mih...@adobe.com>

Modified: branches/safari-600.1.4.13-branch/Source/WebCore/svg/SVGDocumentExtensions.cpp (177059 => 177060)


--- branches/safari-600.1.4.13-branch/Source/WebCore/svg/SVGDocumentExtensions.cpp	2014-12-10 16:46:59 UTC (rev 177059)
+++ branches/safari-600.1.4.13-branch/Source/WebCore/svg/SVGDocumentExtensions.cpp	2014-12-10 16:48:56 UTC (rev 177060)
@@ -379,6 +379,10 @@
 void SVGDocumentExtensions::removeAllElementReferencesForTarget(SVGElement* referencedElement)
 {
     m_elementDependencies.remove(referencedElement);
+
+    size_t position = m_rebuildElements.find(referencedElement);
+    if (position != notFound)
+        m_rebuildElements.remove(position);
 }
 
 #if ENABLE(SVG_FONTS)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to