tor-browser

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

ident-three-code-points.html (1754B)


      1 <!doctype html>
      2 <script src='/resources/testharness.js'></script>
      3 <script src='/resources/testharnessreport.js'></script>
      4 <title>Testing valid ident based on first three code points</title>
      5 
      6 <link rel="author" title="Greg Whitworth" href="gwhit@microsoft.com" />
      7 <link rel="help" href="https://drafts.csswg.org/css-syntax-3/#would-start-an-identifier" />
      8 <style>
      9    main div {
     10      background-color:red;
     11    }
     12 
     13    div[name=one],
     14    div[name=two] {
     15        background: green;
     16    }
     17 
     18    #1 {
     19      background-color:red;
     20    }
     21 
     22    #-2 {
     23      background-color:red;
     24    }
     25 
     26    #--3 {
     27      background-color:green;
     28    }
     29 
     30    #---4 {
     31      background-color:green;
     32    }
     33 
     34    #a {
     35      background-color:green;
     36    }
     37 
     38    #-b {
     39      background-color:green;
     40    }
     41 
     42    #--c {
     43      background-color:green;
     44    }
     45 
     46    #---d {
     47      background-color:green;
     48    }
     49 </style>
     50 <body>
     51    <main>
     52        <div id="1" class="item" name="one">test1</div>
     53        <div id="-2" class="item" name="two">test2</div>
     54        <div id="--3" class="item" name="three">test3</div>
     55        <div id="---4" class="item" name="four">test4</div>
     56 
     57        <div id="a" class="item" name="five">test A</div>
     58        <div id="-b" class="item" name="six">test B</div>
     59        <div id="--c" class="item" name="seven">test C</div>
     60        <div id="---d" class="item" name="eight">test D</div>
     61    </main>
     62 
     63    <script>
     64        var items = document.getElementsByClassName('item');
     65 
     66        for(var i=0; i < items.length; i++) {
     67            test(function() {
     68                assert_equals(window.getComputedStyle(items[i]).getPropertyValue('background-color'), "rgb(0, 128, 0)");
     69            }, items[i].getAttribute('name') + " should be green");
     70        }
     71    </script>
     72 </body>
     73 </html>