tor-browser

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

revert-val-011.html (936B)


      1 <!DOCTYPE html>
      2 <html>
      3 <head>
      4  <meta charset="utf-8">
      5  <title>CSS Cascade: 'revert' from mutating inline style</title>
      6  <link rel="help" href="https://drafts.csswg.org/css-cascade/#default">
      7  <link rel="author" href="mailto:sesse@chromium.org">
      8  <script src="/resources/testharness.js"></script>
      9  <script src="/resources/testharnessreport.js"></script>
     10  <style>
     11    .outer {
     12       left: 1px;
     13    }
     14  </style>
     15 </head>
     16 <body>
     17  <p class="outer" id="el">Test passes if the text is black (not red).</p>
     18 </body>
     19 <script>
     20 test(() => {
     21  el.offsetTop;
     22  assert_equals(getComputedStyle(el).left, "1px", "style is set correctly");
     23 });
     24 test(() => {
     25  el.offsetTop;
     26  el.style.left = "2px";
     27  assert_equals(getComputedStyle(el).left, "2px", "style is modified correctly");
     28 });
     29 test(() => {
     30  el.offsetTop;
     31  el.style.left = "revert";
     32  assert_equals(getComputedStyle(el).left, "auto", "style is reverted correctly");
     33 });
     34 </script>
     35 </html>