tor-browser

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

helper_hittest_backface_hidden.html (1691B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <head>
      4  <title>APZ hit-testing with backface-visibility:hidden</title>
      5  <script type="application/javascript" src="apz_test_utils.js"></script>
      6  <script type="application/javascript" src="apz_test_native_event_utils.js"></script>
      7  <script src="/tests/SimpleTest/paint_listener.js"></script>
      8  <meta name="viewport" content="width=device-width"/>
      9  <style>
     10    body,html{
     11      height: 100%;
     12    }
     13    body{
     14      margin: 0;
     15      transform-style: preserve-3d;
     16    }
     17    #back, #front{
     18      backface-visibility: hidden;
     19      position: absolute;
     20      width: 100%;
     21      height: 100%
     22    }
     23    #front{
     24      overflow-y:auto;
     25    }
     26    #content{
     27      width: 100%;
     28      height: 200%;
     29      background: linear-gradient(blue, green);
     30    }
     31    #back{
     32      transform: rotateY(180deg);
     33    }
     34  </style>
     35 </head>
     36 <body>
     37  <div id="front">
     38    <div id="content"></div>
     39  </div>
     40  <div id="back"></div></body>
     41 <script type="application/javascript">
     42 
     43 async function test() {
     44  var config = getHitTestConfig();
     45 
     46  var subframe = document.getElementById("front");
     47 
     48  // Set a displayport to ensure the subframe is layerized.
     49  // This is not required for exercising the behavior we want to test,
     50  // but it's needed to be able to assert the results reliably.
     51  config.utils.setDisplayPortForElement(0, 0, 1000, 1000, subframe, 1);
     52  await promiseApzFlushedRepaints();
     53 
     54  var subframeViewId = config.utils.getViewId(subframe);
     55 
     56  var {scrollId} = hitTest(centerOf(subframe));
     57 
     58  is(scrollId, subframeViewId,
     59     "hit the scroll frame behind the backface-visibility:hidden element");
     60 }
     61 
     62 waitUntilApzStable()
     63 .then(test)
     64 .then(subtestDone, subtestFailed);
     65 
     66 </script>
     67 </html>