Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /css/css-values/minmax-number-computed.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<link rel="author" title="Xiaocheng Hu" href="mailto:xiaochengh@chromium.org">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../support/numeric-testcommon.js"></script>
<div id="target"></div>
<script>
// Identity tests
test_math_used('min(1)', '1', {type:'number'});
test_math_used('max(1)', '1', {type:'number'});
// Nestings
test_math_used('min(0.2, max(0.1, 0.15))', '0.15', {type:'number'});
test_math_used('max(0.1, min(0.2, 0.15))', '0.15', {type:'number'});
// General calculations
test_math_used('calc(min(0.1, 0.2) + 0.05)', '0.15', {type:'number'});
test_math_used('calc(min(0.1, 0.2) - 0.05)', '0.05', {type:'number'});
test_math_used('calc(min(0.1, 0.2) * 2)', '0.2', {type:'number'});
test_math_used('calc(min(0.1, 0.2) / 2)', '0.05', {type:'number'});
test_math_used('calc(max(0.1, 0.2) + 0.05)', '0.25', {type:'number'});
test_math_used('calc(max(0.1, 0.2) - 0.05)', '0.15', {type:'number'});
test_math_used('calc(max(0.1, 0.2) * 2)', '0.4', {type:'number'});
test_math_used('calc(max(0.1, 0.2) / 2)', '0.1', {type:'number'});
test_math_used('calc(min(0.1, 0.2) + max(0.1, 0.05))', '0.2', {type:'number'});
test_math_used('calc(min(0.1, 0.2) - max(0.1, 0.05))', '0', {type:'number'});
</script>