summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-values/minmax-percentage-computed.html
blob: fbdad71fcd0e109bd3ba2d147f35cf182a0361d1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<!DOCTYPE html>
<link rel="help" href="https://drafts.csswg.org/css-values-4/#comp-func">
<link rel="help" href="https://drafts.csswg.org/css-values-4/#percentages">
<link rel="help" href="https://drafts.csswg.org/css-values-4/#calc-type-checking">
<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="container" style="width: 400px">
  <div id="target"></div>
</div>
<script>

// Identity tests
test_math_used('min(1%)', '1%');
test_math_used('max(1%)', '1%');

// Nestings
test_math_used('min(20%, max(10%, 15%))', '15%');
test_math_used('max(10%, min(20%, 15%))', '15%');

// General calculations
test_math_used('calc(min(10%, 20%) + 5%)', '15%');
test_math_used('calc(min(10%, 20%) - 5%)', '5%');
test_math_used('calc(min(10%, 20%) * 2)', '20%');
test_math_used('calc(min(10%, 20%) / 2)', '5%');
test_math_used('calc(max(10%, 20%) + 5%)', '25%');
test_math_used('calc(max(10%, 20%) - 5%)', '15%');
test_math_used('calc(max(10%, 20%) * 2)', '40%');
test_math_used('calc(max(10%, 20%) / 2)', '10%');
test_math_used('calc(min(10%, 20%) + max(10%, 5%))', '20%');
test_math_used('calc(min(11%, 20%) - max(10%, 5%))', '1%');
</script>