blob: fa70a130cda44558c8b7475e81936299d558d517 [file] [log] [blame]
<html>
<head>
<script>
var headReadDocumentDir = document.dir;
document.dir = "rtl";
var headWriteDocumentDir = document.dir;
</script>
</head>
<body>
<div id="description"></div>
<div id="console"></div>
<script src="../../resources/js-test-pre.js"></script>
<script>
description("This tests:<br>"
+ "Bug 9954 REGRESSION: document.dir should return empty string in &lt;head&gt;<br>"
+ "<a href=\"https://bugs.webkit.org/show_bug.cgi?id=9954\">https://bugs.webkit.org/show_bug.cgi?id=9954</a><br>");
debug("Read document.dir in head");
shouldBe("headReadDocumentDir", "''");
debug("");
debug("Write document.dir in head");
shouldBe("headWriteDocumentDir", "''");
debug("");
debug("Read document.dir in body");
shouldBe("document.dir", "''");
debug("");
debug("Read document.body.dir in body");
shouldBe("document.body.dir", "''");
debug("");
debug("Write document.dir in body");
document.dir = "ltr";
shouldBe("document.dir", "'ltr'");
debug("");
debug("Read document.body.dir in body");
shouldBe("document.body.dir", "'ltr'");
debug("");
</script>
<script src="../../resources/js-test-post.js"></script>
</body>
</html>