tor-browser

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

minmax-integer-computed.html (1183B)


      1 <!DOCTYPE html>
      2 <link rel="help" href="https://drafts.csswg.org/css-values-4/#comp-func">
      3 <link rel="help" href="https://drafts.csswg.org/css-values-4/#integers">
      4 <link rel="help" href="https://drafts.csswg.org/css-values-4/#calc-range">
      5 <link rel="author" title="Xiaocheng Hu" href="mailto:xiaochengh@chromium.org">
      6 <script src="/resources/testharness.js"></script>
      7 <script src="/resources/testharnessreport.js"></script>
      8 <script src="../support/numeric-testcommon.js"></script>
      9 <div id="target"></div>
     10 <script>
     11 function test_integer_equals(value, expected) {
     12  test_math_used(value, expected,
     13    {base: '123',
     14     prop: 'z-index'}
     15  );
     16 }
     17 
     18 // Identity tests
     19 test_integer_equals('min(1)', '1');
     20 test_integer_equals('max(1)', '1');
     21 
     22 // Rounding
     23 test_integer_equals('min(0.4)', '0');
     24 test_integer_equals('min(0.6)', '1');
     25 test_integer_equals('max(0.4)', '0');
     26 test_integer_equals('max(0.6)', '1');
     27 
     28 // Rounding and nesting
     29 test_integer_equals('min(1.1, max(0.4, 0.6))', '1');
     30 test_integer_equals('max(0.3, min(1.1, 0.4))', '0');
     31 
     32 // No rounding at intermediate steps
     33 test_integer_equals('calc(min(0.3, 0.6) * 2)', '1');
     34 test_integer_equals('calc(max(0.3, 0.6) / 2)', '0');
     35 </script>