blob: f149a8a3c4c8ef7fc9df00047255c472f84cf80e (
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
|
<html>
<head>
<script>
function debug(str) {
pre = document.getElementById('console');
pre.appendChild(document.createTextNode(str + '\n'));
}
function runTests() {
if (window.testRunner)
testRunner.dumpAsText();
if (document.body.clientWidth != window.innerWidth ||
document.body.clientHeight != window.innerHeight) {
debug("FAILURE!")
return;
}
// Now force scroll bars. innerWidth and innerHeight should not take the scroll bar into account
// but clientWidth and clientHeight should.
document.body.style.overflow = 'scroll';
document.body.offsetTop;
if (document.body.clientWidth >= window.innerWidth ||
document.body.clientHeight >= window.innerHeight) {
debug("FAILURE!")
return;
}
debug("SUCCESS!");
}
</script>
</head>
<body onload="runTests()">
This tests that clientWidth/clientHeight on the body element in quirks mode returns the visible size of the frame.
<pre id="console"></pre>
</body>
</html>
|