Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /svg/types/scripted/SVGGeometryElement.getTotalLength-01.svg - WPT Dashboard Interop Dashboard
<title>SVGGeometryElement.prototype.getTotalLength() query with 'pathLength'</title>
<h:link rel="help" href="https://svgwg.org/svg2-draft/types.html#__svg__SVGGeometryElement__getTotalLength"/>
<h:script src="/resources/testharness.js"/>
<h:script src="/resources/testharnessreport.js"/>
<script>
test(function() {
path.setAttribute('d', 'M0,0L100,0L100,100');
path.setAttribute('pathLength', '1000');
assert_approx_equals(path.getTotalLength(), 200, 1e-5);
}, document.title+', getTotalLength');
</script>
</svg>