test_bug841361.html (1524B)
1 <!DOCTYPE HTML> 2 <html> 3 <!-- 4 https://bugzilla.mozilla.org/show_bug.cgi?id=841361 5 --> 6 <head> 7 <title>Test for Bug 841361</title> 8 <script src="/tests/SimpleTest/SimpleTest.js"></script> 9 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> 10 </head> 11 <body> 12 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=841361">Mozilla Bug 841361</a> 13 <p id="display"> 14 15 <div style="width:500px; height:0;" id="a"></div> 16 17 <div style="width:0; height:500px;" id="b"></div> 18 19 <div style="width:500px;" id="c"> 20 <div style="width:50px; height:50px; float:left; background:yellow"></div> 21 <div style="width:200px; height:50px; float:left; background:green"></div> 22 </div> 23 24 <div style="width:500px; height:0; overflow:hidden" id="d"></div> 25 26 <div style="width:0; height:500px; overflow:hidden" id="e"></div> 27 28 <div style="width:500px; overflow:hidden" id="f"> 29 <div style="width:50px; height:50px; float:left; background:yellow"></div> 30 <div style="width:200px; height:50px; float:left; background:green"></div> 31 </div> 32 33 </p> 34 <div id="content" style="display: none"> 35 36 </div> 37 <pre id="test"> 38 <script class="testbody" type="text/javascript"> 39 40 function doTest(id, w, h) { 41 var e = document.getElementById(id); 42 is(e.scrollWidth, w, "scrollWidth for element '" + id + "'"); 43 is(e.scrollHeight, h, "scrollHeight for element '" + id + "'"); 44 } 45 46 doTest("a", 500, 0); 47 doTest("b", 0, 500); 48 doTest("c", 500, 50); 49 doTest("d", 500, 0); 50 doTest("e", 0, 500); 51 doTest("f", 500, 50); 52 53 </script> 54 </pre> 55 </body> 56 </html>