summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/svg/path/error-handling/bounding.svg
blob: 85c089b25baa814e563e136bcba819e4bd80b2b1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg"
     xmlns:h="http://www.w3.org/1999/xhtml">
  <metadata>
    <h:link rel="help" href="https://svgwg.org/svg2-draft/single-page.html#paths-PathDataErrorHandling"/>
    <h:meta name="assert" content="render up to (but not including) the first error"/>
  </metadata>
  <g id="container">
    <path transform="translate(90,10)" />
    <path transform="translate(80,20)" d="none" />
    <path transform="translate(70,30)" d="# invalid" />
    <path transform="translate(60,40)" d="m 0 0 l 3 -4 z # ignored suffix v 123" />
    <path transform="translate(50,50)" d="" />
    <path transform="translate(40,60)" d="m 0 0 l -9 11 -123 z # ignore last l parameter" />
    <polygon transform="translate(20,80)" />
    <polyline transform="translate(10,90)" />
  </g>
  <h:script src="/resources/testharness.js"/>
  <h:script src="/resources/testharnessreport.js"/>
  <script><![CDATA[
  test(function() {
    var container = document.getElementById('container');
    var bbox = container.getBBox();

    // The rendered paths are "m 0 0 l 3 -4 z" and "m 0 0 l -9 11"
    assert_equals(bbox.x, 31);
    assert_equals(bbox.y, 36);

    assert_equals(bbox.width, 32);
    assert_equals(bbox.height, 35);
  });
  ]]></script>
</svg>