wpt / svg / path / interfaces / getPathData-malformed-d.html

Status: FAIL | Duration: 62ms | Subtests: 0/2 | Open test on wpt.live | wpt.fyi

Data from commit:
96ff533 Remove hidden nodes from the acccessibility tree (#823) (2026-09-07)

SubtestStatusMessage
path.getPathData() with malformed d returns segments up to the errorFAILnot a callable function
path.getPathData() with closepath-only d returns []FAILnot a callable function

/svg/path/interfaces/getPathData-malformed-d.html

<!doctype html>
<title>SVGPathElement.getPathData() with malformed d attribute</title>
<link rel="help" href="https://svgwg.org/specs/paths/#InterfaceSVGPathData">
<link rel="author" title="Virali Purbey" href="mailto:viralipurbey@microsoft.com">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="support/getPathData-helpers.js"></script>

<svg>
  <path id="truncated" d="M 10 20 L"/>
  <path id="closepathOnly" d="Z"/>
</svg>
<script>
test(() => {
  // L command is missing its coordinates; parser stops at the error.
  assert_path_data_equals(truncated.getPathData(), [
    { type: "M", values: [10, 20] }
  ]);
}, "path.getPathData() with malformed d returns segments up to the error");

test(() => {
  // Path data must start with a moveto; bare "Z" is invalid.
  assert_path_data_equals(closepathOnly.getPathData(), []);
}, "path.getPathData() with closepath-only d returns []");
</script>