Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(36)

Side by Side Diff: LayoutTests/css3/calc/calc-numbers.html

Issue 920553002: Combine two validUnit calls (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add test for calc Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | LayoutTests/css3/calc/calc-numbers-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 {
22 tab-size: 12345;
23 tab-size: calc(1 + 1px);
24 }
21 </style> 25 </style>
22 <div class="default int"></div> 26 <div class="default int"></div>
23 <div class="default int-non-neg-invalid"></div> 27 <div class="default int-non-neg-invalid"></div>
24 <div class="default float"></div> 28 <div class="default float"></div>
25 <div class="default float-invalid"></div> 29 <div class="default float-invalid"></div>
26 <div class="default px-invalid"></div> 30 <div class="default px-invalid"></div>
31 <div class="default num-length-invalid"></div>
27 <script src="../../resources/js-test.js"></script> 32 <script src="../../resources/js-test.js"></script>
28 <script> 33 <script>
29 if (window.testRunner) 34 if (window.testRunner)
30 testRunner.dumpAsText(); 35 testRunner.dumpAsText();
31 36
32 function getComputedValue(selector, property) { 37 function getComputedValue(selector, property) {
33 return getComputedStyle(document.querySelector(selector))[property]; 38 return getComputedStyle(document.querySelector(selector))[property];
34 } 39 }
35 40
36 shouldBe('getComputedValue(".int", "tabSize")', '"8"'); 41 shouldBe('getComputedValue(".int", "tabSize")', '"8"');
37 shouldBe('getComputedValue(".int-non-neg-invalid", "tabSize")', '"12345"'); 42 shouldBe('getComputedValue(".int-non-neg-invalid", "tabSize")', '"12345"');
38 shouldBeCloseTo('Number(getComputedValue(".float", "opacity"))', 0.5, .0001); 43 shouldBeCloseTo('Number(getComputedValue(".float", "opacity"))', 0.5, .0001);
39 shouldBe('getComputedValue(".float-invalid", "tabSize")', '"12345"'); 44 shouldBe('getComputedValue(".float-invalid", "tabSize")', '"12345"');
40 shouldBeCloseTo('Number(getComputedValue(".px-invalid", "opacity"))', 0.9, .0001 ); 45 shouldBeCloseTo('Number(getComputedValue(".px-invalid", "opacity"))', 0.9, .0001 );
46 shouldBe('getComputedValue(".num-length-invalid", "tabSize")', '"12345"');
41 </script> 47 </script>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/css3/calc/calc-numbers-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698