tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

test_svg.html (1460B)


      1 <html>
      2 
      3 <head>
      4  <title>SVG Text attributes tests</title>
      5  <meta charset="utf-8">
      6  <link rel="stylesheet" href="chrome://mochikit/content/tests/SimpleTest/test.css" />
      7 
      8  <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
      9 
     10  <script src="../common.js"></script>
     11  <script src="../attributes.js"></script>
     12  <script src="../events.js"></script>
     13 
     14  <script>
     15    function doTest() {
     16      const svg = getNode("svg");
     17      const defAttrs = buildDefaultTextAttrs(svg, "10pt");
     18      testDefaultTextAttrs(svg, defAttrs);
     19      testTextAttrs(svg, 0, {}, defAttrs, 0, 2);
     20 
     21      const g = getNode("g");
     22      testTextAttrs(g, 0, {}, defAttrs, 0, 2);
     23 
     24      const a = getNode("a");
     25      const aDefAttrs = buildDefaultTextAttrs(a, "10pt");
     26      testTextAttrs(a, 0, {}, aDefAttrs, 0, 1);
     27 
     28      const f3 = getNode("f3");
     29      testTextAttrs(f3, 0, {}, defAttrs, 0, 2);
     30 
     31      SimpleTest.finish();
     32    }
     33 
     34    SimpleTest.waitForExplicitFinish();
     35    addA11yLoadEvent(doTest);
     36  </script>
     37 </head>
     38 <body style="font-size: 12pt">
     39 
     40  <p id="display"></p>
     41  <div id="content" style="display: none"></div>
     42  <pre id="test">
     43  </pre>
     44 
     45  <svg id="svg" style="font-size: smaller">
     46    <foreignobject>f1</foreignobject>
     47    <g id="g">
     48      <title>g</title>
     49      <foreignobject>f2</foreignobject>
     50    </g>
     51    <text><a href="#" id="a">a</a></text>
     52    <foreignobject id="f3" role="button"><body>f3</body></foreignobject>
     53  </svg>
     54 
     55 </body>
     56 </html>