Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / css3 / calc / calc-numbers.html
blob1bb61ed0e42635fdb3b3e2885a3a17c60e98585f
1 <!DOCTYPE HTML>
2 <style>
3 .int {
4 tab-size: calc(2 * 4);
6 .int-non-neg-invalid {
7 tab-size: 12345;
8 tab-size: calc(2 * -4);
10 .float {
11 opacity: calc(2 / 4);
13 .float-invalid {
14 tab-size: 12345;
15 tab-size: calc(2 / 4);
17 .px-invalid {
18 opacity: 0.9;
19 opacity: calc((2 / 4) * 1px);
21 .num-length-invalid {
22 tab-size: 12345;
23 tab-size: calc(1 + 1px);
25 </style>
26 <div class="default int"></div>
27 <div class="default int-non-neg-invalid"></div>
28 <div class="default float"></div>
29 <div class="default float-invalid"></div>
30 <div class="default px-invalid"></div>
31 <div class="default num-length-invalid"></div>
32 <script src="../../resources/js-test.js"></script>
33 <script>
34 if (window.testRunner)
35 testRunner.dumpAsText();
37 function getComputedValue(selector, property) {
38 return getComputedStyle(document.querySelector(selector))[property];
41 shouldBe('getComputedValue(".int", "tabSize")', '"8"');
42 shouldBe('getComputedValue(".int-non-neg-invalid", "tabSize")', '"12345"');
43 shouldBeCloseTo('Number(getComputedValue(".float", "opacity"))', 0.5, .0001);
44 shouldBe('getComputedValue(".float-invalid", "tabSize")', '"12345"');
45 shouldBeCloseTo('Number(getComputedValue(".px-invalid", "opacity"))', 0.9, .0001);
46 shouldBe('getComputedValue(".num-length-invalid", "tabSize")', '"12345"');
47 </script>