2008-11-04 Anders Carlsson <andersca@apple.com>
[webkit/qt.git] / LayoutTests / fast / dom / constructors-overriding.html
blob8d21984ce0f72a4c2cbc37b351d7b0e1bfefce9e
1 <html>
2 <head>
3 <script>
4 function print(message, color)
6 var paragraph = document.createElement("div");
7 paragraph.appendChild(document.createTextNode(message));
8 paragraph.style.fontFamily = "monospace";
9 if (color)
10 paragraph.style.color = color;
11 document.getElementById("console").appendChild(paragraph);
14 function shouldBe(a, b)
16 var evalA = eval(a);
17 if (evalA == b)
18 print("PASS: " + a + " should be " + b + " and is.", "green");
19 else
20 print("FAIL: " + a + " should be " + b + " but instead is " + evalA + ".", "red");
23 function test()
25 if (window.layoutTestController)
26 layoutTestController.dumpAsText();
28 window.Image = 1;
29 window.Option = 1;
30 window.XMLHttpRequest = 1;
31 window.XMLSerializer = 1;
32 window.DOMParser = 1;
33 window.XSLTProcessor = 1;
35 shouldBe("window.Image", 1);
36 shouldBe("window.Option", 1);
37 shouldBe("window.XMLHttpRequest", 1);
38 shouldBe("window.XMLSerializer", 1);
39 shouldBe("window.DOMParser", 1);
40 shouldBe("window.XSLTProcessor", 1);
42 </script>
43 </head>
45 <body onload="test();">
46 <p>This page tests whether certain global constructors are read-only. Previous versions of WebKit incorrectly
47 made them read-only.</p>
48 <p>If the test passes, you'll see a series of pass message below.</p>
49 <hr>
51 <div id='console'></div>
53 </body>
54 </html>