|
12 | 12 | <body>
|
13 | 13 | <div id="target"></div>
|
14 | 14 | <script>
|
15 |
| -const APPROX_INFINITY = 3.35544e+07; |
16 |
| -const APPROX_NEGATIVE_INFINITY = -APPROX_INFINITY; |
| 15 | +const REALLY_LARGE = 1e6; |
| 16 | +const REALLY_LARGE_NEGATIVE = -REALLY_LARGE; |
17 | 17 |
|
18 | 18 | // For <length>
|
19 |
| -testComputedValueGreaterOrLowerThan("width", "calc(NaN * 1px)", APPROX_INFINITY); |
20 |
| -testComputedValueGreaterOrLowerThan("width", "calc(infinity * 1px)", APPROX_INFINITY); |
21 |
| -testComputedValueGreaterOrLowerThan("width", "calc(infinity * 1cm)", APPROX_INFINITY); |
22 |
| -testComputedValueGreaterOrLowerThan("width", "calc(NaN * 1rem)", APPROX_INFINITY); |
23 |
| -testComputedValueGreaterOrLowerThan("width", "calc(10.135262721212548pc - 199pt / NaN)", APPROX_INFINITY); |
| 19 | +test_computed_value("width", "calc(NaN * 1px)", "0px"); |
| 20 | +testComputedValueGreaterOrLowerThan("width", "calc(infinity * 1px)", REALLY_LARGE); |
| 21 | +testComputedValueGreaterOrLowerThan("width", "calc(infinity * 1cm)", REALLY_LARGE); |
| 22 | +test_computed_value("width", "calc(NaN * 1rem)", "0px"); |
| 23 | +test_computed_value("width", "calc(10.135262721212548pc - 199pt / NaN)", "0px"); |
24 | 24 |
|
25 |
| -testComputedValueGreaterOrLowerThan("width", "max(15px, NaN * 1px)", APPROX_INFINITY); |
26 |
| -testComputedValueGreaterOrLowerThan("width", "max(NaN * 1px, 15px)", APPROX_INFINITY); |
27 |
| -testComputedValueGreaterOrLowerThan("width", "min(15px, NaN * 1px)", APPROX_INFINITY); |
28 |
| -testComputedValueGreaterOrLowerThan("width", "min(NaN * 1px, 15px)", APPROX_INFINITY); |
| 25 | +test_computed_value("width", "max(15px, NaN * 1px)", "0px"); |
| 26 | +test_computed_value("width", "max(NaN * 1px, 15px)", "0px"); |
| 27 | +test_computed_value("width", "min(15px, NaN * 1px)", "0px"); |
| 28 | +test_computed_value("width", "min(NaN * 1px, 15px)", "0px"); |
29 | 29 |
|
30 |
| -testComputedValueGreaterOrLowerThan("width", "calc(infinity * 1px - infinity * 1%)", APPROX_INFINITY); |
31 |
| -testComputedValueGreaterOrLowerThan("width", "calc(infinity * 1px + infinity * 1%)", APPROX_INFINITY); |
32 |
| -testComputedValueGreaterOrLowerThan("width", "calc(min(NaN * 1px, infinity * 1px) + max(infinity * 1px, -infinity * 1px))", APPROX_INFINITY); |
33 |
| -testComputedValueGreaterOrLowerThan("width", "calc(infinity * 1px - max(infinity * 1%, 0%))", APPROX_INFINITY); |
| 30 | +test_computed_value("width", "calc(infinity * 1px - infinity * 1%)", "0px"); |
| 31 | +test_computed_value("width", "calc(infinity * 1px + infinity * 1%)", "0px"); |
| 32 | +test_computed_value("width", "calc(min(NaN * 1px, infinity * 1px) + max(infinity * 1px, -infinity * 1px))", "0px"); |
| 33 | +test_computed_value("width", "calc(infinity * 1px - max(infinity * 1%, 0%))", "0px"); |
34 | 34 |
|
35 |
| -testComputedValueGreaterOrLowerThan("width", "calc(max(infinity * 1px, 10px))", APPROX_INFINITY); |
| 35 | +testComputedValueGreaterOrLowerThan("width", "calc(max(infinity * 1px, 10px))", REALLY_LARGE); |
36 | 36 |
|
37 |
| -testComputedValueGreaterOrLowerThan("margin-left", "calc(-infinity * 1px)", APPROX_NEGATIVE_INFINITY); |
38 |
| -testComputedValueGreaterOrLowerThan("margin-left", "calc(min(1px, -infinity * 1%))", APPROX_NEGATIVE_INFINITY); |
| 37 | +testComputedValueGreaterOrLowerThan("margin-left", "calc(-infinity * 1px)", REALLY_LARGE_NEGATIVE); |
| 38 | +testComputedValueGreaterOrLowerThan("margin-left", "calc(min(1px, -infinity * 1%))", REALLY_LARGE_NEGATIVE); |
39 | 39 |
|
40 |
| -testComputedValueGreaterOrLowerThan("margin-left", "calc(-infinity * 1%)", APPROX_NEGATIVE_INFINITY); |
41 |
| -testComputedValueGreaterOrLowerThan("margin-left", "calc(max(10000px, 0px) + min(-infinity * 1px, infinity * 1px))", APPROX_NEGATIVE_INFINITY); |
| 40 | +testComputedValueGreaterOrLowerThan("margin-left", "calc(-infinity * 1%)", REALLY_LARGE_NEGATIVE); |
| 41 | +testComputedValueGreaterOrLowerThan("margin-left", "calc(max(10000px, 0px) + min(-infinity * 1px, infinity * 1px))", REALLY_LARGE_NEGATIVE); |
42 | 42 |
|
43 |
| -testComputedValueGreaterOrLowerThan("margin-left", "calc(-infinity * 1px - infinity * 1px)", APPROX_NEGATIVE_INFINITY); |
44 |
| -testComputedValueGreaterOrLowerThan("margin-left", "calc(min(-infinity * 1px, 10px))", APPROX_NEGATIVE_INFINITY); |
| 43 | +testComputedValueGreaterOrLowerThan("margin-left", "calc(-infinity * 1px - infinity * 1px)", REALLY_LARGE_NEGATIVE); |
| 44 | +testComputedValueGreaterOrLowerThan("margin-left", "calc(min(-infinity * 1px, 10px))", REALLY_LARGE_NEGATIVE); |
45 | 45 |
|
46 | 46 | // For <time>
|
47 |
| -testComputedValueGreaterOrLowerThan("animation-duration", "calc(NaN * 1s)", APPROX_INFINITY); |
48 |
| -testComputedValueGreaterOrLowerThan("animation-duration", "calc(infinity * 1s)", APPROX_INFINITY); |
49 |
| -testComputedValueGreaterOrLowerThan("animation-duration", "calc(1 / 0 * 1s)", APPROX_INFINITY); |
50 |
| -testComputedValueGreaterOrLowerThan("animation-duration", "calc(max(infinity * 1s, 10s)", APPROX_INFINITY); |
| 47 | +test_computed_value("animation-duration", "calc(NaN * 1s)", "0s"); |
| 48 | +testComputedValueGreaterOrLowerThan("animation-duration", "calc(infinity * 1s)", REALLY_LARGE); |
| 49 | +test_computed_value("animation-duration", "calc(1 / 0 * 1s)", "0s"); |
| 50 | +testComputedValueGreaterOrLowerThan("animation-duration", "calc(max(infinity * 1s, 10s)", REALLY_LARGE); |
51 | 51 |
|
52 |
| -testComputedValueGreaterOrLowerThan("transition-delay", "calc(-infinity* 1s)", APPROX_NEGATIVE_INFINITY); |
53 |
| -testComputedValueGreaterOrLowerThan("transition-delay", "calc(max(10000s, 0s) + min(-infinity * 1s, infinity * 1s))", APPROX_NEGATIVE_INFINITY); |
54 |
| -testComputedValueGreaterOrLowerThan("transition-delay", "calc(min(-infinity * 1s, 10s))", APPROX_NEGATIVE_INFINITY); |
| 52 | +testComputedValueGreaterOrLowerThan("transition-delay", "calc(-infinity* 1s)", REALLY_LARGE_NEGATIVE); |
| 53 | +testComputedValueGreaterOrLowerThan("transition-delay", "calc(max(10000s, 0s) + min(-infinity * 1s, infinity * 1s))", REALLY_LARGE_NEGATIVE); |
| 54 | +testComputedValueGreaterOrLowerThan("transition-delay", "calc(min(-infinity * 1s, 10s))", REALLY_LARGE_NEGATIVE); |
55 | 55 |
|
56 | 56 | // For <angle>
|
57 | 57 | testTransformValuesCloseTo("rotate(calc(infinity * 1deg))", 0.0001, "rotate(0deg)");
|
|
0 commit comments