Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

SVG Preview (Scaled)

Preview of https://hg.mozilla.org/mozilla-central/raw-file/tip/testing/web-platform/tests/svg/types/scripted/SVGGeometryElement.getTotalLength-01.svg
<title>SVGGeometryElement.prototype.getTotalLength() query with 'pathLength'</title>
<h:script src="/resources/testharness.js"/>
<h:script src="/resources/testharnessreport.js"/>
<script>
test(function() {
let path = document.createElementNS('http://www.w3.org/2000/svg', 'path');
path.setAttribute('d', 'M0,0L100,0L100,100');
path.setAttribute('pathLength', '1000');
assert_approx_equals(path.getTotalLength(), 200, 1e-5);
}, document.title+', getTotalLength');
</script>
</svg>