blob: e304c9046939f7d38e3648ca6aaeeb6d7b662011 [file] [log] [blame]
<!DOCTYPE html>
<html dir="ltr">
<body>
<div id="someElementInBody"></div>
<script src="../../../resources/js-test-pre.js"></script>
<script>
description('This tests that setting the dir attribute to rtl and clearing it defaults to ltr.');
var someElementInBody = document.getElementById('someElementInBody');
shouldBeEqualToString('getComputedStyle(document.body).direction', 'ltr');
shouldBeEqualToString('getComputedStyle(someElementInBody).direction', 'ltr');
shouldBeEqualToString('document.body.dir = "rtl"; getComputedStyle(document.body).direction', 'rtl');
shouldBeEqualToString('getComputedStyle(someElementInBody).direction', 'rtl');
shouldBeEqualToString('someElementInBody.dir = "rtl"; getComputedStyle(someElementInBody).direction', 'rtl');
shouldBeEqualToString('document.body.dir = ""; getComputedStyle(document.body).direction', 'ltr');
shouldBeEqualToString('getComputedStyle(someElementInBody).direction', 'rtl');
shouldBeEqualToString('someElementInBody.dir = ""; getComputedStyle(someElementInBody).direction', 'ltr');
shouldBeEqualToString('someElementInBody.dir = "ltr"; getComputedStyle(someElementInBody).direction', 'ltr');
shouldBeEqualToString('document.body.dir = "rtl"; getComputedStyle(document.body).direction', 'rtl');
shouldBeEqualToString('someElementInBody.dir = ""; getComputedStyle(someElementInBody).direction', 'rtl');
</script>
<script src="../../../resources/js-test-post.js"></script>
</body>
</html>