Bug 616542 - Shorten file path length of mochitest; r=ted
[gecko.git] / content / svg / content / test / test_valueLeaks.xhtml
blobd80a5cf25fe4fd6cac07f1468716b98625246c7c
1 <html xmlns="http://www.w3.org/1999/xhtml">
2 <!--
3 https://bugzilla.mozilla.org/show_bug.cgi?id=467671
4 -->
5 <head>
6 <title>Test for Bug 467671</title>
7 <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
8 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
9 </head>
10 <body>
11 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=467671">Mozilla Bug 467671</a>
12 <p id="display"></p>
13 <div id="content" style="display: none">
15 </div>
16 <pre id="test">
17 <script type="application/javascript">
18 <![CDATA[
20 /** Test for Bug 467671 **/
22 function storeSVGPropertyAsExpando(localName, prop)
24 var elem = document.createElementNS("http://www.w3.org/2000/svg", localName);
26 elem.addEventListener("click", function(){}, false);
28 var propVal = elem[prop];
29 Object.prototype.toSource[prop + "_expando"] = propVal;
30 if (propVal instanceof SVGAnimatedAngle || propVal instanceof SVGAnimatedLength ||
31 propVal instanceof SVGAnimatedRect || propVal instanceof SVGAnimatedPreserveAspectRatio) {
32 Object.prototype.toSource[prop + "_baseVal_expando"] = propVal.baseVal;
33 Object.prototype.toSource[prop + "_animVal_expando"] = propVal.animVal;
37 // class
38 storeSVGPropertyAsExpando("marker", "class");
40 // angle
41 storeSVGPropertyAsExpando("marker", "orientAngle");
43 // viewBox
44 storeSVGPropertyAsExpando("marker", "viewBox");
46 // preserveAspectRatio
47 storeSVGPropertyAsExpando("marker", "preserveAspectRatio");
49 // boolean
50 storeSVGPropertyAsExpando("feConvolveMatrix", "preserveAlpha");
52 // enum
53 storeSVGPropertyAsExpando("feConvolveMatrix", "edgeMode");
55 // special marker enum
56 storeSVGPropertyAsExpando("marker", "orientType");
58 // integer
59 storeSVGPropertyAsExpando("feConvolveMatrix", "orderX");
61 // length
62 storeSVGPropertyAsExpando("feConvolveMatrix", "x");
64 // number
65 storeSVGPropertyAsExpando("feConvolveMatrix", "divisor");
67 // string
68 storeSVGPropertyAsExpando("feConvolveMatrix", "in1");
70 var elem1 = document.createElementNS("http://www.w3.org/2000/svg", "switch");
71 var elem2 = document.createElementNS("http://www.w3.org/2000/svg", "rect");
72 elem1.appendChild(elem2);
73 document.getElementById("content").appendChild(elem1);
75 elem2.addEventListener("click", function(){}, false);
77 Object.prototype.toSource.expando = elem1;
79 ok(true, "SVG shouldn't leak.");
81 ]]>
82 </script>
83 </pre>
84 </body>
85 </html>