summaryrefslogtreecommitdiffstats
path: root/dom/tests/mochitest/general/test_bug861217.html
blob: 157487d9272b180287b6466f34a952d2a8fbce29 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=861217
-->
<head>
  <title>Test for Bug 861217</title>
  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css">
</head>
<body onload="runTest()">
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=861217">Mozilla Bug 861217</a>
<p id="display"></p>
<div id="content">
  <table border="0" cellpadding="0" cellspacing="0" style="table-layout: fixed; width: 50px">
    <tbody>
      <tr>
        <td id="tableCell1" style="overflow: hidden"><div style="width: 100px; height: 100px; background-color: DodgerBlue">1</div></td>
      </tr>
      <tr>
        <td id="tableCell2" style="overflow: hidden"><div style="margin-top: 5px; margin-left: 7px; width: 100px; height: 100px; background-color: SkyBlue">2</div></td>
      </tr>
      <tr>
        <td id="tableCell3" style="overflow: hidden"><div style="display: inline-block; margin-right: 8px; margin-bottom: 10px; width: 100px; height: 100px; background-color: Khaki">3</div></td>
      </tr>
      <tr>
        <td id="tableCell4" style="overflow: hidden"><div style="display: inline-block; margin-right: 3px; margin-left: 1px; box-sizing: border-box; width: 100px; height: 100px; border-left: 6px solid black; border-bottom: 2px solid black; background-color: LightCoral">4</div></td>
      </tr>
      <tr>
        <td id="tableCell5" style="overflow: hidden"><div style="display: inline-block; border-right: 9px solid black; width: 100px; height: 100px; background-color: LightSeaGreen">5</div></td>
      </tr>
      <tr>
        <td id="tableCell6" style="overflow: hidden"><div style="box-sizing: border-box; width: 100px; height: 100px; padding-top: 3px; padding-right: 13px; background-color: Orange">6</div></td>
      </tr>
      <tr>
        <td id="tableCell7" style="overflow: hidden"><div style="display: inline-block; margin-right: 11px; margin-left: 4px; box-sizing: border-box; width: 100px; height: 100px; border-right: 6px solid black; border-bottom: 8px solid black; padding-top: 5px; padding-right: 9px; padding-bottom: 8px; padding-left: 7px; background-color: Silver">7</div></td>
      </tr>
      <tr>
        <td id="tableCell8" style="overflow: hidden"><div style="display: inline-block; margin-top: 7px; margin-bottom: 1px; border-right: 6px solid black; border-bottom: 8px solid black; padding-top: 5px; padding-right: 9px; padding-bottom: 8px; padding-left: 7px; width: 100px; height: 100px; background-color: Turquoise">8</div></td>
      </tr>
    </tbody>
  </table>
  <div id="status" style="display: none"></div>
</div>
<pre id="test">
<script class="testbody" type="text/javascript">

SimpleTest.waitForExplicitFinish();

/** Test for Bug 861217 **/
function runTest() {
  var tableCell1 = document.getElementById("tableCell1"),
      bcr1 = tableCell1.getBoundingClientRect(),
      tableCell2 = document.getElementById("tableCell2"),
      bcr2 = tableCell2.getBoundingClientRect(),
      tableCell3 = document.getElementById("tableCell3"),
      bcr3 = tableCell3.getBoundingClientRect(),
      tableCell4 = document.getElementById("tableCell4"),
      bcr4 = tableCell4.getBoundingClientRect(),
      tableCell5 = document.getElementById("tableCell5"),
      bcr5 = tableCell5.getBoundingClientRect(),
      tableCell6 = document.getElementById("tableCell6"),
      bcr6 = tableCell6.getBoundingClientRect(),
      tableCell7 = document.getElementById("tableCell7"),
      bcr7 = tableCell7.getBoundingClientRect(),
      tableCell8 = document.getElementById("tableCell8"),
      bcr8 = tableCell8.getBoundingClientRect();

  is(bcr1.width, 50, "Width of bounding client rect of #tableCell1");
  is(tableCell1.scrollWidth, 100, "scrollWidth of #tableCell1");
  is(bcr1.height, 100, "Height of bounding client rect of #tableCell1");
  is(tableCell1.scrollHeight, 100, "scrollHeight of #tableCell1");

  is(bcr2.width, 50, "Width of bounding client rect of #tableCell2");
  is(tableCell2.scrollWidth, 107, "scrollWidth of #tableCell2");
  is(bcr2.height, 105, "Height of bounding client rect of #tableCell2");
  is(tableCell2.scrollHeight, 105, "scrollHeight of #tableCell2");

  is(bcr3.width, 50, "Width of bounding client rect of #tableCell3");
  is(tableCell3.scrollWidth, 108, "scrollWidth of #tableCell3");
  is(bcr3.height, 110, "Height of bounding client rect of #tableCell3");
  is(tableCell3.scrollHeight, 110, "scrollHeight of #tableCell3");

  is(bcr4.width, 50, "Width of bounding client rect of #tableCell4");
  is(tableCell4.scrollWidth, 104, "scrollWidth of #tableCell4");
  is(bcr4.height, 100, "Height of bounding client rect of #tableCell4");
  is(tableCell4.scrollHeight, 100, "scrollHeight of #tableCell4");

  is(bcr5.width, 50, "Width of bounding client rect of #tableCell5");
  is(tableCell5.scrollWidth, 109, "scrollWidth of #tableCell5");
  is(bcr5.height, 100, "Height of bounding client rect of #tableCell5");
  is(tableCell5.scrollHeight, 100, "scrollHeight of #tableCell5");

  is(bcr6.width, 50, "Width of bounding client rect of #tableCell6");
  is(tableCell6.scrollWidth, 100, "scrollWidth of #tableCell6");
  is(bcr6.height, 100, "Height of bounding client rect of #tableCell6");
  is(tableCell6.scrollHeight, 100, "scrollHeight of #tableCell6");

  is(bcr7.width, 50, "Width of bounding client rect of #tableCell7");
  is(tableCell7.scrollWidth, 115, "scrollWidth of #tableCell7");
  is(bcr7.height, 100, "Height of bounding client rect of #tableCell7");
  is(tableCell7.scrollHeight, 100, "scrollHeight of #tableCell7");

  is(bcr8.width, 50, "Width of bounding client rect of #tableCell8");
  is(tableCell8.scrollWidth, 122, "scrollWidth of #tableCell8");
  is(bcr8.height, 129, "Height of bounding client rect of #tableCell8");
  is(tableCell8.scrollHeight, 129, "scrollHeight of #tableCell8");

  SimpleTest.finish();
}

</script>
</pre>
</body>
</html>