2008-11-04 Anders Carlsson <andersca@apple.com>
[webkit/qt.git] / LayoutTests / fast / dom / defaultView.html
bloba4c977975fb4b661b20bb3fa861b4bf07066cdc6
1 <html>
2 <head>
3 <script>
4 function print(message) {
5 var paragraph = document.createElement("p");
6 paragraph.appendChild(document.createTextNode(message));
7 document.getElementById("console").appendChild(paragraph);
10 function test() {
11 if (window.layoutTestController) {
12 layoutTestController.dumpAsText();
15 if (window === document.defaultView)
16 print("PASS: defaultView is the window object");
17 else
18 print("FAIL: defaultView is not the window object");
20 if (document.defaultView.document === document)
21 print("PASS: defaultView.document is the document object");
22 else
23 print("FAIL: defaultView.document is not the document object");
25 if (document.defaultView.getComputedStyle)
26 print("PASS: defaultView implements getComputedStyle");
27 else
28 print("FAIL: defaultView does not implement getComputedStyle");
30 if (document.defaultView.getMatchedCSSRules)
31 print("PASS: defaultView implements getMatchedCSSRules");
32 else
33 print("FAIL: defaultView does not implement getMatchedCSSRules");
35 </script>
36 </head>
37 <body onload="test();">
38 <p>This test checks that document.defaultView returns the window object, and that it implements
39 all the methods and properties it should.</p>
40 <p>If the test passes, you will see only PASS messages below.</p>
41 <hr>
42 <div id='console'/>
43 </body>
44 </html>