tor-browser

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

variable-recalc-with-initial.html (897B)


      1 <!DOCTYPE html>
      2 <head>
      3  <title>Style recalculation picks up “initial” variable declaration</title>
      4  <link rel="author" title="Steinar H. Gunderson" href="mailto:sesse@chromium.org">
      5  <link rel="help" href="https://crbug.com/1508841">
      6  <script src="/resources/testharness.js"></script>
      7  <script src="/resources/testharnessreport.js"></script>
      8  <style>
      9    .a {
     10      --color: red;
     11    }
     12    .b {
     13      --color: initial;
     14    }
     15    .c {
     16      color: var(--color, green);
     17    }
     18  </style>
     19 </head>
     20 <body>
     21  <div class="a">
     22    <div class="b">
     23      <div class="c" id="target">Test passes if this text is green.</div>
     24    </div>
     25  </div>
     26  <script>
     27    test(() => {
     28      let target = document.getElementById('target');
     29      target.offsetTop;
     30      document.body.style.pointerEvents = 'none';
     31      assert_equals(getComputedStyle(target).color, 'rgb(0, 128, 0)');
     32    });
     33  </script>
     34 </body>