tor-browser

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

inert-does-not-match-disabled-selector.html (853B)


      1 <!DOCTYPE html>
      2 <html>
      3 <head>
      4 <script src="/resources/testharness.js"></script>
      5 <script src="/resources/testharnessreport.js"></script>
      6 <style>
      7 button {
      8    color: green;
      9 }
     10 
     11 button:disabled {
     12    color: red;
     13 }
     14 
     15 .trigger-style-recalc {
     16    /* No change, we just need a new style recalculation. */
     17    font-weight:bold;
     18 }
     19 </style>
     20 </head>
     21 <body style="color: green">
     22 <button>The test passes if this is in green.</button>
     23 <dialog></dialog>
     24 <script>
     25 "use strict";
     26 test(function() {
     27    document.querySelector('dialog').showModal();
     28    var button = document.querySelector('button');
     29    button.classList.add('trigger-style-recalc');
     30    var color = document.defaultView.getComputedStyle(button).getPropertyValue('color');
     31    assert_equals(color, 'rgb(0, 128, 0)');
     32 }, "Tests inert elements do not match the :disabled selector.");
     33 </script>
     34 </body>
     35 </html>