summaryrefslogtreecommitdiffstats
path: root/accessible/tests/mochitest/textattrs/test_svg.html
blob: c8d5d5f89386f231382d6d7dd3bab65e93969b60 (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
<html>

<head>
  <title>SVG Text attributes tests</title>
  <meta charset="utf-8">
  <link rel="stylesheet" href="chrome://mochikit/content/tests/SimpleTest/test.css" />

  <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>

  <script src="../common.js"></script>
  <script src="../attributes.js"></script>
  <script src="../events.js"></script>

  <script>
    function doTest() {
      const svg = getNode("svg");
      const defAttrs = buildDefaultTextAttrs(svg, "10pt");
      testDefaultTextAttrs(svg, defAttrs);
      testTextAttrs(svg, 0, {}, defAttrs, 0, 2);

      const g = getNode("g");
      testTextAttrs(g, 0, {}, defAttrs, 0, 2);

      const a = getNode("a");
      const aDefAttrs = buildDefaultTextAttrs(a, "10pt");
      testTextAttrs(a, 0, {}, aDefAttrs, 0, 1);

      SimpleTest.finish();
    }

    SimpleTest.waitForExplicitFinish();
    addA11yLoadEvent(doTest);
  </script>
</head>
<body style="font-size: 12pt">

  <p id="display"></p>
  <div id="content" style="display: none"></div>
  <pre id="test">
  </pre>

  <svg id="svg" style="font-size: smaller">
    <foreignobject>f1</foreignobject>
    <g id="g">
      <title>g</title>
      <foreignobject>f2</foreignobject>
    </g>
    <text><a href="#" id="a">a</a></text>
  </svg>

</body>
</html>