tor-browser

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

blocking-idl-attr.html (1682B)


      1 <!DOCTYPE html>
      2 <title>Tests the 'blocking' IDL attribute on link, script and style elements</title>
      3 <script src="/resources/testharness.js"></script>
      4 <script src="/resources/testharnessreport.js"></script>
      5 <script>
      6 // Tests that the 'blocking' attribute follows the IDL:
      7 // [SameObject, PutForwards=value] readonly attribute DOMTokenList blocking;
      8 
      9 test(() => {
     10  const link = document.createElement('link');
     11  assert_true(link.blocking.supports('render'));
     12  assert_false(link.blocking.supports('asdf'));
     13 }, "Supported tokens of the 'blocking' IDL attribute of the link element");
     14 
     15 test(() => {
     16  const link = document.createElement('link');
     17  link.blocking = 'asdf';
     18  assert_equals(link.blocking.value, 'asdf');
     19 }, "Setting the 'blocking' IDL attribute of the link element");
     20 
     21 test(() => {
     22  const script = document.createElement('script');
     23  assert_true(script.blocking.supports('render'));
     24  assert_false(script.blocking.supports('asdf'));
     25 }, "Supported tokens of the 'blocking' IDL attribute of the script element");
     26 
     27 test(() => {
     28  const script = document.createElement('script');
     29  script.blocking = 'asdf';
     30  assert_equals(script.blocking.value, 'asdf');
     31 }, "Setting the 'blocking' IDL attribute of the script element");
     32 
     33 test(() => {
     34  const style = document.createElement('style');
     35  assert_true(style.blocking.supports('render'));
     36  assert_false(style.blocking.supports('asdf'));
     37 }, "Supported tokens of the 'blocking' IDL attribute of the style element");
     38 
     39 test(() => {
     40  const style = document.createElement('style');
     41  style.blocking = 'asdf';
     42  assert_equals(style.blocking.value, 'asdf');
     43 }, "Setting the 'blocking' IDL attribute of the style element");
     44 </script>