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/SVGPoint.html - WPT Dashboard Interop Dashboard
<!DOCTYPE HTML>
<title>SVGPoint interface</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
test(function() {
let point = svgElement.createSVGPoint();
// Check initial point values.
assert_equals(point.x, 0);
assert_equals(point.y, 0);
point.y = 2;
// Check setting valid arguments.
assert_equals(point.x, 0);
assert_equals(point.y, 2);
// Check setting invalid arguments.
assert_throws_js(TypeError, function() { point.x = NaN; });
assert_throws_js(TypeError, function() { point.x = Infinity; });
assert_equals(point.x, 0);
});
</script>