Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

<!--
-->
<head>
<title>Tests for SVG path.setPathData</title>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body>
<p id="display"></p>
<div id="content" style="display:none;">
<svg id="svg" xmlns="http://www.w3.org/2000/svg" width="100" height="100">
<path id="path"/>
</svg>
</div>
<pre id="test">
<script class="testbody" type="text/javascript">
<![CDATA[
SimpleTest.waitForExplicitFinish();
function run_tests()
{
let path = document.getElementById("path");
path.setPathData([{"type":"M","values":[0,0]},{"type":"L","values":[100,100]}]);
is(path.getAttribute("d"), "M 0 0 L 100 100");
path.setPathData([{"type":"M","values":[0,0]},{"type":"Z","values":[]}]);
is(path.getAttribute("d"), "M 0 0 Z");
SimpleTest.finish();
}
window.addEventListener("load", run_tests);
]]>
</script>
</pre>
</body>
</html>