summaryrefslogtreecommitdiffstats
path: root/dom/svg/test/test_pathLength.html
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /dom/svg/test/test_pathLength.html
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'dom/svg/test/test_pathLength.html')
-rw-r--r--dom/svg/test/test_pathLength.html52
1 files changed, 52 insertions, 0 deletions
diff --git a/dom/svg/test/test_pathLength.html b/dom/svg/test/test_pathLength.html
new file mode 100644
index 000000000..499343fa3
--- /dev/null
+++ b/dom/svg/test/test_pathLength.html
@@ -0,0 +1,52 @@
+<!doctype html>
+<html>
+<!--
+https://bugzilla.mozilla.org/show_bug.cgi?id=1024926
+-->
+<head>
+ <meta charset="utf-8">
+ <title>Test path length changes when manipulated</title>
+ <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+ <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
+</head>
+<body>
+<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1024926">Mozilla Bug 1024926</a>
+<p id="display"></p>
+<div id="content" style="display: none">
+ <svg width="100%" height="1" id="svg">
+ <path id="path_lines" d="M50,100l0,0l0,-50l100,0l86.3325,122.665z"></path>
+ <path id="path_straight_curve" d="M0,0 C100,0 150,0 200,0" />
+ </svg>
+</div>
+<pre id="test">
+<script class="testbody" type="text/javascript">
+
+ SimpleTest.waitForExplicitFinish();
+
+ // Test a closed path with a series of lines.
+ var path = document.getElementById("path_lines");
+ is(path.getTotalLength(), 500, "Unexpected path length");
+
+ // Test a path that's been shortened via the DOM.
+ for (var i = 0; i < 2; i++) {
+ path.pathSegList.removeItem(path.pathSegList.numberOfItems - 1);
+ }
+ is(path.getTotalLength(), 150, "Unexpected path length");
+
+ // Test a path that's been shortened to be empty, via the DOM.
+ while (path.pathSegList.numberOfItems > 0) {
+ path.pathSegList.removeItem(0);
+ }
+ is(path.getTotalLength(), 0, "Unexpected path length");
+
+ // Test a path with a curve command ("C") that is really a straight line.
+ path = document.getElementById("path_straight_curve");
+ is(path.getTotalLength(), 200, "Unexpected path length, for straight line " +
+ "generated by 'C' command");
+
+ SimpleTest.finish();
+
+</script>
+</pre>
+</body>
+</html>