tor-browser

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

test_pointer-events-3.xhtml (1676B)


      1 <html xmlns="http://www.w3.org/1999/xhtml">
      2 <!--
      3 https://bugzilla.mozilla.org/show_bug.cgi?id=762679
      4 -->
      5 <head>
      6  <title>Test pointer events for small objects scaled up</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  // Get the coords of the origin of the SVG canvas:
     19  var originX = div.offsetLeft;
     20  var originY = div.offsetTop;
     21  var circle = document.getElementById("circle");
     22 
     23  var elementFromPoint = document.elementFromPoint(originX + 150, originY + 52);
     24  is(elementFromPoint, circle, "Top of circle should hit");
     25 
     26  elementFromPoint = document.elementFromPoint(originX + 249, originY + 150);
     27  is(elementFromPoint, circle, "Right of circle should hit");
     28 
     29  elementFromPoint = document.elementFromPoint(originX + 150, originY + 249);
     30  is(elementFromPoint, circle, "Bottom of circle should hit");
     31 
     32  elementFromPoint = document.elementFromPoint(originX + 51, originY + 150);
     33  is(elementFromPoint, circle, "Left of circle should hit");
     34 
     35  SimpleTest.finish();
     36 }
     37 
     38 ]]>
     39 </script>
     40 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=762679">Mozilla Bug 762679</a>
     41 <p id="display"></p>
     42 <div id="content">
     43 
     44  <div width="100%" height="1" id="div">
     45  <svg xmlns="http://www.w3.org/2000/svg" width="100%" height="400" id="svg">
     46    <circle id="circle" cx="1.5" cy="1.5" r="1" transform="scale(100, 100)"/>
     47  </svg>
     48  </div>
     49 
     50 </div>
     51 <pre id="test">
     52 </pre>
     53 </body>
     54 </html>