tor-browser

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

test_stroke-linecap-hit-testing.xhtml (1229B)


      1 <html xmlns="http://www.w3.org/1999/xhtml">
      2 <!--
      3 https://bugzilla.mozilla.org/show_bug.cgi?id=589648
      4 -->
      5 <head>
      6  <title>Test hit-testing of line caps</title>
      7  <script src="/tests/SimpleTest/SimpleTest.js"></script>
      8  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
      9 </head>
     10 <body onload="run()">
     11 <script class="testbody" type="text/javascript">
     12 <![CDATA[
     13 
     14 SimpleTest.waitForExplicitFinish();
     15 
     16 function run() {
     17  var div = document.getElementById("div");
     18  var x = div.offsetLeft;
     19  var y = div.offsetTop;
     20  var got, expected;
     21 
     22  got = document.elementFromPoint(5 + x, 5 + y);
     23  expected = document.getElementById("zero-length-square-caps");
     24  is(got, expected, "Check hit on zero length subpath's square caps");
     25 
     26  SimpleTest.finish();
     27 }
     28 
     29 ]]>
     30 </script>
     31 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=500174">Mozilla Bug 500174</a>
     32 <p id="display"></p>
     33 <div id="content">
     34 
     35  <div width="100%" height="1" id="div"></div>
     36  <svg xmlns="http://www.w3.org/2000/svg" id="svg" width="400" height="300">
     37    <path id="zero-length-square-caps" stroke="blue" stroke-width="50"
     38          stroke-linecap="square" d="M25,25 L25,25"/>
     39  </svg>
     40 
     41 </div>
     42 <pre id="test">
     43 </pre>
     44 </body>
     45 </html>