Title: [251957] trunk
Revision
251957
Author
s...@apple.com
Date
2019-11-01 17:14:40 -0700 (Fri, 01 Nov 2019)

Log Message

SVG pair properties must be detached from their owner before it's deleted
https://bugs.webkit.org/show_bug.cgi?id=203545

Reviewed by Simon Fraser.

Source/WebCore:

SVGAnimatedPropertyPairAccessor needs to override its detach() method so
each of its pair properties detaches itself from the owner.
SVGPointerMemberAccessor does the same thing but for a single property
which covers all the list properties as well.

Test: svg/custom/pair-properties-detach.html

* svg/properties/SVGAnimatedPropertyPairAccessor.h:

LayoutTests:

* svg/custom/pair-properties-detach-expected.txt: Added.
* svg/custom/pair-properties-detach.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (251956 => 251957)


--- trunk/LayoutTests/ChangeLog	2019-11-02 00:13:04 UTC (rev 251956)
+++ trunk/LayoutTests/ChangeLog	2019-11-02 00:14:40 UTC (rev 251957)
@@ -1,3 +1,13 @@
+2019-11-01  Said Abou-Hallawa  <sabouhall...@apple.com>
+
+        SVG pair properties must be detached from their owner before it's deleted
+        https://bugs.webkit.org/show_bug.cgi?id=203545
+
+        Reviewed by Simon Fraser.
+
+        * svg/custom/pair-properties-detach-expected.txt: Added.
+        * svg/custom/pair-properties-detach.html: Added.
+
 2019-11-01  Eric Carlson  <eric.carl...@apple.com>
 
         Add experimental TextTrackCue API

Added: trunk/LayoutTests/svg/custom/pair-properties-detach-expected.txt (0 => 251957)


--- trunk/LayoutTests/svg/custom/pair-properties-detach-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/svg/custom/pair-properties-detach-expected.txt	2019-11-02 00:14:40 UTC (rev 251957)
@@ -0,0 +1,13 @@
+This test checks detaching the SVG pair properties from the owner element.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS angle.baseVal.value = 100 is 100
+PASS type.baseVal = SVGMarkerElement.SVG_MARKER_ORIENT_AUTO is SVGMarkerElement.SVG_MARKER_ORIENT_AUTO
+PASS radiusX.baseVal = 100 is 100
+PASS orderX.baseVal = 100 is 100
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/svg/custom/pair-properties-detach.html (0 => 251957)


--- trunk/LayoutTests/svg/custom/pair-properties-detach.html	                        (rev 0)
+++ trunk/LayoutTests/svg/custom/pair-properties-detach.html	2019-11-02 00:14:40 UTC (rev 251957)
@@ -0,0 +1,33 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src=""
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script>
+description("This test checks detaching the SVG pair properties from the owner element.");
+
+if (window.testRunner) {
+    gc = function() { window.GCController.collect() };
+} else if (!window.gc)
+    gc = function() { };
+
+var angle = document.createElementNS("http://www.w3.org/2000/svg", "marker").orientAngle;
+var type = document.createElementNS("http://www.w3.org/2000/svg", "marker").orientType;
+var radiusX = document.createElementNS("http://www.w3.org/2000/svg", "feMorphology").radiusX;
+var orderX = document.createElementNS("http://www.w3.org/2000/svg", "feConvolveMatrix").orderX;
+
+gc();
+
+shouldBe("angle.baseVal.value = 100", "100");
+shouldBe("type.baseVal = SVGMarkerElement.SVG_MARKER_ORIENT_AUTO", "SVGMarkerElement.SVG_MARKER_ORIENT_AUTO");
+shouldBe("radiusX.baseVal = 100", "100");
+shouldBe("orderX.baseVal = 100", "100");
+
+successfullyParsed = true;
+</script>
+<script src=""
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (251956 => 251957)


--- trunk/Source/WebCore/ChangeLog	2019-11-02 00:13:04 UTC (rev 251956)
+++ trunk/Source/WebCore/ChangeLog	2019-11-02 00:14:40 UTC (rev 251957)
@@ -1,3 +1,19 @@
+2019-11-01  Said Abou-Hallawa  <sabouhall...@apple.com>
+
+        SVG pair properties must be detached from their owner before it's deleted
+        https://bugs.webkit.org/show_bug.cgi?id=203545
+
+        Reviewed by Simon Fraser.
+
+        SVGAnimatedPropertyPairAccessor needs to override its detach() method so
+        each of its pair properties detaches itself from the owner.
+        SVGPointerMemberAccessor does the same thing but for a single property
+        which covers all the list properties as well.
+
+        Test: svg/custom/pair-properties-detach.html
+
+        * svg/properties/SVGAnimatedPropertyPairAccessor.h:
+
 2019-11-01  Benjamin Nham  <n...@apple.com>
 
         Mark VeryLow priority requests using a request dictionary key

Modified: trunk/Source/WebCore/svg/properties/SVGAnimatedPropertyPairAccessor.h (251956 => 251957)


--- trunk/Source/WebCore/svg/properties/SVGAnimatedPropertyPairAccessor.h	2019-11-02 00:13:04 UTC (rev 251956)
+++ trunk/Source/WebCore/svg/properties/SVGAnimatedPropertyPairAccessor.h	2019-11-02 00:14:40 UTC (rev 251957)
@@ -58,6 +58,12 @@
     Ref<AnimatedPropertyType2>& property2(OwnerType& owner) const { return m_accessor2.property(owner); }
     const Ref<AnimatedPropertyType2>& property2(const OwnerType& owner) const { return m_accessor2.property(owner); }
 
+    void detach(const OwnerType& owner) const override
+    {
+        property1(owner)->detach();
+        property2(owner)->detach();
+    }
+
     bool matches(const OwnerType& owner, const SVGAnimatedProperty& animatedProperty) const override
     {
         return m_accessor1.matches(owner, animatedProperty) || m_accessor2.matches(owner, animatedProperty);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to