andersca | 772807839 | 2007-04-03 21:39:53 | [diff] [blame] | 1 | <html> |
| 2 | <head> |
| 3 | <script> |
| 4 | function debug(str) { |
| 5 | pre = document.getElementById('console'); |
| 6 | pre.appendChild(document.createTextNode(str + '\n')); |
| 7 | } |
| 8 | |
| 9 | function runTests() { |
[email protected] | ebff986b | 2012-06-20 03:28:42 | [diff] [blame] | 10 | if (window.testRunner) |
| 11 | testRunner.dumpAsText(); |
andersca | 772807839 | 2007-04-03 21:39:53 | [diff] [blame] | 12 | |
| 13 | if (document.body.clientWidth != window.innerWidth || |
| 14 | document.body.clientHeight != window.innerHeight) { |
| 15 | debug("FAILURE!") |
| 16 | return; |
| 17 | } |
| 18 | |
| 19 | // Now force scroll bars. innerWidth and innerHeight should not take the scroll bar into account |
| 20 | // but clientWidth and clientHeight should. |
| 21 | document.body.style.overflow = 'scroll'; |
| 22 | document.body.offsetTop; |
| 23 | |
| 24 | if (document.body.clientWidth >= window.innerWidth || |
| 25 | document.body.clientHeight >= window.innerHeight) { |
| 26 | debug("FAILURE!") |
| 27 | return; |
| 28 | } |
| 29 | |
| 30 | debug("SUCCESS!"); |
| 31 | } |
| 32 | </script> |
| 33 | </head> |
| 34 | <body onload="runTests()"> |
| 35 | This tests that clientWidth/clientHeight on the body element in quirks mode returns the visible size of the frame. |
| 36 | <pre id="console"></pre> |
| 37 | </body> |
| 38 | </html> |