tor-browser

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

hypot-pow-sqrt-serialize.html (1303B)


      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(calc(${c}))`);
     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    'pow(1,1)',
     20    'calc(1)',
     21    '1');
     22 test_serialization(
     23    'hypot(1)',
     24    'calc(1)',
     25    '1');
     26 test_serialization(
     27    'sqrt(1)',
     28    'calc(1)',
     29    '1');
     30 
     31 test_serialization(
     32    'calc(pow(1,1) - 0.5)',
     33    'calc(0.5)',
     34    '0.5');
     35 test_serialization(
     36    'calc(hypot(1) * 0.5)',
     37    'calc(0.5)',
     38    '0.5');
     39 test_serialization(
     40    'calc(sqrt(1) - 1)',
     41    'calc(0)',
     42    '0');
     43 
     44 test_specified_serialization('letter-spacing', 'hypot(2px, 40%)', 'hypot(2px, 40%)');
     45 </script>