1<html>
2<head>
3<script>
4var theFrame, theImage;
5
6function log(msg)
7{
8 var console = document.getElementById('console');
9 console.appendChild(document.createTextNode(msg));
10 console.appendChild(document.createElement('br'));
11}
12
13function resizeAndCheck(newSize)
14{
15 theFrame.height = newSize;
16
17 log("New frame height is " + theFrame.height);
18 log("New image height is " + theImage.height);
19
20 if (theImage.height == newSize)
21 log("PASSED: Image size is correct");
22 else
23 log("FAILED: Image size is not correct");
24}
25
26function run()
27{
28 if (window.layoutTestController)
29 {
30 layoutTestController.dumpAsText();
31 layoutTestController.waitUntilDone();
32 }
33
34 theFrame = document.getElementById('frame');
35 var frContents = theFrame.contentWindow.document;
36 theImage = frContents.getElementById('img');
37
38 log("Original frame height was " + theFrame.height);
39 log("Original image height was " + theImage.height);
40
41 log("Vertically resizing the frame to be larger");
42 resizeAndCheck(600);
43
44 log("Vertically resizing the frame to be smaller");
45 resizeAndCheck(450);
46
47 if (window.layoutTestController)
48 layoutTestController.notifyDone();
49}
50
51</script>
52</head>
53
54<body onload="run()">
55<iframe height="500" width="500" id="frame" src="resources/vertical-resize-100percent-contents.html"></iframe>
56<p id="console"></p>
57</body>
58
59</html>