<!doctype html>
<html>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script>
var test = async_test("This tests that setting the dir attribute to rtl and clearing it defaults to ltr");
onload = test.step_func_done(() => {
document.body.dir = 'rtl';
document.body.offsetTop;
document.body.dir = '';
assert_equals(window.getComputedStyle(document.body).direction, 'ltr');
});
</script>
<body>