4 function print(message
) {
5 var paragraph
= document
.createElement("p");
6 paragraph
.appendChild(document
.createTextNode(message
));
7 document
.getElementById("console").appendChild(paragraph
);
11 if (window
.layoutTestController
) {
12 layoutTestController
.dumpAsText();
15 if (window
=== document
.defaultView
)
16 print("PASS: defaultView is the window object");
18 print("FAIL: defaultView is not the window object");
20 if (document
.defaultView
.document
=== document
)
21 print("PASS: defaultView.document is the document object");
23 print("FAIL: defaultView.document is not the document object");
25 if (document
.defaultView
.getComputedStyle
)
26 print("PASS: defaultView implements getComputedStyle");
28 print("FAIL: defaultView does not implement getComputedStyle");
30 if (document
.defaultView
.getMatchedCSSRules
)
31 print("PASS: defaultView implements getMatchedCSSRules");
33 print("FAIL: defaultView does not implement getMatchedCSSRules");
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>