1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/tests/mochitest/general/test_bug861217.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,115 @@ 1.4 +<!DOCTYPE HTML> 1.5 +<html> 1.6 +<!-- 1.7 +https://bugzilla.mozilla.org/show_bug.cgi?id=861217 1.8 +--> 1.9 +<head> 1.10 + <title>Test for Bug 861217</title> 1.11 + <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> 1.12 + <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"> 1.13 +</head> 1.14 +<body onload="runTest()"> 1.15 +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=861217">Mozilla Bug 861217</a> 1.16 +<p id="display"></p> 1.17 +<div id="content"> 1.18 + <table border="0" cellpadding="0" cellspacing="0" style="table-layout: fixed; width: 50px"> 1.19 + <tbody> 1.20 + <tr> 1.21 + <td id="tableCell1" style="overflow: hidden"><div style="width: 100px; height: 100px; background-color: DodgerBlue">1</div></td> 1.22 + </tr> 1.23 + <tr> 1.24 + <td id="tableCell2" style="overflow: hidden"><div style="margin-top: 5px; margin-left: 7px; width: 100px; height: 100px; background-color: SkyBlue">2</div></td> 1.25 + </tr> 1.26 + <tr> 1.27 + <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> 1.28 + </tr> 1.29 + <tr> 1.30 + <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> 1.31 + </tr> 1.32 + <tr> 1.33 + <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> 1.34 + </tr> 1.35 + <tr> 1.36 + <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> 1.37 + </tr> 1.38 + <tr> 1.39 + <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> 1.40 + </tr> 1.41 + <tr> 1.42 + <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> 1.43 + </tr> 1.44 + </tbody> 1.45 + </table> 1.46 + <div id="status" style="display: none"></div> 1.47 +</div> 1.48 +<pre id="test"> 1.49 +<script class="testbody" type="text/javascript"> 1.50 + 1.51 +SimpleTest.waitForExplicitFinish(); 1.52 + 1.53 +/** Test for Bug 861217 **/ 1.54 +function runTest() { 1.55 + var tableCell1 = document.getElementById("tableCell1"), 1.56 + bcr1 = tableCell1.getBoundingClientRect(), 1.57 + tableCell2 = document.getElementById("tableCell2"), 1.58 + bcr2 = tableCell2.getBoundingClientRect(), 1.59 + tableCell3 = document.getElementById("tableCell3"), 1.60 + bcr3 = tableCell3.getBoundingClientRect(), 1.61 + tableCell4 = document.getElementById("tableCell4"), 1.62 + bcr4 = tableCell4.getBoundingClientRect(), 1.63 + tableCell5 = document.getElementById("tableCell5"), 1.64 + bcr5 = tableCell5.getBoundingClientRect(), 1.65 + tableCell6 = document.getElementById("tableCell6"), 1.66 + bcr6 = tableCell6.getBoundingClientRect(), 1.67 + tableCell7 = document.getElementById("tableCell7"), 1.68 + bcr7 = tableCell7.getBoundingClientRect(), 1.69 + tableCell8 = document.getElementById("tableCell8"), 1.70 + bcr8 = tableCell8.getBoundingClientRect(); 1.71 + 1.72 + is(bcr1.width, 50, "Width of bounding client rect of #tableCell1"); 1.73 + is(tableCell1.scrollWidth, 100, "scrollWidth of #tableCell1"); 1.74 + is(bcr1.height, 100, "Height of bounding client rect of #tableCell1"); 1.75 + is(tableCell1.scrollHeight, 100, "scrollHeight of #tableCell1"); 1.76 + 1.77 + is(bcr2.width, 50, "Width of bounding client rect of #tableCell2"); 1.78 + is(tableCell2.scrollWidth, 107, "scrollWidth of #tableCell2"); 1.79 + is(bcr2.height, 105, "Height of bounding client rect of #tableCell2"); 1.80 + is(tableCell2.scrollHeight, 105, "scrollHeight of #tableCell2"); 1.81 + 1.82 + is(bcr3.width, 50, "Width of bounding client rect of #tableCell3"); 1.83 + is(tableCell3.scrollWidth, 108, "scrollWidth of #tableCell3"); 1.84 + is(bcr3.height, 110, "Height of bounding client rect of #tableCell3"); 1.85 + is(tableCell3.scrollHeight, 110, "scrollHeight of #tableCell3"); 1.86 + 1.87 + is(bcr4.width, 50, "Width of bounding client rect of #tableCell4"); 1.88 + is(tableCell4.scrollWidth, 104, "scrollWidth of #tableCell4"); 1.89 + is(bcr4.height, 100, "Height of bounding client rect of #tableCell4"); 1.90 + is(tableCell4.scrollHeight, 100, "scrollHeight of #tableCell4"); 1.91 + 1.92 + is(bcr5.width, 50, "Width of bounding client rect of #tableCell5"); 1.93 + is(tableCell5.scrollWidth, 109, "scrollWidth of #tableCell5"); 1.94 + is(bcr5.height, 100, "Height of bounding client rect of #tableCell5"); 1.95 + is(tableCell5.scrollHeight, 100, "scrollHeight of #tableCell5"); 1.96 + 1.97 + is(bcr6.width, 50, "Width of bounding client rect of #tableCell6"); 1.98 + is(tableCell6.scrollWidth, 100, "scrollWidth of #tableCell6"); 1.99 + is(bcr6.height, 100, "Height of bounding client rect of #tableCell6"); 1.100 + is(tableCell6.scrollHeight, 100, "scrollHeight of #tableCell6"); 1.101 + 1.102 + is(bcr7.width, 50, "Width of bounding client rect of #tableCell7"); 1.103 + is(tableCell7.scrollWidth, 115, "scrollWidth of #tableCell7"); 1.104 + is(bcr7.height, 100, "Height of bounding client rect of #tableCell7"); 1.105 + is(tableCell7.scrollHeight, 100, "scrollHeight of #tableCell7"); 1.106 + 1.107 + is(bcr8.width, 50, "Width of bounding client rect of #tableCell8"); 1.108 + is(tableCell8.scrollWidth, 122, "scrollWidth of #tableCell8"); 1.109 + is(bcr8.height, 129, "Height of bounding client rect of #tableCell8"); 1.110 + is(tableCell8.scrollHeight, 129, "scrollHeight of #tableCell8"); 1.111 + 1.112 + SimpleTest.finish(); 1.113 +} 1.114 + 1.115 +</script> 1.116 +</pre> 1.117 +</body> 1.118 +</html>