tor-browser

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

exp-log-serialize.html (1318B)


      1 <!DOCTYPE html>
      2 <link rel="help" href="https://drafts.csswg.org/css-values-4/#exponent-funcs">
      3 <link rel="help" href="https://drafts.csswg.org/css-values-4/#numbers">
      4 <link rel="help" href="https://drafts.csswg.org/css-values-4/#calc-serialize">
      5 <link rel="author" title="Apple Inc">
      6 <script src="/resources/testharness.js"></script>
      7 <script src="/resources/testharnessreport.js"></script>
      8 <script src="../support/serialize-testcommon.js"></script>
      9 <div id=target></div>
     10 <script>
     11 function test_serialization(t,s,c) {
     12    test_specified_serialization('opacity', t, s);
     13    test_specified_serialization('transform', `scale(${t})`, `scale(${s})`);
     14    test_computed_serialization('opacity', t, c);
     15    test_computed_serialization('transform', `scale(${t})`, `matrix(${c}, 0, 0, ${c}, 0, 0)`);
     16 }
     17 
     18 test_serialization(
     19    'exp(0)',
     20    'calc(1)',
     21    '1');
     22 test_serialization(
     23    'log(1)',
     24    'calc(0)',
     25    '0');
     26 
     27 test_serialization(
     28    'calc(exp(0) + log(1) + log(1))',
     29    'calc(1)',
     30    '1');
     31 
     32 test_serialization(
     33    'calc(log(1) + 0.5)',
     34    'calc(0.5)',
     35    '0.5');
     36 
     37 const t = 'calc(log(0))';
     38 const s = 'calc(-infinity)';
     39 const c = '0';
     40 test_specified_serialization('opacity', t, s);
     41 test_specified_serialization('transform', `scale(${t})`, `scale(${s})`);
     42 test_computed_serialization('opacity', t, c);
     43 </script>