tor-browser

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

idlharness.html (2619B)


      1 <!doctype html>
      2 <meta charset=utf-8>
      3 <!-- WARNING: These tests are preliminary and probably partly incorrect.  -->
      4 <title>CSSOM automated IDL tests</title>
      5 <link rel="author" title="Ms2ger" href="mailto:Ms2ger@gmail.com">
      6 <link rel="help" href="https://drafts.csswg.org/cssom-1/#idl-index">
      7 <meta name="timeout" content="long">
      8 <script src=/resources/testharness.js></script>
      9 <script src=/resources/testharnessreport.js></script>
     10 <script src=/resources/WebIDLParser.js></script>
     11 <script src=/resources/idlharness.js></script>
     12 <!--
     13 Provide some objects to test.
     14 Use a non-empty style attribute to get a non-empty CSSStyleDeclaration.
     15 -->
     16 <style id="styleElement" style="z-index: 0;">
     17 @import url("data:text/css,");
     18 @namespace x "y";
     19 @page { @top-left {} }
     20 @media all {}
     21 #test { color: green; }
     22 </style>
     23 
     24 <svg id="svgElement" style="height: 0;"></svg>
     25 
     26 <iframe id="xmlssPiIframe" src="support/xmlss-pi.xhtml" style="display: none;"></iframe>
     27 
     28 <h1>CSSOM IDL tests</h1>
     29 <div id=log></div>
     30 
     31 <script>
     32 'use strict';
     33 
     34 const waitForLoad = new Promise(r => { addEventListener('load', r); });
     35 
     36 idl_test(
     37  ['cssom'],
     38  ['SVG', 'uievents', 'html', 'dom', 'mathml-core'],
     39  async idlArray => {
     40    idlArray.add_objects({
     41      Document: ['document', 'new Document()'],
     42      StyleSheetList: ['document.styleSheets'],
     43      CSSStyleSheet: ['sheet'],
     44      MediaList: ['sheet.media'],
     45      CSSRuleList: ['sheet.cssRules'],
     46      CSSImportRule: ['sheet.cssRules[0]'],
     47      CSSNamespaceRule: ['sheet.cssRules[1]'],
     48      CSSPageRule: ['sheet.cssRules[2]'],
     49      CSSMarginRule: ['sheet.cssRules[2].cssRules[0]'],
     50      CSSMediaRule: ['sheet.cssRules[3]'],
     51      CSSStyleRule: ['sheet.cssRules[4]'],
     52      CSSStyleProperties: [
     53        'sheet.cssRules[4].style', // CSSStyleRule
     54        'sheet.cssRules[2].cssRules[0].style', // CSSMarginRule
     55        'style_element.style', // ElementCSSInlineStyle for HTMLElement
     56        'svg_element.style', // ElementCSSInlineStyle for SVGElement
     57        'getComputedStyle(svg_element)'
     58      ],
     59      CSSPageDescriptors: [
     60        'sheet.cssRules[2].style', // CSSPageRule
     61      ],
     62      ProcessingInstruction: ['xmlss_pi'],
     63      Window: ['window'],
     64      HTMLElement: [
     65        'style_element',
     66        'document.createElement("unknownelement")'
     67      ],
     68      SVGElement: ['svg_element'],
     69    });
     70 
     71    await waitForLoad;
     72    self.style_element = document.getElementById('styleElement');
     73    self.sheet = style_element.sheet;
     74    self.svg_element = document.getElementById('svgElement');
     75    self.xmlss_pi = document.getElementById('xmlssPiIframe').contentDocument.firstChild;
     76  }
     77 );
     78 
     79 </script>