dir-bdi-script.html (979B)
1 <!DOCTYPE html> 2 <title>HTML Test: BDI: script adds a bdi element with R text and the direction should be RTL</title> 3 <meta charset="utf-8"> 4 <meta name="assert" content="The dir global attribute defaults to auto on the bdi element" /> 5 <link rel="author" title="HTML5 bidi test WG" href="mailto:myid.shin@igalia.com" /> 6 <link rel="help" href="https://html.spec.whatwg.org/multipage/text-level-semantics.html#the-bdi-element" /> 7 <script src="/resources/testharness.js"></script> 8 <script src="/resources/testharnessreport.js"></script> 9 <body> 10 <div id="test1"><bdi>اختبر SomeText</bdi><br></div> 11 <div id="test2"></div> 12 <script> 13 test(() => { 14 assert_equals(getComputedStyle(test1.firstChild).direction, "rtl"); 15 16 const bdi = document.createElement("bdi"); 17 var text = document.createTextNode('اختبر SomeText'); 18 bdi.append(text); 19 test2.append(bdi); 20 21 assert_equals(getComputedStyle(test2.firstChild).direction, "rtl"); 22 }, 'BDI test: Directionality'); 23 </script> 24 </body>