tor-browser

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

test_bug1111995.html (2167B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <!--
      4 https://bugzilla.mozilla.org/show_bug.cgi?id=1111995
      5 -->
      6 <head>
      7  <meta charset="utf-8">
      8  <title>Test for Bug 1111995</title>
      9  <script src="/tests/SimpleTest/SimpleTest.js"></script>
     10  <script src="/tests/SimpleTest/EventUtils.js"></script>
     11  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
     12  <script type="application/javascript">
     13 
     14  /** Test for Bug 1111995 */
     15 
     16  function doTest() {
     17    SimpleTest.waitForExplicitFinish();
     18 
     19    var clicks = 0;
     20    var elms = document.querySelectorAll('.click');
     21    for (var i = 0; i < elms.length; ++i) {
     22      var e = elms[i];
     23      e.addEventListener('click', function(event) {
     24        ++clicks;
     25      });
     26    }
     27    
     28    for (var i = 0; i < elms.length; ++i) {
     29      var e = elms[i];
     30      synthesizeMouse(e, 3, 3, {});
     31    }
     32    is(clicks, 0, "click events outside border with radius");
     33 
     34    clicks = 0;
     35    synthesizeMouse($("t3"), 17, 17, {});
     36    synthesizeMouse($("t4"), 17, 17, {});
     37    is(clicks, 2, "click events on border with radius");
     38    
     39    SimpleTest.finish();
     40  }
     41  </script>
     42 </head>
     43 <body onload="SimpleTest.waitForFocus(doTest, window)">
     44 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1111995">Mozilla Bug 1111995</a>
     45 <p id="display"></p>
     46 <div id="content" style="display: none">
     47 
     48 </div>
     49 <pre id="test">
     50 </pre>
     51 
     52 <input  class="click" id="t1" type=button style="width:100px; height:100px; padding:20px; border-radius:50%" value="Round button">
     53 <button class="click" id="t2"             style="width:100px; height:100px; padding:20px; border-radius:50%">Round button</button>
     54 <input  class="click" id="t3" type=button style="width:100px; height:100px; border-width:20px; border-radius:50%" value="Round button">
     55 <button class="click" id="t4"             style="width:100px; height:100px; border-width:20px; border-radius:50%">Round button</button>
     56 <input  class="click" id="t5" type=button style="width:100px; height:100px; border-radius:50%;overflow:hidden" value="Round button">
     57 <button class="click" id="t6"             style="width:100px; height:100px; border-radius:50%;overflow:hidden">Round button</button>
     58 
     59 </body>
     60 </html>