document-dir.html (1077B)
1 <!DOCTYPE html> 2 <html dir="LTR"> 3 <title>document.dir</title> 4 <link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-document-dir"> 5 <link rel="help" href="https://html.spec.whatwg.org/multipage/#reflect"> 6 <link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com"> 7 <script src="/resources/testharness.js"></script> 8 <script src="/resources/testharnessreport.js"></script> 9 <div id="log"></div> 10 <script> 11 test(function() { 12 assert_equals(document.dir, "ltr"); 13 assert_equals(document.documentElement.getAttribute("dir"), "LTR"); 14 }, "Markup attribute") 15 test(function() { 16 document.dir = "x-garbage"; 17 assert_equals(document.dir, ""); 18 assert_equals(document.documentElement.getAttribute("dir"), "x-garbage"); 19 }, "Setting the idl attribute to a garbage value") 20 test(function() { 21 document.dir = ""; 22 assert_true(document.documentElement.hasAttribute("dir"), "Attribute should still be around"); 23 assert_equals(document.dir, ""); 24 assert_equals(document.documentElement.getAttribute("dir"), ""); 25 }, "Setting the idl attribute to the empty string") 26 </script>