tor-browser

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

appearance-parsing.html (1285B)


      1 <!DOCTYPE html>
      2 <html>
      3 <head>
      4  <meta charset="utf-8">
      5  <title>Parsing of `appearance`</title>
      6  <link rel="help" href="https://drafts.csswg.org/css-ui-4/#appearance-switching">
      7  <script src="/resources/testharness.js"></script>
      8  <script src="/resources/testharnessreport.js"></script>
      9 </head>
     10 <body>
     11 <script>
     12 test(function() {
     13  var input = document.createElement('input');
     14  input.setAttribute('style', 'appearance: none;');
     15 
     16  assert_equals(input.style.getPropertyValue('appearance'), 'none');
     17 }, 'parsing via attribute change steps of CSS declaration block\'s owner node');
     18 
     19 test(function() {
     20  var input = document.createElement('input');
     21  input.style.cssText = 'appearance: none;';
     22 
     23  assert_equals(input.style.getPropertyValue('appearance'), 'none');
     24 }, 'parsing via modification of cssText');
     25 
     26 test(function(t) {
     27  var style = document.createElement('style');
     28  style.appendChild(
     29    document.createTextNode('#foo { appearance: none; }')
     30  );
     31  document.body.appendChild(style);
     32  t.add_cleanup(function() {
     33    document.body.removeChild(style);
     34  });
     35 
     36  assert_equals(style.sheet.cssRules.length, 1);
     37  assert_equals(
     38    style.sheet.cssRules[0].style.getPropertyValue('appearance'),
     39    'none'
     40  );
     41 }, 'parsing via creation of CSS declaration block');
     42 </script>
     43 </body>