tor-browser

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

position-absolute-chrome-bug-002.html (961B)


      1 <!DOCTYPE html>
      2 <link rel="author" href="mailto:atotic@google.com">
      3 <script src="/resources/testharness.js"></script>
      4 <script src="/resources/testharnessreport.js"></script>
      5 <link rel="help" href="https://crbug.com/970166">
      6 <meta name="assert" content="simplified layout calculates correct abspos position with floats">
      7 <style>
      8 
      9 #container {
     10  position: relative;
     11  background: gray;
     12 }
     13 #container::after {
     14  content: '';
     15  display: table;
     16  clear:both;
     17 }
     18 #target {
     19  position: absolute;
     20  right: 0;
     21  background: green;
     22 }
     23 </style>
     24 <div id="container">
     25  <div style="float:left">floatleft</div>
     26  <div id="target">
     27    <div>text</div>
     28    <div id="toggle">toggle</div>
     29  </div>
     30 </div>
     31 <script>
     32 test(() => {
     33  document.body.offsetTop;
     34  let el = document.querySelector("#toggle");
     35  el.style.display = "none";
     36  document.body.offsetTop;
     37  assert_equals(document.querySelector("#target").offsetTop, 0);
     38 }, '#target position is recalculated correctly.');
     39 </script>