OLD | NEW |
1 <!DOCTYPE HTML> | 1 <!DOCTYPE HTML> |
2 <style> | 2 <style> |
3 .int { | 3 .int { |
4 tab-size: calc(2 * 4); | 4 tab-size: calc(2 * 4); |
5 } | 5 } |
6 .int-non-neg-invalid { | 6 .int-non-neg-invalid { |
7 tab-size: 12345; | 7 tab-size: 12345; |
8 tab-size: calc(2 * -4); | 8 tab-size: calc(2 * -4); |
9 } | 9 } |
10 .float { | 10 .float { |
11 opacity: calc(2 / 4); | 11 opacity: calc(2 / 4); |
12 } | 12 } |
13 .float-invalid { | 13 .float-invalid { |
14 tab-size: 12345; | 14 tab-size: 12345; |
15 tab-size: calc(2 / 4); | 15 tab-size: calc(2 / 4); |
16 } | 16 } |
17 .px-invalid { | 17 .px-invalid { |
18 opacity: 0.9; | 18 opacity: 0.9; |
19 opacity: calc((2 / 4) * 1px); | 19 opacity: calc((2 / 4) * 1px); |
20 } | 20 } |
21 .num-length-invalid { | 21 .num-length-invalid { |
22 tab-size: 12345; | 22 tab-size: 12345; |
23 tab-size: calc(1 + 1px); | 23 tab-size: calc(1 + 1px); |
| 24 tab-size: calc(1 + 100%); |
| 25 tab-size: calc(100%); |
| 26 tab-size: calc(10px) bla; |
| 27 tab-size: calc(bla) 10px; |
| 28 } |
| 29 .px-valid { |
| 30 tab-size: calc(10px); |
24 } | 31 } |
25 </style> | 32 </style> |
26 <div class="default int"></div> | 33 <div class="default int"></div> |
27 <div class="default int-non-neg-invalid"></div> | 34 <div class="default int-non-neg-invalid"></div> |
28 <div class="default float"></div> | 35 <div class="default float"></div> |
29 <div class="default float-invalid"></div> | 36 <div class="default float-invalid"></div> |
30 <div class="default px-invalid"></div> | 37 <div class="default px-invalid"></div> |
31 <div class="default num-length-invalid"></div> | 38 <div class="default num-length-invalid"></div> |
| 39 <div class="default px-valid"></div> |
32 <script src="../../resources/js-test.js"></script> | 40 <script src="../../resources/js-test.js"></script> |
33 <script> | 41 <script> |
34 if (window.testRunner) | 42 if (window.testRunner) |
35 testRunner.dumpAsText(); | 43 testRunner.dumpAsText(); |
36 | 44 |
37 function getComputedValue(selector, property) { | 45 function getComputedValue(selector, property) { |
38 return getComputedStyle(document.querySelector(selector))[property]; | 46 return getComputedStyle(document.querySelector(selector))[property]; |
39 } | 47 } |
40 | 48 |
41 shouldBe('getComputedValue(".int", "tabSize")', '"8"'); | 49 shouldBe('getComputedValue(".int", "tabSize")', '"8"'); |
42 shouldBe('getComputedValue(".int-non-neg-invalid", "tabSize")', '"12345"'); | 50 shouldBe('getComputedValue(".int-non-neg-invalid", "tabSize")', '"12345"'); |
43 shouldBeCloseTo('Number(getComputedValue(".float", "opacity"))', 0.5, .0001); | 51 shouldBeCloseTo('Number(getComputedValue(".float", "opacity"))', 0.5, .0001); |
44 shouldBe('getComputedValue(".float-invalid", "tabSize")', '"12345"'); | 52 shouldBe('getComputedValue(".float-invalid", "tabSize")', '"12345"'); |
45 shouldBeCloseTo('Number(getComputedValue(".px-invalid", "opacity"))', 0.9, .0001
); | 53 shouldBeCloseTo('Number(getComputedValue(".px-invalid", "opacity"))', 0.9, .0001
); |
46 shouldBe('getComputedValue(".num-length-invalid", "tabSize")', '"12345"'); | 54 shouldBe('getComputedValue(".num-length-invalid", "tabSize")', '"12345"'); |
| 55 shouldBe('getComputedValue(".px-valid", "tabSize")', '"10px"'); |
47 </script> | 56 </script> |
OLD | NEW |