tor-browser

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

idlharness.html (1230B)


      1 <!doctype html>
      2 <title>CSS Cascade IDL tests</title>
      3 <link rel="help" href="https://drafts.csswg.org/css-cascade-5/#layer-apis">
      4 <link rel="help" href="https://drafts.csswg.org/css-cascade-6/#scoped-styles">
      5 <script src="/resources/testharness.js"></script>
      6 <script src="/resources/testharnessreport.js"></script>
      7 <script src="/resources/WebIDLParser.js"></script>
      8 <script src="/resources/idlharness.js"></script>
      9 
     10 <style>
     11 @layer bar, baz;
     12 @import url('data:text/css,') layer(qux);
     13 @layer foo { }
     14 @scope (div) to (span) { }
     15 </style>
     16 
     17 <script>
     18  'use strict';
     19  idl_test(
     20    ['css-cascade', 'css-cascade-6'],
     21    ['cssom'],
     22    idl_array => {
     23      try {
     24        self.statement = document.styleSheets[0].cssRules.item(0);
     25        self.layeredImport = document.styleSheets[0].cssRules.item(1);
     26        self.block = document.styleSheets[0].cssRules.item(2);
     27        self.scope = document.styleSheets[0].cssRules.item(3);
     28      } catch (e) {
     29        // Will be surfaced when any rule is undefined below.
     30      }
     31 
     32      idl_array.add_objects({
     33        CSSLayerBlockRule: ['block'],
     34        CSSLayerStatementRule: ['statement'],
     35        CSSImportRule: ['layeredImport'],
     36        CSSScopeRule: ['scope'],
     37      });
     38    }
     39  );
     40 </script>