2008-11-04 Anders Carlsson <andersca@apple.com>
[webkit/qt.git] / LayoutTests / fast / dom / document-dir-property.html
blobf99deaf84772f2944e98e181bf2b4f83c9289f27
1 <html>
2 <head>
3 <link rel="stylesheet" href="../js/resources/js-test-style.css">
4 <script>
5 var headReadDocumentDir = document.dir;
6 document.dir = "rtl";
7 var headWriteDocumentDir = document.dir;
8 </script>
9 </head>
10 <body>
11 <div id="description"></div>
12 <div id="console"></div>
13 <script src="../js/resources/js-test-pre.js"></script>
14 <script>
15 description("This tests:<br>"
16 + "Bug 9954 REGRESSION: document.dir should return empty string in &lt;head&gt;<br>"
17 + "<a href=\"http://bugzilla.opendarwin.org/show_bug.cgi?id=9954\">http://bugzilla.opendarwin.org/show_bug.cgi?id=9954</a><br>");
19 debug("Read document.dir in head");
20 shouldBe("headReadDocumentDir", "''");
21 debug("");
23 debug("Write document.dir in head");
24 shouldBe("headWriteDocumentDir", "''");
25 debug("");
27 debug("Read document.dir in body");
28 shouldBe("document.dir", "''");
29 debug("");
31 debug("Read document.body.dir in body");
32 shouldBe("document.body.dir", "''");
33 debug("");
35 debug("Write document.dir in body");
36 document.dir = "ltr";
37 shouldBe("document.dir", "'ltr'");
38 debug("");
40 debug("Read document.body.dir in body");
41 shouldBe("document.body.dir", "'ltr'");
42 debug("");
44 var successfullyParsed = true;
45 </script>
46 <script src="../js/resources/js-test-post.js"></script>
47 </body>
48 </html>