Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / css3 / calc / table-calcs.html
blob304c22c1ca04292ddab296f4b5b5de27c5dc8512
1 <!DOCTYPE HTML>
2 <script src="../../resources/js-test.js"></script>
3 <style>
4 table {
5 border-spacing: 0px;
8 .width-test {
9 padding: 0px;
10 width: 256px;
11 height: 100px;
14 .width-percent-test {
15 padding: 0;
16 height: 100px;
19 .height-test {
20 padding: 0;
21 width: 100px;
22 height: 256px;
25 .height-percent-test {
26 padding: 0;
27 width: 100px;
29 </style>
30 <div id="test">
31 <table><tr><td class="width-test" style="width: 100px;">control width:100px</td></tr></table>
32 <table><tr><td class="width-test" style="width: calc(100px);">simple 100px</td></tr></table>
33 <table><tr><td class="width-test" style="width: calc(25px * 4);">25px * 4</td></tr></table>
34 <table><tr><td class="height-test" style="height: 100px;">control height:100px</td></tr></table>
35 <table><tr><td class="height-test" style="height: calc(100px);">simple 100px</td></tr></table>
36 <table><tr><td class="height-test" style="height: calc(25px * 4);">25px * 4</td></tr></table>
37 <div style="width:400px;">
38 <table><tr><td class="width-percent-test" style="width: 25%;">control width:25%</td><td class="dummy"/></tr></table>
39 <table><tr><td class="width-percent-test" style="width: calc(25%);">simple calc(25%)</td><td class="dummy"/></tr></table>
40 <table><tr><td class="width-percent-test" style="width: calc(10% * 2 + 5%);">calc(10% * 2 + 5%)</td><td class="dummy"/></tr></table>
41 </div>
42 <div style="height: 400px">
43 <table style="height: 25%"><tr><td class="height-percent-test">control height:25%</td></tr></table>
44 </div>
45 <div style="height: 400px">
46 <table style="height: calc(25%);"><tr><td class="height-percent-test">simple calc(25%)</td></tr></table>
47 </div>
48 <div style="height: 400px">
49 <table style="height: calc(10% * 2 + 5%);"><tr><td class="height-percent-test">calc(10% * 2 + 5%)</td></tr></table>
50 </div>
51 </div>
52 <script>
53 description("Tests that CSS3 calc() can be used in tables");
55 var cells = document.getElementById("test").getElementsByTagName("td");
56 for (var i = 0; i < cells.length; ++i) {
57 var cell = cells[i];
58 if (cell.className == 'dummy')
59 continue;
60 var width = cell.offsetWidth;
61 var height = cell.offsetHeight;
63 shouldEvaluateTo("cell.offsetWidth", 100);
64 shouldEvaluateTo("cell.offsetHeight", 100);
66 var error = [];
67 if (width != 100)
68 error.push("width was not 100");
69 if (height != 100)
70 error.push("height was not 100");
72 if (error == "") {
73 cell.style.backgroundColor = "green";
74 cell.innerHTML += " => PASS";
75 } else {
76 cell.style.backgroundColor = "red";
77 cell.innerHTML += " => FAIL: " + error.join(", ");
80 if (window.testRunner)
81 document.body.removeChild(document.getElementById("test"));
82 </script>