summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/svg/shapes/scripted/disabled-shapes-not-hit.svg
blob: 21ea9078785e865d36f03a3830b6b90f63f3d10a (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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<svg xmlns="http://www.w3.org/2000/svg" xmlns:h="http://www.w3.org/1999/xhtml">
  <title>Disabled shapes are not rendered and cannot be hit</title>
  <h:script src="/resources/testharness.js"/>
  <h:script src="/resources/testharnessreport.js"/>
  <metadata>
    <h:link rel="help" href="https://svgwg.org/svg2-draft/shapes.html#RectElement"/>
    <h:link rel="help" href="https://svgwg.org/svg2-draft/shapes.html#CircleElement"/>
    <h:link rel="help" href="https://svgwg.org/svg2-draft/shapes.html#EllipseElement"/>
  </metadata>
  <g stroke="red" stroke-width="100">
    <g transform="translate(50, 50)">
      <rect/>
      <rect width="0" height="10"/>
      <rect width="-10" height="10"/>
      <rect height="0" width="10"/>
      <rect height="-10" width="10"/>
      <rect style="width: 0"/>
      <rect style="width: 0" height="10"/>
      <rect style="width: -10px"/>
      <rect style="width: -10px" height="10"/>
      <rect style="height: 0"/>
      <rect style="height: 0" width="10"/>
      <rect style="height: -10px"/>
      <rect style="height: -10px" width="10"/>
      <rect style="width: calc(-10px); height: calc(-10px)"/>
    </g>

    <g transform="translate(150, 50)">
      <circle/>
      <circle r="0"/>
      <circle r="-10"/>
      <circle style="r: 0"/>
      <circle style="r: -10px"/>
      <circle style="r: calc(-10px)"/>
    </g>

    <g transform="translate(250, 50)">
      <ellipse/>
      <ellipse rx="0"/>
      <ellipse rx="0" ry="10"/>
      <ellipse ry="0"/>
      <ellipse ry="0" rx="10"/>
      <ellipse style="rx: 0"/>
      <ellipse style="rx: -10px"/>
      <ellipse style="rx: 0" ry="10"/>
      <ellipse style="ry: 0"/>
      <ellipse style="ry: -10px"/>
      <ellipse style="ry: 0" rx="10"/>
      <ellipse style="rx: calc(-10px); ry: calc(-10px)"/>
    </g>
  </g>
  <script><![CDATA[
    test(function() {
      let element = document.elementFromPoint(50, 50);
      assert_equals(element, document.documentElement, "does not hit one of the shapes");
    }, document.title + ": <rect>");

    test(function() {
      let element = document.elementFromPoint(150, 50);
      assert_equals(element, document.documentElement, "does not hit one of the shapes");
    }, document.title + ": <circle>");

    test(function() {
      let element = document.elementFromPoint(250, 50);
      assert_equals(element, document.documentElement, "does not hit one of the shapes");
    }, document.title + ": <ellipse>");
  ]]>
  </script>
</svg>