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

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

Issue 1348363004: Add consumeInteger/consumeLength (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Patch for landing Created 5 years, 2 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 | third_party/WebKit/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 { 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>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/css3/calc/calc-numbers-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698