tor-browser

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

partial-prerender-translate-9.html (2830B)


      1 <!DOCTYPE html>
      2 <html reftest-async-scroll class="reftest-wait reftest-no-flush">
      3 <meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1">
      4 <!--
      5  A variant test of partial-prerender-translate-5.html but in this test the
      6  position:fixed element is inside an iframe.
      7  -->
      8 <style>
      9 html {
     10  overflow: hidden;
     11 }
     12 body {
     13  margin: 0px;
     14  padding: 0px;
     15 }
     16 </style>
     17 <iframe style="width:800px; height:1000px; border: 0"
     18        srcdoc="<!DOCTYPE HTML>
     19                <html reftest-displayport-x='0' reftest-displayport-y='0'
     20                      reftest-displayport-w='800' reftest-displayport-h='2000'
     21                      reftest-async-scroll-x='0' reftest-async-scroll-y='1000'>
     22                <style>
     23                html {
     24                  overflow-x: hidden;
     25                }
     26                html, body {
     27                  margin: 0;
     28                  padding: 0;
     29                }
     30                @keyframes anim {
     31                  to { transform: translateY(-500px); }
     32                }
     33                #target {
     34                  width: 800px;
     35                  height: 1600px;
     36                  transform: translateY(-400px);
     37                }
     38                </style>
     39                <div style='width: 800px; height: 2000px'><!-- spacer --></div>
     40                <div style='position: fixed; top: 400px'>
     41                  <div id='target'>
     42                    <!--
     43                      Put an SVG element so that the transform display item has
     44                      a blob on WebRender which means this test properly fails
     45                      without the proper fix.
     46                      -->
     47                    <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 800 1600'>
     48                      <rect fill='green' y='0'    width='800' height='1000'></rect>
     49                      <rect fill='blue'  y='1000' width='800' height='125'></rect>
     50                      <rect fill='red'   y='1125' width='800' height='875'></rect>
     51                    </svg>
     52                  </div>
     53                </div>
     54                <script>
     55                window.addEventListener('message', () => {
     56                  if (event.data == 'start') {
     57                    target.style.animation = 'anim 100s 1s step-start';
     58                    target.addEventListener('animationstart', () => {
     59                      parent.postMessage('animationstart', '*');
     60                    });
     61                  }
     62                });
     63                </script></html>">
     64 </iframe>
     65 <script>
     66 document.addEventListener("MozReftestInvalidate", () => {
     67  document.querySelector("iframe").contentWindow.postMessage("start", "*");
     68 }, { once: true });
     69 
     70 window.addEventListener("message", event => {
     71  if (event.data == "animationstart") {
     72    document.documentElement.classList.remove('reftest-wait');
     73  }
     74 });
     75 </script>
     76 </html>