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/elements/SVGGeometryElement-rect.svg
<?xml version="1.0" encoding="UTF-8"?>
<metadata>
<h:meta name="assert" content="SVGGeometryElement members work for rect elements."/>
</metadata>
<style>
rect {
stroke-width: 10;
}
</style>
<rect id="box" x="50" y="50" width="200" height="100" pathLength="6"/>
<h:script src="/resources/testharness.js"/>
<h:script src="/resources/testharnessreport.js"/>
<script><![CDATA[
var box = document.getElementById('box');
test(function() {
assert_equals(box.pathLength.baseVal, 6);
assert_equals(box.getTotalLength(), 600);
assert_equals(box.getPointAtLength(210).x, 250);
assert_equals(box.getPointAtLength(210).y, 60);
}, 'getTotalLength and getPointAtLength do not take pathLength into account');
test(function() {
assert_true(box.getPointAtLength(210) instanceof SVGPoint);
}, 'getPointAtLength() returns instance of SVGPoint');
]]></script>
</svg>