2 <html xmlns=
"http://www.w3.org/1999/xhtml">
4 https://bugzilla.mozilla.org/show_bug.cgi?id=1474284
7 <title>Test for Bug
1474284</title>
8 <script src=
"/tests/SimpleTest/SimpleTest.js"></script>
9 <link rel=
"stylesheet" type=
"text/css" href=
"/tests/SimpleTest/test.css" />
12 <a target=
"_blank" href=
"https://bugzilla.mozilla.org/show_bug.cgi?id=1474284">Mozilla Bug
1474284</a>
15 <svg xmlns=
"http://www.w3.org/2000/svg">
16 <path id=
"path1" stroke=
"#000" fill=
"none"
19 <symbol font-size=
"10" width=
"20em" height=
"20em">
20 <rect id=
"r1" x=
"5em" y=
"6em" width=
"20%" height=
"30%" />
25 <script class=
"testbody" type=
"application/javascript">
26 SimpleTest.waitForExplicitFinish();
29 isfuzzy(document.getElementById(
"path1").getTotalLength(),
31 'getTotalLength() on element
id=
"path1" returned the wrong value');
33 let r1 = document.getElementById(
"r1");
34 is(r1.getTotalLength(),
200,
"getTotalLength() should work for non-rendered element");
36 let r2 = document.createElementNS(
"http://www.w3.org/2000/svg",
"rect");
37 r2.setAttribute(
"width",
200);
38 r2.setAttribute(
"height",
300);
39 is(r2.getTotalLength(),
1000,
"getTotalLength() should work for a rect element not in the document");
41 let c = document.createElementNS(
"http://www.w3.org/2000/svg",
"circle");
42 c.setAttribute(
"r",
200);
43 isfuzzy(c.getTotalLength(),
2 * Math.PI *
200,
0.2,
"getTotalLength() should work for a circle element not in the document");
45 let e = document.createElementNS(
"http://www.w3.org/2000/svg",
"ellipse");
46 e.setAttribute(
"rx",
200);
47 e.setAttribute(
"ry",
200);
48 isfuzzy(e.getTotalLength(),
2 * Math.PI *
200,
0.2,
"getTotalLength() should work for an ellipse element not in the document");
53 window.addEventListener(
"load", run);