tor-browser

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

paintedlayer-recycling-7.html (1798B)


      1 <!DOCTYPE html>
      2 <html lang="en" class="reftest-wait">
      3 <meta charset="utf-8">
      4 <title>When a PaintedLayer is split up into two, the lower items should stay in their layer and the higher items should get a new one.</title>
      5 <!-- The motivation for this is that we don't ever want to assign a new layer to the canvas background just because an item is split from it. -->
      6 
      7 
      8 <style>
      9 
     10 .content {
     11  box-sizing: border-box;
     12  width: 200px;
     13  height: 200px;
     14  border: 1px solid black;
     15 }
     16 
     17 .fixed {
     18  position: fixed;
     19  top: 20px;
     20  left: 140px;
     21 }
     22 
     23 .onTopOfFixed {
     24  position: absolute;
     25  top: 120px;
     26  left: 260px;
     27 }
     28 
     29 .reftest-no-paint {
     30  border-color: lime;
     31 }
     32 
     33 .onTopOfFixed.reftest-no-paint {
     34  left: 20px;
     35 }
     36 
     37 body {
     38  margin: 0;
     39  padding: 20px;
     40  height: 3000px;
     41 }
     42 
     43 </style>
     44 
     45 <div class="fixed content">
     46  <!--
     47    This layer is just there to force .onTopOfFixed into PaintedLayers above
     48    the page background.
     49  -->
     50 </div>
     51 
     52 <div class="onTopOfFixed reftest-no-paint content">
     53  <!--
     54    This item should start out sharing a PaintedLayer with the other
     55    .onTopOfFixed item.
     56  -->
     57 </div>
     58 
     59 <div class="fixed content" id="aboutToBecomeVisible" style="visibility: hidden">
     60  <!--
     61    This layer starts out hidden. When it becomes visible, it forces the two
     62    .onTopOfFixed items into separate layers.
     63  -->
     64 </div>
     65 
     66 <div class="onTopOfFixed content">
     67  <!--
     68    This item should start out sharing a PaintedLayer with the other
     69    .onTopOfFixed item, but when the two items get split up, it should be this
     70    one that changes layers, not the other one.
     71  -->
     72 </div>
     73 
     74 <script>
     75 
     76 function doTest() {
     77  document.querySelector("#aboutToBecomeVisible").style.visibility = "visible";
     78  document.documentElement.removeAttribute("class");
     79 }
     80 document.addEventListener("MozReftestInvalidate", doTest);
     81 
     82 </script>